3 # - Currently this package conflicts with freeradius - should we use Obsolete header ?
4 # - check log files permisions - should be writable by radius user/group
5 # (log files are created by server)
7 %include /usr/lib/rpm/macros.perl
9 Summary: High-performance and highly configurable RADIUS server
10 Summary(pl.UTF-8): Szybki i wysoce konfigurowalny serwer RADIUS
11 Name: freeradius-server
15 Group: Networking/Daemons
16 Source0: ftp://ftp.freeradius.org/pub/radius/%{name}-%{version}.tar.bz2
17 # Source0-md5: 3f7f3491d619542baa72746cbd6a7ed2
18 Source1: %{name}.logrotate
21 Patch0: %{name}-config.patch
22 Patch1: %{name}-libdir.patch
23 Patch2: %{name}-makefile.patch
24 Patch3: %{name}-rundir.patch
25 URL: http://www.freeradius.org/
26 BuildRequires: Firebird-devel
27 BuildRequires: autoconf
28 BuildRequires: automake
29 BuildRequires: cyrus-sasl-devel
30 BuildRequires: gdbm-devel
31 BuildRequires: libeap-ikev2-devel
32 BuildRequires: libtool
33 BuildRequires: net-snmp-utils
34 BuildRequires: mysql-devel
35 BuildRequires: openldap-devel
36 BuildRequires: openssl-devel
37 BuildRequires: pam-devel
38 BuildRequires: perl-devel
39 BuildRequires: postgresql-devel
40 BuildRequires: python-devel
41 BuildRequires: rpmbuild(macros) >= 1.268
42 BuildRequires: sqlite3-devel
43 BuildRequires: unixODBC-devel
44 Requires(post,preun): /sbin/chkconfig
45 Requires(postun): /usr/sbin/groupdel
46 Requires(postun): /usr/sbin/userdel
47 Requires(pre): /bin/id
48 Requires(pre): /usr/bin/getgid
49 Requires(pre): /usr/sbin/groupadd
50 Requires(pre): /usr/sbin/useradd
51 Requires(pre): /usr/sbin/usermod
52 Requires: perl(DynaLoader) = %(%{__perl} -MDynaLoader -e 'print DynaLoader->VERSION')
54 Provides: group(radius)
55 Provides: user(radius)
56 Provides: freeradius = %{version}-%{release}
57 Obsoletes: cistron-radius
58 Obsoletes: freeradius < 2.0
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 find -name 'configure.[ia][nc]' -type f | while read FILE; do
85 %{__aclocal} -I $OLDPWD
87 [ -f config.h.in ] && %{__autoheader}
93 --enable-strict-dependencies \
94 --with-experimental-modules \
95 --with-logdir=%{_var}/log/freeradius \
96 --with-system-libtool \
97 --without-rlm_eap_tnc \
98 --without-rlm_opendirectory \
99 --without-rlm_sql_db2 \
100 --without-rlm_sql_iodbc \
101 --without-rlm_sql_oracle
106 rm -rf $RPM_BUILD_ROOT
108 %{__make} -j1 install \
111 rm -rf $RPM_BUILD_ROOT/%{_docdir}/freeradius
112 rm -rf $RPM_BUILD_ROOT/%{_libdir}/*.a
113 rm -rf $RPM_BUILD_ROOT/%{_libdir}/*.la
114 rm -rf $RPM_BUILD_ROOT/%{_libdir}/freeradius/*.a
115 rm -rf $RPM_BUILD_ROOT/%{_sbindir}/rc.*
116 rm -rf $RPM_BUILD_ROOT/%{_sysconfdir}/*.pl
118 install -d $RPM_BUILD_ROOT/etc/logrotate.d
119 install %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
121 install -d $RPM_BUILD_ROOT/etc/rc.d/init.d
122 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
124 install -d $RPM_BUILD_ROOT/etc/pam.d
125 install %{SOURCE3} $RPM_BUILD_ROOT/etc/pam.d/radius
127 install -d $RPM_BUILD_ROOT%{_var}/log/{,archive}/freeradius/radacct
130 rm -rf $RPM_BUILD_ROOT
133 %groupadd -g 29 -r -f radius
134 %useradd -u 29 -d %{_localstatedir} -s /bin/false -M -r -c "%{name}" -g radius radius
136 # TODO: should be in trigger instead.
137 # upgrade from previous versions of the package, where radius' gid was "nobody"
138 if [ "`id -g radius`" = "99" ]; then
140 chown radius:radius /var/log/%{name}/*.log >/dev/null 2>&1 || :
141 chown radius:radius /var/log/%{name}/radacct/* >/dev/null 2>&1 || :
145 /sbin/chkconfig --add %{name}
146 %service %{name} restart "%{name} daemon"
149 if [ "$1" = "0" ]; then
150 %service %{name} stop
151 /sbin/chkconfig --del %{name}
155 if [ "$1" = "0" ]; then
161 %defattr(644,root,root,755)
163 %dir %{_libdir}/freeradius
164 %dir %{_sysconfdir}/raddb
165 %attr(771,root,radius) %dir %{_var}/log/freeradius
166 %attr(771,root,radius) %dir %{_var}/log/freeradius/radacct
167 %attr(771,root,radius) %dir %{_var}/log/archive/freeradius
168 %attr(771,root,radius) %dir %{_var}/log/archive/freeradius/radacct
169 %attr(775,root,radius) %dir /var/run/freeradius
170 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/raddb/*
171 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/*
172 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/*
173 %attr(754,root,root) /etc/rc.d/init.d/%{name}
174 %attr(755,root,root) %{_bindir}/*
175 %attr(755,root,root) %{_sbindir}/*
176 %attr(755,root,root) %{_libdir}/*.so
177 %attr(755,root,root) %{_libdir}/freeradius/*.la
178 %attr(755,root,root) %{_libdir}/freeradius/*.so
179 %{_datadir}/freeradius
180 %{_includedir}/freeradius