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 Obsoletes: cistron-radius
57 Conflicts: logrotate < 3.7-4
59 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
62 The FreeRADIUS Server Project is an attempt to create a
63 high-performance and highly configurable GPL'd RADIUS server. It is
64 generally similar to the Livingston 2.0 RADIUS server, but has a lot
65 more features, and is much more configurable.
67 %description -l pl.UTF-8
68 Projekt FreeRadius ma na celu stworzenie szybkiego i wysoce
69 konfigurowalnego serwera RADIUS na licencji GPL. Ten jest podobny do
70 Livingston 2.0 RADIUS server ale ma o wiele więcej funkcji i posiada
71 większe możliwości konfigurowania.
81 find -name 'configure.[ia][nc]' -type f | while read FILE; do
84 %{__aclocal} -I $OLDPWD
86 [ -f config.h.in ] && %{__autoheader}
92 --enable-strict-dependencies \
93 --with-experimental-modules \
94 --with-logdir=%{_var}/log/freeradius \
95 --with-system-libtool \
96 --without-rlm_eap_tnc \
97 --without-rlm_opendirectory \
98 --without-rlm_sql_db2 \
99 --without-rlm_sql_iodbc \
100 --without-rlm_sql_oracle
105 rm -rf $RPM_BUILD_ROOT
107 %{__make} -j1 install \
110 rm -rf $RPM_BUILD_ROOT/%{_docdir}/freeradius
111 rm -rf $RPM_BUILD_ROOT/%{_libdir}/*.a
112 rm -rf $RPM_BUILD_ROOT/%{_libdir}/*.la
113 rm -rf $RPM_BUILD_ROOT/%{_libdir}/freeradius/*.a
114 rm -rf $RPM_BUILD_ROOT/%{_sbindir}/rc.*
115 rm -rf $RPM_BUILD_ROOT/%{_sysconfdir}/*.pl
117 install -d $RPM_BUILD_ROOT/etc/logrotate.d
118 install %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
120 install -d $RPM_BUILD_ROOT/etc/rc.d/init.d
121 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
123 install -d $RPM_BUILD_ROOT/etc/pam.d
124 install %{SOURCE3} $RPM_BUILD_ROOT/etc/pam.d/radius
126 install -d $RPM_BUILD_ROOT%{_var}/log/{,archive}/freeradius/radacct
129 rm -rf $RPM_BUILD_ROOT
132 %groupadd -g 29 -r -f radius
133 %useradd -u 29 -d %{_localstatedir} -s /bin/false -M -r -c "%{name}" -g radius radius
135 # TODO: should be in trigger instead.
136 # upgrade from previous versions of the package, where radius' gid was "nobody"
137 if [ "`id -g radius`" = "99" ]; then
139 chown radius:radius /var/log/%{name}/*.log >/dev/null 2>&1 || :
140 chown radius:radius /var/log/%{name}/radacct/* >/dev/null 2>&1 || :
144 /sbin/chkconfig --add %{name}
145 %service %{name} restart "%{name} daemon"
148 if [ "$1" = "0" ]; then
149 %service %{name} stop
150 /sbin/chkconfig --del %{name}
154 if [ "$1" = "0" ]; then
160 %defattr(644,root,root,755)
162 %dir %{_libdir}/freeradius
163 %dir %{_sysconfdir}/raddb
164 %attr(771,root,radius) %dir %{_var}/log/freeradius
165 %attr(771,root,radius) %dir %{_var}/log/freeradius/radacct
166 %attr(771,root,radius) %dir %{_var}/log/archive/freeradius
167 %attr(771,root,radius) %dir %{_var}/log/archive/freeradius/radacct
168 %attr(775,root,radius) %dir /var/run/freeradius
169 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/raddb/*
170 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/*
171 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/*
172 %attr(754,root,root) /etc/rc.d/init.d/%{name}
173 %attr(755,root,root) %{_bindir}/*
174 %attr(755,root,root) %{_sbindir}/*
175 %attr(755,root,root) %{_libdir}/*.so
176 %attr(755,root,root) %{_libdir}/freeradius/*.la
177 %attr(755,root,root) %{_libdir}/freeradius/*.so
178 %{_datadir}/freeradius
179 %{_includedir}/freeradius