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 Provides: user(radius)
30 Provides: group(radius)
31 BuildRequires: autoconf
32 BuildRequires: automake
33 BuildRequires: cyrus-sasl-devel
34 BuildRequires: gdbm-devel
35 BuildRequires: libltdl-devel
36 BuildRequires: libtool
37 BuildRequires: mysql-devel
38 BuildRequires: openldap-devel >= 2.3.0
39 BuildRequires: openssl-devel >= 0.9.7d
40 BuildRequires: pam-devel
41 BuildRequires: perl-devel
42 BuildRequires: postgresql-backend-devel
43 BuildRequires: postgresql-devel
45 BuildRequires: python-devel
46 BuildRequires: net-snmp-devel
47 BuildRequires: unixODBC-devel
48 BuildRequires: rpm-perlprov
49 BuildRequires: rpmbuild(macros) >= 1.202
51 Requires(pre): /usr/bin/getgid
52 Requires(pre): /bin/id
53 Requires(pre): /usr/sbin/groupadd
54 Requires(pre): /usr/sbin/usermod
55 Requires(pre): /usr/sbin/useradd
56 Requires(postun): /usr/sbin/userdel
57 Requires(postun): /usr/sbin/groupdel
58 Requires(post,preun): /sbin/chkconfig
59 Requires: perl(DynaLoader) = %(%{__perl} -MDynaLoader -e 'print DynaLoader->VERSION')
60 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
61 Obsoletes: cistron-radius
64 The FreeRADIUS Server Project is an attempt to create a
65 high-performance and highly configurable GPL'd RADIUS server. It is
66 generally similar to the Livingston 2.0 RADIUS server, but has a lot
67 more features, and is much more configurable.
70 Projekt FreeRadius ma na celu stworzenie szybkiego i wysoce
71 konfigurowalnego serwera RADIUS na licencji GPL. Ten jest podobny do
72 Livingston 2.0 RADIUS server ale ma o wiele wiêcej funkcji i posiada
73 wiêksze mo¿liwo¶ci konfigurowania.
87 awk 'BEGIN { printit=0; } { if (printit) print $0; } /## end libtool.m4/ { printit=1;}' \
88 < aclocal.m4 > acinclude.m4
92 for d in rlm_attr_rewrite rlm_checkval rlm_counter rlm_dbm \
93 rlm_eap/types/rlm_eap_{md5,mschapv2,peap,sim,tls,ttls} \
94 rlm_eap rlm_example rlm_ippool rlm_krb5 rlm_ldap rlm_pam rlm_perl rlm_python \
96 rlm_sql/drivers/rlm_sql_{db2,iodbc,mysql,oracle,postgresql,unixodbc} \
97 rlm_sql rlm_sqlcounter rlm_unix rlm_x99_token ; do
100 %{__aclocal} -I ${maindir}
102 if [ -f config.h.in ]; then
112 SNMPGET="/usr/bin/snmpget" \
113 SNMPWALK="/usr/bin/snmpwalk" \
114 --enable-strict-dependencies \
115 --with-logdir=%{_var}/log/freeradius \
116 --with-experimental-modules \
120 --with-ltdl-include=%{_includedir}/none \
121 --with-ltdl-lib=%{_libdir} \
122 --disable-ltdl-install \
126 LIBTOOL="`pwd`/libtool --tag=CC"
129 rm -rf $RPM_BUILD_ROOT
130 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/raddb,%{_libdir}/%{name}} \
131 $RPM_BUILD_ROOT/etc/{logrotate.d,pam.d,rc.d/init.d} \
132 $RPM_BUILD_ROOT%{_var}/log/{,archiv}/freeradius/radacct
135 LIBTOOL="`pwd`/libtool --tag=CC" \
138 rm -f $RPM_BUILD_ROOT{%{_mandir}/man8/builddbm.8,%{_sbindir}/rc.radiusd}
139 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/raddb/{clients,*.pl}
141 install %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
142 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
143 install %{SOURCE3} $RPM_BUILD_ROOT/etc/pam.d/radius
145 # remove useless static modules and library
146 # rlm*.la are used (lt_dlopen)
147 rm -f $RPM_BUILD_ROOT%{_libdir}/{*.a,*.la}
148 rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/*.a
151 rm -rf $RPM_BUILD_ROOT
154 %groupadd -g 29 -r -f radius
155 %useradd -u 29 -d %{_localstatedir} -s /bin/false -M -r -c "%{name}" -g radius radius
157 # TODO: should be in trigger instead.
158 # upgrade from previous versions of the package, where radius' gid was "nobody"
159 if [ "`id -g radius`" = "99" ]; then
161 chown radius:radius /var/log/%{name}/*.log >/dev/null 2>&1 || :
162 chown radius:radius /var/log/%{name}/radacct/* >/dev/null 2>&1 || :
166 /sbin/chkconfig --add %{name}
167 if [ -f /var/lock/subsys/%{name} ]; then
168 /etc/rc.d/init.d/%{name} restart 1>&2
170 echo "Run \"/etc/rc.d/init.d/%{name} start\" to start %{name} daemon."
174 if [ "$1" = "0" ]; then
175 if [ -f /var/lock/subsys/%{name} ]; then
176 /etc/rc.d/init.d/%{name} stop 1>&2
178 /sbin/chkconfig --del %{name}
182 if [ "$1" = "0" ]; then
188 %defattr(644,root,root,755)
190 %doc src/modules/rlm_sql/drivers/*/*.sql
191 %attr(755,root,root) %{_bindir}/*
192 %attr(755,root,root) %{_sbindir}/*
193 %attr(755,root,root) %{_libdir}/*.so
194 %dir %{_libdir}/%{name}
195 %attr(755,root,root) %{_libdir}/%{name}/*.so
196 %{_libdir}/%{name}/*.la
197 %{_datadir}/freeradius
199 %dir %{_sysconfdir}/raddb
200 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/raddb/*
202 %attr(771,root,radius) %dir %{_var}/log/%{name}
203 %attr(771,root,radius) %dir %{_var}/log/%{name}/radacct
204 %attr(771,root,radius) %dir %{_var}/log/archiv/%{name}
205 %attr(771,root,radius) %dir %{_var}/log/archiv/%{name}/radacct
206 %attr(775,root,radius) %dir /var/run/%{name}
208 %attr(754,root,root) /etc/rc.d/init.d/%{name}
209 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/*
210 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/*