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 # - SECURITY: http://www.gentoo.org/security/en/glsa/glsa-200505-13.xml
8 Summary: High-performance and highly configurable RADIUS server
9 Summary(pl): Szybki i wysoce konfigurowalny serwer RADIUS
14 Group: Networking/Daemons
15 Source0: ftp://ftp.freeradius.org/pub/radius/%{name}-%{version}.tar.gz
16 # Source0-md5: f5dfce4efbb03bbc47ceae08270a875e
17 Source1: %{name}.logrotate
20 Patch0: %{name}-autoconf_mysql.patch
21 Patch1: %{name}-makefile.patch
22 Patch2: %{name}-smbencrypt.patch
23 Patch3: %{name}-linking.patch
24 Patch4: %{name}-moduledir.patch
25 Patch5: %{name}-rundir.patch
26 Patch6: %{name}-config.patch
27 URL: http://www.freeradius.org/
28 Provides: user(radius)
29 Provides: group(radius)
30 BuildRequires: autoconf
31 BuildRequires: automake
32 BuildRequires: cyrus-sasl-devel
33 BuildRequires: gdbm-devel
34 BuildRequires: libltdl-devel
35 BuildRequires: libtool
36 BuildRequires: mysql-devel
37 BuildRequires: openldap-devel
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: net-snmp-devel
46 BuildRequires: unixODBC-devel
47 BuildRequires: rpm-perlprov
48 BuildRequires: rpmbuild(macros) >= 1.202
50 Requires(pre): /usr/bin/getgid
51 Requires(pre): /bin/id
52 Requires(pre): /usr/sbin/groupadd
53 Requires(pre): /usr/sbin/usermod
54 Requires(pre): /usr/sbin/useradd
55 Requires(postun): /usr/sbin/userdel
56 Requires(postun): /usr/sbin/groupdel
57 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.
85 awk 'BEGIN { printit=0; } { if (printit) print $0; } /## end libtool.m4/ { printit=1;}' \
86 < 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_pam rlm_perl rlm_python \
94 rlm_sql/drivers/rlm_sql_{db2,iodbc,mysql,oracle,postgresql,unixodbc} \
95 rlm_sql rlm_sqlcounter rlm_unix rlm_x99_token ; do
98 %{__aclocal} -I ${maindir}
100 if [ -f config.h.in ]; then
110 SNMPGET="/usr/bin/snmpget" \
111 SNMPWALK="/usr/bin/snmpwalk" \
112 --enable-strict-dependencies \
113 --with-logdir=%{_var}/log/freeradius \
114 --with-experimental-modules \
118 --with-ltdl-include=%{_includedir}/none \
119 --with-ltdl-lib=%{_libdir} \
120 --disable-ltdl-install \
124 LIBTOOL="`pwd`/libtool --tag=CC"
127 rm -rf $RPM_BUILD_ROOT
128 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/raddb,%{_libdir}/%{name}} \
129 $RPM_BUILD_ROOT/etc/{logrotate.d,pam.d,rc.d/init.d} \
130 $RPM_BUILD_ROOT%{_var}/log/radius
133 LIBTOOL="`pwd`/libtool --tag=CC" \
136 rm -f $RPM_BUILD_ROOT{%{_mandir}/man8/builddbm.8,%{_sbindir}/rc.radiusd}
137 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/raddb/{clients,*.pl}
139 install %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
140 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
141 install %{SOURCE3} $RPM_BUILD_ROOT/etc/pam.d/radius
143 # remove useless static modules and library
144 # rlm*.la are used (lt_dlopen)
145 rm -f $RPM_BUILD_ROOT%{_libdir}/{*.a,libradius.la}
146 rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/{*.a,libradius.la}
149 rm -rf $RPM_BUILD_ROOT
152 %groupadd -g 29 -r -f radius
153 %useradd -u 29 -d %{_localstatedir} -s /bin/false -M -r -c "%{name}" -g radius radius
155 # TODO: should be in trigger instead.
156 # upgrade from previous versions of the package, where radius' gid was "nobody"
157 if [ "`id -g radius`" = "99" ]; then
159 chown radius:radius /var/log/%{name}/*.log >/dev/null 2>&1 || :
160 chown radius:radius /var/log/%{name}/radacct/* >/dev/null 2>&1 || :
164 /sbin/chkconfig --add %{name}
165 if [ -f /var/lock/subsys/%{name} ]; then
166 /etc/rc.d/init.d/%{name} restart 1>&2
168 echo "Run \"/etc/rc.d/init.d/%{name} start\" to start %{name} daemon."
172 if [ "$1" = "0" ]; then
173 if [ -f /var/lock/subsys/%{name} ]; then
174 /etc/rc.d/init.d/%{name} stop 1>&2
176 /sbin/chkconfig --del %{name}
180 if [ "$1" = "0" ]; then
186 %defattr(644,root,root,755)
188 %doc src/modules/rlm_sql/drivers/*/*.sql
189 %attr(755,root,root) %{_bindir}/*
190 %attr(755,root,root) %{_sbindir}/*
191 %attr(755,root,root) %{_libdir}/*.so
193 %dir %{_libdir}/%{name}
194 %attr(755,root,root) %{_libdir}/%{name}/*.so
195 %{_libdir}/%{name}/*.la
196 %{_datadir}/freeradius
198 %dir %{_sysconfdir}/raddb
199 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/raddb/*
201 %attr(771,root,radius) %dir %{_var}/log/%{name}
202 %attr(771,root,radius) %dir %{_var}/log/%{name}/radacct
203 %attr(775,root,radius) %dir /var/run/%{name}
205 %attr(754,root,root) /etc/rc.d/init.d/%{name}
206 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/*
207 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/*