]>
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 | |
0a62ea03 PG |
12 | Version: 2.1.1 |
13 | Release: 0.1 | |
b3332a9e | 14 | License: GPL |
0a62ea03 | 15 | Group: Networking/Daemons/Radius |
b3332a9e | 16 | Source0: ftp://ftp.freeradius.org/pub/radius/%{name}-%{version}.tar.bz2 |
0a62ea03 | 17 | # Source0-md5: 4ccf748ef9851d90844d085647351ca4 |
b3332a9e | 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) | |
80f87d24 | 56 | Provides: freeradius = %{version}-%{release} |
b3332a9e | 57 | Obsoletes: cistron-radius |
80f87d24 | 58 | Obsoletes: freeradius < 2.0 |
b3332a9e | 59 | Conflicts: logrotate < 3.7-4 |
b3332a9e | 60 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
61 | ||
62 | %description | |
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. | |
67 | ||
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. | |
73 | ||
74 | %prep | |
75 | %setup -q | |
76 | %patch0 -p1 | |
77 | %patch1 -p1 | |
78 | %patch2 -p1 | |
79 | %patch3 -p1 | |
80 | ||
81 | %build | |
82 | find -name 'configure.[ia][nc]' -type f | while read FILE; do | |
83 | cd $(dirname "$FILE") | |
84 | %{__libtoolize} | |
85 | %{__aclocal} -I $OLDPWD | |
86 | %{__autoconf} | |
87 | [ -f config.h.in ] && %{__autoheader} | |
88 | cd - | |
89 | done | |
90 | ||
91 | LIBS="-lgdbm" \ | |
92 | %configure \ | |
93 | --enable-strict-dependencies \ | |
94 | --with-experimental-modules \ | |
95 | --with-logdir=%{_var}/log/freeradius \ | |
96 | --with-system-libtool \ | |
7fd3fae8 | 97 | --without-rlm_eap_tnc \ |
b3332a9e | 98 | --without-rlm_opendirectory \ |
99 | --without-rlm_sql_db2 \ | |
100 | --without-rlm_sql_iodbc \ | |
101 | --without-rlm_sql_oracle | |
102 | ||
103 | %{make} -j1 | |
104 | ||
105 | %install | |
106 | rm -rf $RPM_BUILD_ROOT | |
107 | ||
108 | %{__make} -j1 install \ | |
109 | R=$RPM_BUILD_ROOT | |
110 | ||
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 | |
117 | ||
118 | install -d $RPM_BUILD_ROOT/etc/logrotate.d | |
119 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/%{name} | |
120 | ||
121 | install -d $RPM_BUILD_ROOT/etc/rc.d/init.d | |
122 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} | |
123 | ||
124 | install -d $RPM_BUILD_ROOT/etc/pam.d | |
125 | install %{SOURCE3} $RPM_BUILD_ROOT/etc/pam.d/radius | |
126 | ||
127 | install -d $RPM_BUILD_ROOT%{_var}/log/{,archive}/freeradius/radacct | |
128 | ||
129 | %clean | |
130 | rm -rf $RPM_BUILD_ROOT | |
131 | ||
132 | %pre | |
133 | %groupadd -g 29 -r -f radius | |
134 | %useradd -u 29 -d %{_localstatedir} -s /bin/false -M -r -c "%{name}" -g radius radius | |
135 | ||
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 | |
139 | usermod -g 29 radius | |
140 | chown radius:radius /var/log/%{name}/*.log >/dev/null 2>&1 || : | |
141 | chown radius:radius /var/log/%{name}/radacct/* >/dev/null 2>&1 || : | |
142 | fi | |
143 | ||
144 | %post | |
145 | /sbin/chkconfig --add %{name} | |
146 | %service %{name} restart "%{name} daemon" | |
147 | ||
148 | %preun | |
149 | if [ "$1" = "0" ]; then | |
150 | %service %{name} stop | |
151 | /sbin/chkconfig --del %{name} | |
152 | fi | |
153 | ||
154 | %postun | |
155 | if [ "$1" = "0" ]; then | |
156 | %userremove radius | |
157 | %groupremove radius | |
158 | fi | |
159 | ||
160 | %files | |
161 | %defattr(644,root,root,755) | |
162 | %doc doc/* | |
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 | |
181 | %{_mandir}/man?/* |