2 %include /usr/lib/rpm/macros.perl
4 # - won't be good to include these contrib examples?
5 # Source1: http://www.ping.de/~fdc/radius/radacct-replay
6 # Source3: ftp://ftp.freeradius.org/pub/radius/contrib/radwho.cgi
7 Summary: High-performance and highly configurable RADIUS server
8 Summary(pl): Szybki i wysoce konfigurowalny serwer RADIUS
13 Group: Networking/Daemons
14 Source0: ftp://ftp.freeradius.org/pub/radius/%{name}-%{version}.tar.gz
15 # Source0-md5: f5dfce4efbb03bbc47ceae08270a875e
16 Source1: %{name}.logrotate
19 Patch0: %{name}-autoconf_mysql.patch
20 Patch1: %{name}-makefile.patch
21 Patch2: %{name}-smbencrypt.patch
22 Patch3: %{name}-linking.patch
23 Patch4: %{name}-moduledir.patch
24 Patch5: %{name}-rundir.patch
25 Patch6: %{name}-config.patch
26 Patch7: %{name}-eap_install_order.patch
27 Patch8: %{name}-sql_injection.patch
28 URL: http://www.freeradius.org/
29 BuildRequires: autoconf
30 BuildRequires: automake
31 BuildRequires: cyrus-sasl-devel
32 BuildRequires: gdbm-devel
33 BuildRequires: libltdl-devel
34 BuildRequires: libtool
35 BuildRequires: mysql-devel
36 BuildRequires: net-snmp-devel
37 BuildRequires: openldap-devel >= 2.3.0
38 BuildRequires: openssl-devel >= 0.9.7d
39 BuildRequires: pam-devel
40 BuildRequires: perl-devel
41 BuildRequires: postgresql-backend-devel
42 BuildRequires: postgresql-devel
44 BuildRequires: python-devel
45 BuildRequires: rpm-perlprov
46 BuildRequires: rpmbuild(macros) >= 1.202
47 BuildRequires: rpmbuild(macros) >= 1.268
48 BuildRequires: unixODBC-devel
49 Requires(post,preun): /sbin/chkconfig
50 Requires(postun): /usr/sbin/groupdel
51 Requires(postun): /usr/sbin/userdel
52 Requires(pre): /bin/id
53 Requires(pre): /usr/bin/getgid
54 Requires(pre): /usr/sbin/groupadd
55 Requires(pre): /usr/sbin/useradd
56 Requires(pre): /usr/sbin/usermod
57 Requires: perl(DynaLoader) = %(%{__perl} -MDynaLoader -e 'print DynaLoader->VERSION')
59 Provides: group(radius)
60 Provides: user(radius)
61 Obsoletes: cistron-radius
62 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
65 The FreeRADIUS Server Project is an attempt to create a
66 high-performance and highly configurable GPL'd RADIUS server. It is
67 generally similar to the Livingston 2.0 RADIUS server, but has a lot
68 more features, and is much more configurable.
71 Projekt FreeRadius ma na celu stworzenie szybkiego i wysoce
72 konfigurowalnego serwera RADIUS na licencji GPL. Ten jest podobny do
73 Livingston 2.0 RADIUS server ale ma o wiele wiêcej funkcji i posiada
74 wiêksze mo¿liwo¶ci konfigurowania.
88 awk 'BEGIN { printit=0; } { if (printit) print $0; } /## end libtool.m4/ { printit=1;}' \
89 < aclocal.m4 > acinclude.m4
93 for d in rlm_attr_rewrite rlm_checkval rlm_counter rlm_dbm \
94 rlm_eap/types/rlm_eap_{md5,mschapv2,peap,sim,tls,ttls} \
95 rlm_eap rlm_example rlm_ippool rlm_krb5 rlm_ldap rlm_pam rlm_perl rlm_python \
97 rlm_sql/drivers/rlm_sql_{db2,iodbc,mysql,oracle,postgresql,unixodbc} \
98 rlm_sql rlm_sqlcounter rlm_unix rlm_x99_token ; do
101 %{__aclocal} -I ${maindir}
103 if [ -f config.h.in ]; then
113 SNMPGET="/usr/bin/snmpget" \
114 SNMPWALK="/usr/bin/snmpwalk" \
115 --enable-strict-dependencies \
116 --with-logdir=%{_var}/log/freeradius \
117 --with-experimental-modules \
121 --with-ltdl-include=%{_includedir}/none \
122 --with-ltdl-lib=%{_libdir} \
123 --disable-ltdl-install \
127 LIBTOOL="`pwd`/libtool --tag=CC"
130 rm -rf $RPM_BUILD_ROOT
131 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/raddb,%{_libdir}/%{name}} \
132 $RPM_BUILD_ROOT/etc/{logrotate.d,pam.d,rc.d/init.d} \
133 $RPM_BUILD_ROOT%{_var}/log/{,archiv}/freeradius/radacct
136 LIBTOOL="`pwd`/libtool --tag=CC" \
139 rm -f $RPM_BUILD_ROOT{%{_mandir}/man8/builddbm.8,%{_sbindir}/rc.radiusd}
140 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/raddb/{clients,*.pl}
142 install %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
143 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
144 install %{SOURCE3} $RPM_BUILD_ROOT/etc/pam.d/radius
146 # remove useless static modules and library
147 # rlm*.la are used (lt_dlopen)
148 rm -f $RPM_BUILD_ROOT%{_libdir}/{*.a,*.la}
149 rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/*.a
152 rm -rf $RPM_BUILD_ROOT
155 %groupadd -g 29 -r -f radius
156 %useradd -u 29 -d %{_localstatedir} -s /bin/false -M -r -c "%{name}" -g radius radius
158 # TODO: should be in trigger instead.
159 # upgrade from previous versions of the package, where radius' gid was "nobody"
160 if [ "`id -g radius`" = "99" ]; then
162 chown radius:radius /var/log/%{name}/*.log >/dev/null 2>&1 || :
163 chown radius:radius /var/log/%{name}/radacct/* >/dev/null 2>&1 || :
167 /sbin/chkconfig --add %{name}
168 %service %{name} restart "%{name} daemon"
171 if [ "$1" = "0" ]; then
172 %service %{name} stop
173 /sbin/chkconfig --del %{name}
177 if [ "$1" = "0" ]; then
183 %defattr(644,root,root,755)
185 %doc src/modules/rlm_sql/drivers/*/*.sql
186 %attr(755,root,root) %{_bindir}/*
187 %attr(755,root,root) %{_sbindir}/*
188 %attr(755,root,root) %{_libdir}/*.so
189 %dir %{_libdir}/%{name}
190 %attr(755,root,root) %{_libdir}/%{name}/*.so
191 %{_libdir}/%{name}/*.la
192 %{_datadir}/freeradius
194 %dir %{_sysconfdir}/raddb
195 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/raddb/*
197 %attr(771,root,radius) %dir %{_var}/log/%{name}
198 %attr(771,root,radius) %dir %{_var}/log/%{name}/radacct
199 %attr(771,root,radius) %dir %{_var}/log/archiv/%{name}
200 %attr(771,root,radius) %dir %{_var}/log/archiv/%{name}/radacct
201 %attr(775,root,radius) %dir /var/run/%{name}
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/*