]>
Commit | Line | Data |
---|---|---|
b3332a9e | 1 | # |
2 | # TODO: | |
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) | |
6 | # | |
7 | %include /usr/lib/rpm/macros.perl | |
8 | # | |
9 | Summary: High-performance and highly configurable RADIUS server | |
10 | Summary(pl.UTF-8): Szybki i wysoce konfigurowalny serwer RADIUS | |
11 | Name: freeradius-server | |
12 | Version: 2.0.3 | |
13 | Release: 1 | |
14 | License: GPL | |
15 | Group: Networking/Daemons | |
16 | Source0: ftp://ftp.freeradius.org/pub/radius/%{name}-%{version}.tar.bz2 | |
17 | # Source0-md5: 3cd647f40880dee8693f2e74ab5416e9 | |
18 | Source1: %{name}.logrotate | |
19 | Source2: %{name}.init | |
20 | Source3: %{name}.pam | |
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') | |
53 | Requires: rc-scripts | |
54 | Provides: group(radius) | |
55 | Provides: user(radius) | |
56 | Obsoletes: cistron-radius | |
57 | Conflicts: logrotate < 3.7-4 | |
58 | Conflicts: freeradius | |
59 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
60 | ||
61 | %description | |
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. | |
66 | ||
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. | |
72 | ||
73 | %prep | |
74 | %setup -q | |
75 | %patch0 -p1 | |
76 | %patch1 -p1 | |
77 | %patch2 -p1 | |
78 | %patch3 -p1 | |
79 | ||
80 | %build | |
81 | find -name 'configure.[ia][nc]' -type f | while read FILE; do | |
82 | cd $(dirname "$FILE") | |
83 | %{__libtoolize} | |
84 | %{__aclocal} -I $OLDPWD | |
85 | %{__autoconf} | |
86 | [ -f config.h.in ] && %{__autoheader} | |
87 | cd - | |
88 | done | |
89 | ||
90 | LIBS="-lgdbm" \ | |
91 | %configure \ | |
92 | --enable-strict-dependencies \ | |
93 | --with-experimental-modules \ | |
94 | --with-logdir=%{_var}/log/freeradius \ | |
95 | --with-system-libtool \ | |
96 | --without-rlm_opendirectory \ | |
97 | --without-rlm_sql_db2 \ | |
98 | --without-rlm_sql_iodbc \ | |
99 | --without-rlm_sql_oracle | |
100 | ||
101 | %{make} -j1 | |
102 | ||
103 | %install | |
104 | rm -rf $RPM_BUILD_ROOT | |
105 | ||
106 | %{__make} -j1 install \ | |
107 | R=$RPM_BUILD_ROOT | |
108 | ||
109 | rm -rf $RPM_BUILD_ROOT/%{_docdir}/freeradius | |
110 | rm -rf $RPM_BUILD_ROOT/%{_libdir}/*.a | |
111 | rm -rf $RPM_BUILD_ROOT/%{_libdir}/*.la | |
112 | rm -rf $RPM_BUILD_ROOT/%{_libdir}/freeradius/*.a | |
113 | rm -rf $RPM_BUILD_ROOT/%{_sbindir}/rc.* | |
114 | rm -rf $RPM_BUILD_ROOT/%{_sysconfdir}/*.pl | |
115 | ||
116 | install -d $RPM_BUILD_ROOT/etc/logrotate.d | |
117 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/%{name} | |
118 | ||
119 | install -d $RPM_BUILD_ROOT/etc/rc.d/init.d | |
120 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} | |
121 | ||
122 | install -d $RPM_BUILD_ROOT/etc/pam.d | |
123 | install %{SOURCE3} $RPM_BUILD_ROOT/etc/pam.d/radius | |
124 | ||
125 | install -d $RPM_BUILD_ROOT%{_var}/log/{,archive}/freeradius/radacct | |
126 | ||
127 | %clean | |
128 | rm -rf $RPM_BUILD_ROOT | |
129 | ||
130 | %pre | |
131 | %groupadd -g 29 -r -f radius | |
132 | %useradd -u 29 -d %{_localstatedir} -s /bin/false -M -r -c "%{name}" -g radius radius | |
133 | ||
134 | # TODO: should be in trigger instead. | |
135 | # upgrade from previous versions of the package, where radius' gid was "nobody" | |
136 | if [ "`id -g radius`" = "99" ]; then | |
137 | usermod -g 29 radius | |
138 | chown radius:radius /var/log/%{name}/*.log >/dev/null 2>&1 || : | |
139 | chown radius:radius /var/log/%{name}/radacct/* >/dev/null 2>&1 || : | |
140 | fi | |
141 | ||
142 | %post | |
143 | /sbin/chkconfig --add %{name} | |
144 | %service %{name} restart "%{name} daemon" | |
145 | ||
146 | %preun | |
147 | if [ "$1" = "0" ]; then | |
148 | %service %{name} stop | |
149 | /sbin/chkconfig --del %{name} | |
150 | fi | |
151 | ||
152 | %postun | |
153 | if [ "$1" = "0" ]; then | |
154 | %userremove radius | |
155 | %groupremove radius | |
156 | fi | |
157 | ||
158 | %files | |
159 | %defattr(644,root,root,755) | |
160 | %doc doc/* | |
161 | %dir %{_libdir}/freeradius | |
162 | %dir %{_sysconfdir}/raddb | |
163 | %attr(771,root,radius) %dir %{_var}/log/freeradius | |
164 | %attr(771,root,radius) %dir %{_var}/log/freeradius/radacct | |
165 | %attr(771,root,radius) %dir %{_var}/log/archive/freeradius | |
166 | %attr(771,root,radius) %dir %{_var}/log/archive/freeradius/radacct | |
167 | %attr(775,root,radius) %dir /var/run/freeradius | |
168 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/raddb/* | |
169 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/* | |
170 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/* | |
171 | %attr(754,root,root) /etc/rc.d/init.d/%{name} | |
172 | %attr(755,root,root) %{_bindir}/* | |
173 | %attr(755,root,root) %{_sbindir}/* | |
174 | %attr(755,root,root) %{_libdir}/*.so | |
175 | %attr(755,root,root) %{_libdir}/freeradius/*.la | |
176 | %attr(755,root,root) %{_libdir}/freeradius/*.so | |
177 | %{_datadir}/freeradius | |
178 | %{_includedir}/freeradius | |
179 | %{_mandir}/man?/* |