]>
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 | |
1e6843ce PG |
7 | # - move plugins into separate packages: |
8 | # /usr/sbin/radsniff: libpcap | |
9 | # /usr/lib/freeradius/rlm_eap_ikev2-2.1.1.so: libeap-ikev2 | |
10 | # /usr/lib/freeradius/rlm_krb5-2.1.1.so: libkrb5, libcom_err, libkrb5support, libkeyutils | |
11 | # /usr/lib/freeradius/rlm_ldap-2.1.1.so: libldap_r, liblber, libsasl2, libcrypt, libssl | |
12 | # /usr/lib/freeradius/rlm_otp-2.1.1.so | |
13 | # /usr/lib/freeradius/rlm_pam-2.1.1.so | |
14 | # /usr/lib/freeradius/rlm_perl-2.1.1.so | |
15 | # /usr/lib/freeradius/rlm_python-2.1.1.so | |
16 | # /usr/lib/freeradius/rlm_sql_mysql-2.1.1.so | |
17 | # /usr/lib/freeradius/rlm_sql_postgresql-2.1.1.so | |
18 | # /usr/lib/freeradius/rlm_sql_sqlite-2.1.1.so | |
19 | # /usr/lib/freeradius/rlm_sql_unixodbc-2.1.1.so | |
20 | # /usr/lib/freeradius/rlm_unix-2.1.1.so | |
b3332a9e | 21 | # |
22 | %include /usr/lib/rpm/macros.perl | |
23 | # | |
24 | Summary: High-performance and highly configurable RADIUS server | |
25 | Summary(pl.UTF-8): Szybki i wysoce konfigurowalny serwer RADIUS | |
26 | Name: freeradius-server | |
0a62ea03 | 27 | Version: 2.1.1 |
1e6843ce | 28 | Release: 0.10 |
b3332a9e | 29 | License: GPL |
0a62ea03 | 30 | Group: Networking/Daemons/Radius |
b3332a9e | 31 | Source0: ftp://ftp.freeradius.org/pub/radius/%{name}-%{version}.tar.bz2 |
0a62ea03 | 32 | # Source0-md5: 4ccf748ef9851d90844d085647351ca4 |
b3332a9e | 33 | Source1: %{name}.logrotate |
34 | Source2: %{name}.init | |
35 | Source3: %{name}.pam | |
36 | Patch0: %{name}-config.patch | |
37 | Patch1: %{name}-libdir.patch | |
38 | Patch2: %{name}-makefile.patch | |
39 | Patch3: %{name}-rundir.patch | |
40 | URL: http://www.freeradius.org/ | |
41 | BuildRequires: Firebird-devel | |
42 | BuildRequires: autoconf | |
43 | BuildRequires: automake | |
44 | BuildRequires: cyrus-sasl-devel | |
45 | BuildRequires: gdbm-devel | |
46 | BuildRequires: libeap-ikev2-devel | |
47 | BuildRequires: libtool | |
48 | BuildRequires: net-snmp-utils | |
49 | BuildRequires: mysql-devel | |
50 | BuildRequires: openldap-devel | |
51 | BuildRequires: openssl-devel | |
52 | BuildRequires: pam-devel | |
53 | BuildRequires: perl-devel | |
54 | BuildRequires: postgresql-devel | |
55 | BuildRequires: python-devel | |
56 | BuildRequires: rpmbuild(macros) >= 1.268 | |
57 | BuildRequires: sqlite3-devel | |
58 | BuildRequires: unixODBC-devel | |
59 | Requires(post,preun): /sbin/chkconfig | |
60 | Requires(postun): /usr/sbin/groupdel | |
61 | Requires(postun): /usr/sbin/userdel | |
62 | Requires(pre): /bin/id | |
63 | Requires(pre): /usr/bin/getgid | |
64 | Requires(pre): /usr/sbin/groupadd | |
65 | Requires(pre): /usr/sbin/useradd | |
66 | Requires(pre): /usr/sbin/usermod | |
67 | Requires: perl(DynaLoader) = %(%{__perl} -MDynaLoader -e 'print DynaLoader->VERSION') | |
68 | Requires: rc-scripts | |
1e6843ce | 69 | Requires: %{name}-libs = %{version}-%{release} |
b3332a9e | 70 | Provides: group(radius) |
71 | Provides: user(radius) | |
80f87d24 | 72 | Provides: freeradius = %{version}-%{release} |
b3332a9e | 73 | Obsoletes: cistron-radius |
80f87d24 | 74 | Obsoletes: freeradius < 2.0 |
b3332a9e | 75 | Conflicts: logrotate < 3.7-4 |
b3332a9e | 76 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
77 | ||
1e6843ce | 78 | %define mibdir %{_datadir}/snmp/mibs |
10649a33 PG |
79 | %define filterout_ld -Wl,--as-needed |
80 | ||
b3332a9e | 81 | %description |
82 | The FreeRADIUS Server Project is an attempt to create a | |
83 | high-performance and highly configurable GPL'd RADIUS server. It is | |
84 | generally similar to the Livingston 2.0 RADIUS server, but has a lot | |
85 | more features, and is much more configurable. | |
86 | ||
87 | %description -l pl.UTF-8 | |
88 | Projekt FreeRadius ma na celu stworzenie szybkiego i wysoce | |
89 | konfigurowalnego serwera RADIUS na licencji GPL. Ten jest podobny do | |
90 | Livingston 2.0 RADIUS server ale ma o wiele więcej funkcji i posiada | |
91 | większe możliwości konfigurowania. | |
92 | ||
1e6843ce PG |
93 | %package mibs |
94 | Summary: MIB database for %{name} | |
95 | Summary(pl.UTF-8): Baza danych MIB dla %{name} | |
96 | Group: Applications/System | |
97 | Suggests: libsmi | |
98 | ||
99 | %description mibs | |
100 | MIB database for %{name}. | |
101 | ||
102 | %description mibs -l pl.UTF-8 | |
103 | Baza danych MIB dla %{name}. | |
104 | ||
105 | ||
106 | %package libs | |
107 | Summary: Freeradius libraries | |
108 | Group: Libraries | |
109 | ||
110 | %description libs | |
111 | Freeradius libraries. | |
112 | ||
113 | %package devel | |
114 | Summary: Header files and devel library | |
115 | Group: Development/Libraries | |
116 | Requires: %{name}-libs = %{version}-%{release} | |
117 | ||
118 | %description devel | |
119 | Header files and libraries. | |
120 | ||
b3332a9e | 121 | %prep |
122 | %setup -q | |
123 | %patch0 -p1 | |
124 | %patch1 -p1 | |
125 | %patch2 -p1 | |
126 | %patch3 -p1 | |
127 | ||
128 | %build | |
10649a33 PG |
129 | # Keep it for future when ac/am regeneration will be ok |
130 | #find -name 'configure.[ia][nc]' -type f | while read FILE; do | |
131 | # cd $(dirname "$FILE") | |
132 | # %{__libtoolize} | |
133 | # %{__aclocal} -I $OLDPWD | |
134 | # %{__autoconf} | |
135 | # [ -f config.h.in ] && %{__autoheader} | |
136 | # cd - | |
137 | #done | |
b3332a9e | 138 | |
139 | LIBS="-lgdbm" \ | |
140 | %configure \ | |
141 | --enable-strict-dependencies \ | |
142 | --with-experimental-modules \ | |
143 | --with-logdir=%{_var}/log/freeradius \ | |
144 | --with-system-libtool \ | |
7fd3fae8 | 145 | --without-rlm_eap_tnc \ |
b3332a9e | 146 | --without-rlm_opendirectory \ |
147 | --without-rlm_sql_db2 \ | |
148 | --without-rlm_sql_iodbc \ | |
149 | --without-rlm_sql_oracle | |
150 | ||
151 | %{make} -j1 | |
152 | ||
153 | %install | |
154 | rm -rf $RPM_BUILD_ROOT | |
10649a33 | 155 | install -d $RPM_BUILD_ROOT/etc/{logrotate.d,rc.d/init.d,pam.d} \ |
1e6843ce PG |
156 | $RPM_BUILD_ROOT%{_var}/log/{,archive}/freeradius/radacct \ |
157 | $RPM_BUILD_ROOT%{mibdir} | |
b3332a9e | 158 | |
159 | %{__make} -j1 install \ | |
160 | R=$RPM_BUILD_ROOT | |
161 | ||
b3332a9e | 162 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/%{name} |
b3332a9e | 163 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} |
b3332a9e | 164 | install %{SOURCE3} $RPM_BUILD_ROOT/etc/pam.d/radius |
165 | ||
1e6843ce PG |
166 | # Install mibs: |
167 | install mibs/FREERADIUS-*.txt $RPM_BUILD_ROOT%{mibdir} | |
168 | ||
10649a33 PG |
169 | # Cleanups: |
170 | rm -rf $RPM_BUILD_ROOT%{_docdir}/freeradius \ | |
171 | $RPM_BUILD_ROOT%{_libdir}/*.{a,la} \ | |
172 | $RPM_BUILD_ROOT%{_libdir}/freeradius/*.a \ | |
173 | $RPM_BUILD_ROOT%{_sbindir}/rc.* \ | |
174 | $RPM_BUILD_ROOT%{_sysconfdir}/*.pl | |
b3332a9e | 175 | |
176 | %clean | |
177 | rm -rf $RPM_BUILD_ROOT | |
178 | ||
179 | %pre | |
180 | %groupadd -g 29 -r -f radius | |
181 | %useradd -u 29 -d %{_localstatedir} -s /bin/false -M -r -c "%{name}" -g radius radius | |
182 | ||
183 | # TODO: should be in trigger instead. | |
184 | # upgrade from previous versions of the package, where radius' gid was "nobody" | |
185 | if [ "`id -g radius`" = "99" ]; then | |
186 | usermod -g 29 radius | |
187 | chown radius:radius /var/log/%{name}/*.log >/dev/null 2>&1 || : | |
188 | chown radius:radius /var/log/%{name}/radacct/* >/dev/null 2>&1 || : | |
189 | fi | |
190 | ||
191 | %post | |
192 | /sbin/chkconfig --add %{name} | |
193 | %service %{name} restart "%{name} daemon" | |
194 | ||
195 | %preun | |
196 | if [ "$1" = "0" ]; then | |
197 | %service %{name} stop | |
198 | /sbin/chkconfig --del %{name} | |
199 | fi | |
200 | ||
201 | %postun | |
202 | if [ "$1" = "0" ]; then | |
203 | %userremove radius | |
204 | %groupremove radius | |
205 | fi | |
206 | ||
1e6843ce PG |
207 | %post libs -p /sbin/ldconfig |
208 | %postun libs -p /sbin/ldconfig | |
209 | ||
b3332a9e | 210 | %files |
211 | %defattr(644,root,root,755) | |
1e6843ce | 212 | %doc doc/* scripts |
b3332a9e | 213 | %dir %{_sysconfdir}/raddb |
214 | %attr(771,root,radius) %dir %{_var}/log/freeradius | |
215 | %attr(771,root,radius) %dir %{_var}/log/freeradius/radacct | |
216 | %attr(771,root,radius) %dir %{_var}/log/archive/freeradius | |
217 | %attr(771,root,radius) %dir %{_var}/log/archive/freeradius/radacct | |
218 | %attr(775,root,radius) %dir /var/run/freeradius | |
219 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/raddb/* | |
220 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/* | |
221 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/* | |
222 | %attr(754,root,root) /etc/rc.d/init.d/%{name} | |
223 | %attr(755,root,root) %{_bindir}/* | |
224 | %attr(755,root,root) %{_sbindir}/* | |
b3332a9e | 225 | %attr(755,root,root) %{_libdir}/freeradius/*.la |
226 | %attr(755,root,root) %{_libdir}/freeradius/*.so | |
227 | %{_datadir}/freeradius | |
b3332a9e | 228 | %{_mandir}/man?/* |
1e6843ce PG |
229 | |
230 | %files libs | |
231 | %defattr(644,root,root,755) | |
232 | %attr(755,root,root) %{_libdir}/libfreeradius-eap-?.?.?.so | |
233 | %attr(755,root,root) %{_libdir}/libfreeradius-radius-?.?.?.so | |
234 | %dir %{_libdir}/freeradius | |
235 | ||
236 | %files devel | |
237 | %defattr(644,root,root,755) | |
238 | %{_includedir}/freeradius | |
239 | %{_libdir}/libfreeradius-eap.so | |
240 | %{_libdir}/libfreeradius-radius.so | |
241 | ||
242 | %files mibs | |
243 | %defattr(644,root,root,755) | |
244 | %doc mibs/*.chart | |
245 | %{mibdir}/*.* |