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.UTF-8): 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: 5c126cb2122b8e2ba9784b511fbefd96
16 Source1: %{name}.logrotate
19 Patch0: %{name}-makefile.patch
20 Patch1: %{name}-linking.patch
21 Patch2: %{name}-moduledir.patch
22 Patch3: %{name}-rundir.patch
23 Patch4: %{name}-config.patch
24 URL: http://www.freeradius.org/
25 BuildRequires: autoconf
26 BuildRequires: automake
27 BuildRequires: cyrus-sasl-devel
28 BuildRequires: gdbm-devel
29 BuildRequires: krb5-devel
30 BuildRequires: libcom_err-devel
31 BuildRequires: libltdl-devel
32 BuildRequires: libtool
33 BuildRequires: mysql-devel
34 BuildRequires: net-snmp-devel
35 BuildRequires: openldap-devel >= 2.4.6
36 BuildRequires: openssl-devel >= 0.9.7d
37 BuildRequires: pam-devel
38 BuildRequires: perl-devel
39 BuildRequires: postgresql-backend-devel
40 BuildRequires: postgresql-devel
42 BuildRequires: python-devel
43 BuildRequires: rpm-perlprov
44 BuildRequires: rpmbuild(macros) >= 1.268
45 BuildRequires: unixODBC-devel
46 Requires(post,preun): /sbin/chkconfig
47 Requires(postun): /usr/sbin/groupdel
48 Requires(postun): /usr/sbin/userdel
49 Requires(pre): /bin/id
50 Requires(pre): /usr/bin/getgid
51 Requires(pre): /usr/sbin/groupadd
52 Requires(pre): /usr/sbin/useradd
53 Requires(pre): /usr/sbin/usermod
54 Requires: perl(DynaLoader) = %(%{__perl} -MDynaLoader -e 'print DynaLoader->VERSION')
56 Provides: group(radius)
57 Provides: user(radius)
58 Obsoletes: cistron-radius
59 Conflicts: logrotate < 3.7-4
60 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
63 The FreeRADIUS Server Project is an attempt to create a
64 high-performance and highly configurable GPL'd RADIUS server. It is
65 generally similar to the Livingston 2.0 RADIUS server, but has a lot
66 more features, and is much more configurable.
68 %description -l pl.UTF-8
69 Projekt FreeRadius ma na celu stworzenie szybkiego i wysoce
70 konfigurowalnego serwera RADIUS na licencji GPL. Ten jest podobny do
71 Livingston 2.0 RADIUS server ale ma o wiele więcej funkcji i posiada
72 większe możliwości konfigurowania.
82 sed -e '/m4_include..libtool/d' < aclocal.m4 > acinclude.m4
86 for d in rlm_attr_rewrite rlm_checkval rlm_counter rlm_dbm \
87 rlm_eap/types/rlm_eap_{md5,mschapv2,peap,sim,tls,ttls} \
88 rlm_eap rlm_example rlm_ippool rlm_krb5 rlm_ldap rlm_otp \
89 rlm_pam rlm_perl rlm_python rlm_radutmp rlm_smb \
90 rlm_sql/drivers/rlm_sql_{db2,iodbc,mysql,oracle,postgresql,unixodbc} \
91 rlm_sql rlm_sqlcounter rlm_sql_log rlm_unix ; do
94 if [ -f configure.in ]; then
95 %{__aclocal} -I ${maindir}
98 if [ -f config.h.in ]; then
108 SNMPGET="/usr/bin/snmpget" \
109 SNMPWALK="/usr/bin/snmpwalk" \
110 --enable-strict-dependencies \
111 --with-logdir=%{_var}/log/freeradius \
112 --with-experimental-modules \
116 --with-ltdl-include=%{_includedir}/none \
117 --with-ltdl-lib=%{_libdir} \
118 --disable-ltdl-install \
121 LIBTOOL="`pwd`/libtool --tag=CC"
124 rm -rf $RPM_BUILD_ROOT
125 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/raddb,%{_libdir}/%{name}} \
126 $RPM_BUILD_ROOT/etc/{logrotate.d,pam.d,rc.d/init.d} \
127 $RPM_BUILD_ROOT%{_var}/log/{,archive}/freeradius/radacct
129 %{__make} -j1 install \
130 LIBTOOL="`pwd`/libtool --tag=CC" \
133 rm -f $RPM_BUILD_ROOT{%{_mandir}/man8/builddbm.8,%{_sbindir}/rc.radiusd}
134 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/raddb/{clients,*.pl}
136 install %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
137 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
138 install %{SOURCE3} $RPM_BUILD_ROOT/etc/pam.d/radius
140 # remove useless static modules and library
141 # rlm*.la are used (lt_dlopen)
142 rm -f $RPM_BUILD_ROOT%{_libdir}/{*.a,*.la}
143 rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/*.a
146 rm -rf $RPM_BUILD_ROOT
149 %groupadd -g 29 -r -f radius
150 %useradd -u 29 -d %{_localstatedir} -s /bin/false -M -r -c "%{name}" -g radius radius
152 # TODO: should be in trigger instead.
153 # upgrade from previous versions of the package, where radius' gid was "nobody"
154 if [ "`id -g radius`" = "99" ]; then
156 chown radius:radius /var/log/%{name}/*.log >/dev/null 2>&1 || :
157 chown radius:radius /var/log/%{name}/radacct/* >/dev/null 2>&1 || :
161 /sbin/chkconfig --add %{name}
162 %service %{name} restart "%{name} daemon"
165 if [ "$1" = "0" ]; then
166 %service %{name} stop
167 /sbin/chkconfig --del %{name}
171 if [ "$1" = "0" ]; then
177 %defattr(644,root,root,755)
179 %attr(755,root,root) %{_bindir}/*
180 %attr(755,root,root) %{_sbindir}/*
181 %attr(755,root,root) %{_libdir}/*.so
182 %dir %{_libdir}/%{name}
183 %attr(755,root,root) %{_libdir}/%{name}/*.so
184 %{_libdir}/%{name}/*.la
185 %{_datadir}/freeradius
187 %dir %{_sysconfdir}/raddb
188 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/raddb/*
190 %attr(771,root,radius) %dir %{_var}/log/%{name}
191 %attr(771,root,radius) %dir %{_var}/log/%{name}/radacct
192 %attr(771,root,radius) %dir %{_var}/log/archive/%{name}
193 %attr(771,root,radius) %dir %{_var}/log/archive/%{name}/radacct
194 %attr(775,root,radius) %dir /var/run/%{name}
196 %attr(754,root,root) /etc/rc.d/init.d/%{name}
197 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/*
198 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/*