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
8 # - finish update to 1.1.6
9 Summary: High-performance and highly configurable RADIUS server
10 Summary(pl.UTF-8): Szybki i wysoce konfigurowalny serwer RADIUS
15 Group: Networking/Daemons
16 Source0: ftp://ftp.freeradius.org/pub/radius/%{name}-%{version}.tar.gz
17 # Source0-md5: a053d353ce5f393cb70795fd363a586f
18 Source1: %{name}.logrotate
21 Patch0: %{name}-makefile.patch
22 Patch1: %{name}-smbencrypt.patch
23 Patch2: %{name}-linking.patch
24 Patch3: %{name}-moduledir.patch
25 Patch4: %{name}-rundir.patch
26 Patch5: %{name}-config.patch
27 Patch6: %{name}-eap_install_order.patch
28 URL: http://www.freeradius.org/
29 BuildRequires: autoconf
30 BuildRequires: automake
31 BuildRequires: cyrus-sasl-devel
32 BuildRequires: gdbm-devel
33 BuildRequires: krb5-devel
34 BuildRequires: libltdl-devel
35 BuildRequires: libtool
36 BuildRequires: mysql-devel
37 BuildRequires: net-snmp-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: rpm-perlprov
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.
70 %description -l pl.UTF-8
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.
86 sed -e '/m4_include..libtool/d' < aclocal.m4 > acinclude.m4
90 for d in rlm_attr_rewrite rlm_checkval rlm_counter rlm_dbm \
91 rlm_eap/types/rlm_eap_{md5,mschapv2,peap,sim,tls,ttls} \
92 rlm_eap rlm_example rlm_ippool rlm_krb5 rlm_ldap rlm_otp \
93 rlm_pam rlm_perl rlm_python rlm_radutmp rlm_smb \
94 rlm_sql/drivers/rlm_sql_{db2,iodbc,mysql,oracle,postgresql,unixodbc} \
95 rlm_sql rlm_sqlcounter rlm_unix ; do
96 # rlm_sql_log - no configure.{in,ac}
99 %{__aclocal} -I ${maindir}
101 if [ -f config.h.in ]; then
111 SNMPGET="/usr/bin/snmpget" \
112 SNMPWALK="/usr/bin/snmpwalk" \
113 --enable-strict-dependencies \
114 --with-logdir=%{_var}/log/freeradius \
115 --with-experimental-modules \
119 --with-ltdl-include=%{_includedir}/none \
120 --with-ltdl-lib=%{_libdir} \
121 --disable-ltdl-install \
125 LIBTOOL="`pwd`/libtool --tag=CC"
128 rm -rf $RPM_BUILD_ROOT
129 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/raddb,%{_libdir}/%{name}} \
130 $RPM_BUILD_ROOT/etc/{logrotate.d,pam.d,rc.d/init.d} \
131 $RPM_BUILD_ROOT%{_var}/log/{,archive}/freeradius/radacct
134 LIBTOOL="`pwd`/libtool --tag=CC" \
137 rm -f $RPM_BUILD_ROOT{%{_mandir}/man8/builddbm.8,%{_sbindir}/rc.radiusd}
138 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/raddb/{clients,*.pl}
140 install %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
141 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
142 install %{SOURCE3} $RPM_BUILD_ROOT/etc/pam.d/radius
144 # remove useless static modules and library
145 # rlm*.la are used (lt_dlopen)
146 rm -f $RPM_BUILD_ROOT%{_libdir}/{*.a,*.la}
147 rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/*.a
150 rm -rf $RPM_BUILD_ROOT
153 %groupadd -g 29 -r -f radius
154 %useradd -u 29 -d %{_localstatedir} -s /bin/false -M -r -c "%{name}" -g radius radius
156 # TODO: should be in trigger instead.
157 # upgrade from previous versions of the package, where radius' gid was "nobody"
158 if [ "`id -g radius`" = "99" ]; then
160 chown radius:radius /var/log/%{name}/*.log >/dev/null 2>&1 || :
161 chown radius:radius /var/log/%{name}/radacct/* >/dev/null 2>&1 || :
165 /sbin/chkconfig --add %{name}
166 %service %{name} restart "%{name} daemon"
169 if [ "$1" = "0" ]; then
170 %service %{name} stop
171 /sbin/chkconfig --del %{name}
175 if [ "$1" = "0" ]; then
181 %defattr(644,root,root,755)
183 %doc src/modules/rlm_sql/drivers/*/*.sql
184 %attr(755,root,root) %{_bindir}/*
185 %attr(755,root,root) %{_sbindir}/*
186 %attr(755,root,root) %{_libdir}/*.so
187 %dir %{_libdir}/%{name}
188 %attr(755,root,root) %{_libdir}/%{name}/*.so
189 %{_libdir}/%{name}/*.la
190 %{_datadir}/freeradius
192 %dir %{_sysconfdir}/raddb
193 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/raddb/*
195 %attr(771,root,radius) %dir %{_var}/log/%{name}
196 %attr(771,root,radius) %dir %{_var}/log/%{name}/radacct
197 %attr(771,root,radius) %dir %{_var}/log/archive/%{name}
198 %attr(771,root,radius) %dir %{_var}/log/archive/%{name}/radacct
199 %attr(775,root,radius) %dir /var/run/%{name}
201 %attr(754,root,root) /etc/rc.d/init.d/%{name}
202 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/*
203 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/*