]>
Commit | Line | Data |
---|---|---|
b3332a9e | 1 | # |
2 | # TODO: | |
10649a33 PG |
3 | # - check log files permisions - should be writable by radius user/group |
4 | # (log files are created by server) | |
5 | # - prepare to use with --as-needed | |
6 | # - ac/am regeneration doesn't work | |
b3332a9e | 7 | # |
8 | %include /usr/lib/rpm/macros.perl | |
9 | # | |
10 | Summary: High-performance and highly configurable RADIUS server | |
11 | Summary(pl.UTF-8): Szybki i wysoce konfigurowalny serwer RADIUS | |
12 | Name: freeradius-server | |
0a62ea03 | 13 | Version: 2.1.1 |
10649a33 | 14 | Release: 0.9 |
b3332a9e | 15 | License: GPL |
0a62ea03 | 16 | Group: Networking/Daemons/Radius |
b3332a9e | 17 | Source0: ftp://ftp.freeradius.org/pub/radius/%{name}-%{version}.tar.bz2 |
0a62ea03 | 18 | # Source0-md5: 4ccf748ef9851d90844d085647351ca4 |
b3332a9e | 19 | Source1: %{name}.logrotate |
20 | Source2: %{name}.init | |
21 | Source3: %{name}.pam | |
22 | Patch0: %{name}-config.patch | |
23 | Patch1: %{name}-libdir.patch | |
24 | Patch2: %{name}-makefile.patch | |
25 | Patch3: %{name}-rundir.patch | |
26 | URL: http://www.freeradius.org/ | |
27 | BuildRequires: Firebird-devel | |
28 | BuildRequires: autoconf | |
29 | BuildRequires: automake | |
30 | BuildRequires: cyrus-sasl-devel | |
31 | BuildRequires: gdbm-devel | |
32 | BuildRequires: libeap-ikev2-devel | |
33 | BuildRequires: libtool | |
34 | BuildRequires: net-snmp-utils | |
35 | BuildRequires: mysql-devel | |
36 | BuildRequires: openldap-devel | |
37 | BuildRequires: openssl-devel | |
38 | BuildRequires: pam-devel | |
39 | BuildRequires: perl-devel | |
40 | BuildRequires: postgresql-devel | |
41 | BuildRequires: python-devel | |
42 | BuildRequires: rpmbuild(macros) >= 1.268 | |
43 | BuildRequires: sqlite3-devel | |
44 | BuildRequires: unixODBC-devel | |
45 | Requires(post,preun): /sbin/chkconfig | |
46 | Requires(postun): /usr/sbin/groupdel | |
47 | Requires(postun): /usr/sbin/userdel | |
48 | Requires(pre): /bin/id | |
49 | Requires(pre): /usr/bin/getgid | |
50 | Requires(pre): /usr/sbin/groupadd | |
51 | Requires(pre): /usr/sbin/useradd | |
52 | Requires(pre): /usr/sbin/usermod | |
53 | Requires: perl(DynaLoader) = %(%{__perl} -MDynaLoader -e 'print DynaLoader->VERSION') | |
54 | Requires: rc-scripts | |
55 | Provides: group(radius) | |
56 | Provides: user(radius) | |
80f87d24 | 57 | Provides: freeradius = %{version}-%{release} |
b3332a9e | 58 | Obsoletes: cistron-radius |
80f87d24 | 59 | Obsoletes: freeradius < 2.0 |
b3332a9e | 60 | Conflicts: logrotate < 3.7-4 |
b3332a9e | 61 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
62 | ||
10649a33 PG |
63 | %define filterout_ld -Wl,--as-needed |
64 | ||
b3332a9e | 65 | %description |
66 | The FreeRADIUS Server Project is an attempt to create a | |
67 | high-performance and highly configurable GPL'd RADIUS server. It is | |
68 | generally similar to the Livingston 2.0 RADIUS server, but has a lot | |
69 | more features, and is much more configurable. | |
70 | ||
71 | %description -l pl.UTF-8 | |
72 | Projekt FreeRadius ma na celu stworzenie szybkiego i wysoce | |
73 | konfigurowalnego serwera RADIUS na licencji GPL. Ten jest podobny do | |
74 | Livingston 2.0 RADIUS server ale ma o wiele więcej funkcji i posiada | |
75 | większe możliwości konfigurowania. | |
76 | ||
77 | %prep | |
78 | %setup -q | |
79 | %patch0 -p1 | |
80 | %patch1 -p1 | |
81 | %patch2 -p1 | |
82 | %patch3 -p1 | |
83 | ||
84 | %build | |
10649a33 PG |
85 | # Keep it for future when ac/am regeneration will be ok |
86 | #find -name 'configure.[ia][nc]' -type f | while read FILE; do | |
87 | # cd $(dirname "$FILE") | |
88 | # %{__libtoolize} | |
89 | # %{__aclocal} -I $OLDPWD | |
90 | # %{__autoconf} | |
91 | # [ -f config.h.in ] && %{__autoheader} | |
92 | # cd - | |
93 | #done | |
b3332a9e | 94 | |
95 | LIBS="-lgdbm" \ | |
96 | %configure \ | |
97 | --enable-strict-dependencies \ | |
98 | --with-experimental-modules \ | |
99 | --with-logdir=%{_var}/log/freeradius \ | |
100 | --with-system-libtool \ | |
7fd3fae8 | 101 | --without-rlm_eap_tnc \ |
b3332a9e | 102 | --without-rlm_opendirectory \ |
103 | --without-rlm_sql_db2 \ | |
104 | --without-rlm_sql_iodbc \ | |
105 | --without-rlm_sql_oracle | |
106 | ||
107 | %{make} -j1 | |
108 | ||
109 | %install | |
110 | rm -rf $RPM_BUILD_ROOT | |
10649a33 PG |
111 | install -d $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d,pam.d} \ |
112 | $RPM_BUILD_ROOT%{_var}/log/{,archive}/freeradius/radacct | |
b3332a9e | 113 | |
114 | %{__make} -j1 install \ | |
115 | R=$RPM_BUILD_ROOT | |
116 | ||
b3332a9e | 117 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/%{name} |
b3332a9e | 118 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} |
b3332a9e | 119 | install %{SOURCE3} $RPM_BUILD_ROOT/etc/pam.d/radius |
120 | ||
10649a33 PG |
121 | # Cleanups: |
122 | rm -rf $RPM_BUILD_ROOT%{_docdir}/freeradius \ | |
123 | $RPM_BUILD_ROOT%{_libdir}/*.{a,la} \ | |
124 | $RPM_BUILD_ROOT%{_libdir}/freeradius/*.a \ | |
125 | $RPM_BUILD_ROOT%{_sbindir}/rc.* \ | |
126 | $RPM_BUILD_ROOT%{_sysconfdir}/*.pl | |
b3332a9e | 127 | |
128 | %clean | |
129 | rm -rf $RPM_BUILD_ROOT | |
130 | ||
131 | %pre | |
132 | %groupadd -g 29 -r -f radius | |
133 | %useradd -u 29 -d %{_localstatedir} -s /bin/false -M -r -c "%{name}" -g radius radius | |
134 | ||
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 | |
138 | usermod -g 29 radius | |
139 | chown radius:radius /var/log/%{name}/*.log >/dev/null 2>&1 || : | |
140 | chown radius:radius /var/log/%{name}/radacct/* >/dev/null 2>&1 || : | |
141 | fi | |
142 | ||
143 | %post | |
144 | /sbin/chkconfig --add %{name} | |
145 | %service %{name} restart "%{name} daemon" | |
146 | ||
147 | %preun | |
148 | if [ "$1" = "0" ]; then | |
149 | %service %{name} stop | |
150 | /sbin/chkconfig --del %{name} | |
151 | fi | |
152 | ||
153 | %postun | |
154 | if [ "$1" = "0" ]; then | |
155 | %userremove radius | |
156 | %groupremove radius | |
157 | fi | |
158 | ||
159 | %files | |
160 | %defattr(644,root,root,755) | |
161 | %doc doc/* | |
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 | |
180 | %{_mandir}/man?/* |