]> git.pld-linux.org Git - packages/freeradius.git/blob - freeradius.spec
82f8f25c2f2a2103e0a76f5376c8eb259391e02d
[packages/freeradius.git] / freeradius.spec
1 #
2 %include        /usr/lib/rpm/macros.perl
3 # FIXME: won't be good to include these contrib examples?
4 # Source1:      http://www.ping.de/~fdc/radius/radacct-replay
5 # Source3:      ftp://ftp.freeradius.org/pub/radius/contrib/radwho.cgi
6 Summary:        High-performance and highly configurable RADIUS server
7 Summary(pl):    Szybki i wysoce konfigurowalny serwer RADIUS
8 Name:           freeradius
9 Version:        1.0.2
10 Release:        1
11 License:        GPL
12 Group:          Networking/Daemons
13 Source0:        ftp://ftp.freeradius.org/pub/radius/%{name}-%{version}.tar.gz
14 # Source0-md5:  f5dfce4efbb03bbc47ceae08270a875e
15 Source1:        %{name}.logrotate
16 Source2:        %{name}.init
17 Source3:        %{name}.pam
18 Patch0:         %{name}-autoconf_mysql.patch
19 Patch1:         %{name}-makefile.patch
20 Patch2:         %{name}-smbencrypt.patch
21 Patch3:         %{name}-linking.patch
22 Patch4:         %{name}-moduledir.patch
23 Patch5:         %{name}-rundir.patch
24 Patch6:         %{name}-config.patch
25 URL:            http://www.freeradius.org/
26 Provides:       user(radius)
27 Provides:       group(radius)
28 BuildRequires:  autoconf
29 BuildRequires:  automake
30 BuildRequires:  cyrus-sasl-devel
31 BuildRequires:  gdbm-devel
32 BuildRequires:  libltdl-devel
33 BuildRequires:  libtool
34 BuildRequires:  mysql-devel
35 BuildRequires:  openldap-devel
36 BuildRequires:  openssl-devel >= 0.9.7d
37 BuildRequires:  pam-devel
38 BuildRequires:  perl-devel
39 BuildRequires:  postgresql-backend-devel
40 BuildRequires:  postgresql-devel
41 BuildRequires:  python
42 BuildRequires:  python-devel
43 BuildRequires:  net-snmp-devel
44 BuildRequires:  unixODBC-devel
45 BuildRequires:  rpm-perlprov
46 BuildRequires:  rpmbuild(macros) >= 1.202
47 PreReq:         rc-scripts
48 Requires(pre):  /usr/bin/getgid
49 Requires(pre):  /bin/id
50 Requires(pre):  /usr/sbin/groupadd
51 Requires(pre):  /usr/sbin/usermod
52 Requires(pre):  /usr/sbin/useradd
53 Requires(postun):       /usr/sbin/userdel
54 Requires(postun):       /usr/sbin/groupdel
55 Requires(post,preun):   /sbin/chkconfig
56 Requires:       libtool
57 Requires:       perl(DynaLoader) = %(%{__perl} -MDynaLoader -e 'print DynaLoader->VERSION')
58 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
59 Obsoletes:      cistron-radius
60
61 %description
62 The FreeRADIUS Server Project is an attempt to create a
63 high-performance and highly configurable GPL'd RADIUS server. It is
64 generally similar to the Livingston 2.0 RADIUS server, but has a lot
65 more features, and is much more configurable.
66
67 %description -l pl
68 Projekt FreeRadius ma na celu stworzenie szybkiego i wysoce
69 konfigurowalnego serwera RADIUS na licencji GPL. Ten jest podobny do
70 Livingston 2.0 RADIUS server ale ma o wiele wiêcej funkcji i posiada
71 wiêksze mo¿liwo¶ci konfigurowania.
72
73 %prep
74 %setup -q
75 %patch0 -p1
76 %patch1 -p1
77 %patch2 -p1
78 %patch3 -p1
79 %patch4 -p1
80 %patch5 -p1
81 %patch6 -p1
82
83 awk 'BEGIN { printit=0; } { if (printit) print $0; } /## end libtool.m4/ { printit=1;}' \
84         < aclocal.m4 > acinclude.m4
85
86 %build
87 maindir="$(pwd)"
88 for d in rlm_attr_rewrite rlm_checkval rlm_counter rlm_dbm \
89         rlm_eap/types/rlm_eap_{md5,mschapv2,peap,sim,tls,ttls} \
90         rlm_eap rlm_example rlm_ippool rlm_krb5 rlm_ldap rlm_pam rlm_perl rlm_python \
91         rlm_radutmp rlm_smb \
92         rlm_sql/drivers/rlm_sql_{db2,iodbc,mysql,oracle,postgresql,unixodbc} \
93         rlm_sql rlm_sqlcounter rlm_unix rlm_x99_token ; do
94
95         cd src/modules/${d}
96         %{__aclocal} -I ${maindir}
97         %{__autoconf}
98         if [ -f config.h.in ]; then
99                 %{__autoheader}
100         fi
101         cd ${maindir}
102 done
103 %{__libtoolize}
104 %{__aclocal}
105 %{__autoconf}
106 %{__autoheader}
107 %configure \
108         SNMPGET="/usr/bin/snmpget" \
109         SNMPWALK="/usr/bin/snmpwalk" \
110         --enable-strict-dependencies \
111         --with-logdir=%{_var}/log/freeradius \
112         --with-experimental-modules \
113         --with-threads \
114         --with-thread-pool \
115         --with-gnu-ld \
116         --with-ltdl-include=%{_includedir}/none \
117         --with-ltdl-lib=%{_libdir} \
118         --disable-ltdl-install \
119         --without-rlm_krb5 \
120         --without-rlm_dbm
121 %{__make} \
122         LIBTOOL="`pwd`/libtool --tag=CC"
123
124 %install
125 rm -rf $RPM_BUILD_ROOT
126 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/raddb,%{_libdir}/%{name}} \
127         $RPM_BUILD_ROOT/etc/{logrotate.d,pam.d,rc.d/init.d} \
128         $RPM_BUILD_ROOT%{_var}/log/radius
129
130 %{__make} install \
131         LIBTOOL="`pwd`/libtool --tag=CC" \
132         R=$RPM_BUILD_ROOT
133
134 rm -f $RPM_BUILD_ROOT{%{_mandir}/man8/builddbm.8,%{_sbindir}/rc.radiusd}
135 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/raddb/{clients,*.pl}
136
137 install %{SOURCE1}      $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
138 install %{SOURCE2}      $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
139 install %{SOURCE3}      $RPM_BUILD_ROOT/etc/pam.d/radius
140
141 # remove useless static modules and library
142 # rlm*.la are used (lt_dlopen)
143 rm -f $RPM_BUILD_ROOT%{_libdir}/{*.a,libradius.la}
144 rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/{*.a,libradius.la}
145
146 %clean
147 rm -rf $RPM_BUILD_ROOT
148
149 %pre
150 %groupadd -g 29 -r -f radius
151 %useradd -u 29 -d %{_localstatedir} -s /bin/false -M -r -c "%{name}" -g radius radius
152
153 # TODO: should be in trigger instead.
154 # upgrade from previous versions of the package, where radius' gid was "nobody"
155 if [ "`id -g radius`" = "99" ]; then
156         usermod -g 29 radius
157         chown radius:radius /var/log/%{name}/*.log >/dev/null 2>&1 || :
158         chown radius:radius /var/log/%{name}/radacct/* >/dev/null 2>&1 || :
159 fi
160
161 %post
162 /sbin/chkconfig --add %{name}
163 if [ -f /var/lock/subsys/%{name} ]; then
164         /etc/rc.d/init.d/%{name} restart 1>&2
165 else
166         echo "Run \"/etc/rc.d/init.d/%{name} start\" to start %{name} daemon."
167 fi
168
169 %preun
170 if [ "$1" = "0" ]; then
171         if [ -f /var/lock/subsys/%{name} ]; then
172                 /etc/rc.d/init.d/%{name} stop 1>&2
173         fi
174         /sbin/chkconfig --del %{name}
175 fi
176
177 %postun
178 if [ "$1" = "0" ]; then
179         %userremove radius
180         %groupremove radius
181 fi
182
183 %files
184 %defattr(644,root,root,755)
185 %doc doc/*
186 %doc src/modules/rlm_sql/drivers/*/*.sql
187 %attr(755,root,root) %{_bindir}/*
188 %attr(755,root,root) %{_sbindir}/*
189 %attr(755,root,root) %{_libdir}/*.so
190 %{_libdir}/*.la
191 %dir %{_libdir}/%{name}
192 %attr(755,root,root) %{_libdir}/%{name}/*.so
193 %{_libdir}/%{name}/*.la
194 %{_datadir}/freeradius
195
196 %dir %{_sysconfdir}/raddb
197 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/raddb/*
198
199 %attr(771,root,radius) %dir %{_var}/log/%{name}
200 %attr(771,root,radius) %dir %{_var}/log/%{name}/radacct
201 %attr(775,root,radius) %dir /var/run/%{name}
202
203 %attr(754,root,root) /etc/rc.d/init.d/%{name}
204 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/*
205 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/*
206
207 %{_mandir}/man?/*
This page took 0.077346 seconds and 3 git commands to generate.