]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | %include /usr/lib/rpm/macros.perl | |
3 | # FIXME: | |
4 | # - won't be good to include these contrib examples? | |
5 | # Source1: http://www.ping.de/~fdc/radius/radacct-replay | |
6 | # Source3: ftp://ftp.freeradius.org/pub/radius/contrib/radwho.cgi | |
7 | Summary: High-performance and highly configurable RADIUS server | |
8 | Summary(pl.UTF-8): Szybki i wysoce konfigurowalny serwer RADIUS | |
9 | Name: freeradius | |
10 | Version: 1.1.7 | |
11 | Release: 0.2 | |
12 | License: GPL | |
13 | Group: Networking/Daemons | |
14 | Source0: ftp://ftp.freeradius.org/pub/radius/%{name}-%{version}.tar.gz | |
15 | # Source0-md5: 5c126cb2122b8e2ba9784b511fbefd96 | |
16 | Source1: %{name}.logrotate | |
17 | Source2: %{name}.init | |
18 | Source3: %{name}.pam | |
19 | Patch0: %{name}-makefile.patch | |
20 | Patch1: %{name}-linking.patch | |
21 | Patch2: %{name}-moduledir.patch | |
22 | Patch3: %{name}-rundir.patch | |
23 | Patch4: %{name}-config.patch | |
24 | URL: http://www.freeradius.org/ | |
25 | BuildRequires: autoconf | |
26 | BuildRequires: automake | |
27 | BuildRequires: cyrus-sasl-devel | |
28 | BuildRequires: gdbm-devel | |
29 | BuildRequires: krb5-devel | |
30 | BuildRequires: libcom_err-devel | |
31 | BuildRequires: libltdl-devel | |
32 | BuildRequires: libtool | |
33 | BuildRequires: mysql-devel | |
34 | BuildRequires: net-snmp-devel | |
35 | BuildRequires: openldap-devel >= 2.4.6 | |
36 | BuildRequires: openssl-devel >= 0.9.7d | |
37 | BuildRequires: pam-devel | |
38 | BuildRequires: perl-devel | |
39 | BuildRequires: postgresql-backend-devel | |
40 | BuildRequires: postgresql-devel | |
41 | BuildRequires: python | |
42 | BuildRequires: python-devel | |
43 | BuildRequires: rpm-perlprov | |
44 | BuildRequires: rpmbuild(macros) >= 1.268 | |
45 | BuildRequires: unixODBC-devel | |
46 | Requires(post,preun): /sbin/chkconfig | |
47 | Requires(postun): /usr/sbin/groupdel | |
48 | Requires(postun): /usr/sbin/userdel | |
49 | Requires(pre): /bin/id | |
50 | Requires(pre): /usr/bin/getgid | |
51 | Requires(pre): /usr/sbin/groupadd | |
52 | Requires(pre): /usr/sbin/useradd | |
53 | Requires(pre): /usr/sbin/usermod | |
54 | Requires: perl(DynaLoader) = %(%{__perl} -MDynaLoader -e 'print DynaLoader->VERSION') | |
55 | Requires: rc-scripts | |
56 | Provides: group(radius) | |
57 | Provides: user(radius) | |
58 | Obsoletes: cistron-radius | |
59 | Conflicts: logrotate < 3.7-4 | |
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 | %patch4 -p1 | |
81 | ||
82 | sed -e '/m4_include..libtool/d' < aclocal.m4 > acinclude.m4 | |
83 | ||
84 | %build | |
85 | maindir="$(pwd)" | |
86 | for d in rlm_attr_rewrite rlm_checkval rlm_counter rlm_dbm \ | |
87 | rlm_eap/types/rlm_eap_{md5,mschapv2,peap,sim,tls,ttls} \ | |
88 | rlm_eap rlm_example rlm_ippool rlm_krb5 rlm_ldap rlm_otp \ | |
89 | rlm_pam rlm_perl rlm_python rlm_radutmp rlm_smb \ | |
90 | rlm_sql/drivers/rlm_sql_{db2,iodbc,mysql,oracle,postgresql,unixodbc} \ | |
91 | rlm_sql rlm_sqlcounter rlm_sql_log rlm_unix ; do | |
92 | ||
93 | cd src/modules/${d} | |
94 | if [ -f configure.in ]; then | |
95 | %{__aclocal} -I ${maindir} | |
96 | %{__autoconf} | |
97 | fi | |
98 | if [ -f config.h.in ]; then | |
99 | %{__autoheader} | |
100 | fi | |
101 | cd ${maindir} | |
102 | done | |
103 | %{__libtoolize} | |
104 | %{__aclocal} | |
105 | %{__autoconf} | |
106 | %{__autoheader} | |
107 | %configure \ | |
108 | SNMPGET="/usr/bin/snmpget" \ | |
109 | SNMPWALK="/usr/bin/snmpwalk" \ | |
110 | --enable-strict-dependencies \ | |
111 | --with-logdir=%{_var}/log/freeradius \ | |
112 | --with-experimental-modules \ | |
113 | --with-threads \ | |
114 | --with-thread-pool \ | |
115 | --with-gnu-ld \ | |
116 | --with-ltdl-include=%{_includedir}/none \ | |
117 | --with-ltdl-lib=%{_libdir} \ | |
118 | --disable-ltdl-install \ | |
119 | --with-rlm_krb5 | |
120 | %{__make} -j1 \ | |
121 | LIBTOOL="`pwd`/libtool --tag=CC" | |
122 | ||
123 | %install | |
124 | rm -rf $RPM_BUILD_ROOT | |
125 | install -d $RPM_BUILD_ROOT{%{_sysconfdir}/raddb,%{_libdir}/%{name}} \ | |
126 | $RPM_BUILD_ROOT/etc/{logrotate.d,pam.d,rc.d/init.d} \ | |
127 | $RPM_BUILD_ROOT%{_var}/log/{,archive}/freeradius/radacct | |
128 | ||
129 | %{__make} -j1 install \ | |
130 | LIBTOOL="`pwd`/libtool --tag=CC" \ | |
131 | R=$RPM_BUILD_ROOT | |
132 | ||
133 | rm -f $RPM_BUILD_ROOT{%{_mandir}/man8/builddbm.8,%{_sbindir}/rc.radiusd} | |
134 | rm -f $RPM_BUILD_ROOT%{_sysconfdir}/raddb/{clients,*.pl} | |
135 | ||
136 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/%{name} | |
137 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} | |
138 | install %{SOURCE3} $RPM_BUILD_ROOT/etc/pam.d/radius | |
139 | ||
140 | # remove useless static modules and library | |
141 | # rlm*.la are used (lt_dlopen) | |
142 | rm -f $RPM_BUILD_ROOT%{_libdir}/{*.a,*.la} | |
143 | rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/*.a | |
144 | ||
145 | %clean | |
146 | rm -rf $RPM_BUILD_ROOT | |
147 | ||
148 | %pre | |
149 | %groupadd -g 29 -r -f radius | |
150 | %useradd -u 29 -d %{_localstatedir} -s /bin/false -M -r -c "%{name}" -g radius radius | |
151 | ||
152 | # TODO: should be in trigger instead. | |
153 | # upgrade from previous versions of the package, where radius' gid was "nobody" | |
154 | if [ "`id -g radius`" = "99" ]; then | |
155 | usermod -g 29 radius | |
156 | chown radius:radius /var/log/%{name}/*.log >/dev/null 2>&1 || : | |
157 | chown radius:radius /var/log/%{name}/radacct/* >/dev/null 2>&1 || : | |
158 | fi | |
159 | ||
160 | %post | |
161 | /sbin/chkconfig --add %{name} | |
162 | %service %{name} restart "%{name} daemon" | |
163 | ||
164 | %preun | |
165 | if [ "$1" = "0" ]; then | |
166 | %service %{name} stop | |
167 | /sbin/chkconfig --del %{name} | |
168 | fi | |
169 | ||
170 | %postun | |
171 | if [ "$1" = "0" ]; then | |
172 | %userremove radius | |
173 | %groupremove radius | |
174 | fi | |
175 | ||
176 | %files | |
177 | %defattr(644,root,root,755) | |
178 | %doc doc/* | |
179 | %attr(755,root,root) %{_bindir}/* | |
180 | %attr(755,root,root) %{_sbindir}/* | |
181 | %attr(755,root,root) %{_libdir}/*.so | |
182 | %dir %{_libdir}/%{name} | |
183 | %attr(755,root,root) %{_libdir}/%{name}/*.so | |
184 | %{_libdir}/%{name}/*.la | |
185 | %{_datadir}/freeradius | |
186 | ||
187 | %dir %{_sysconfdir}/raddb | |
188 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/raddb/* | |
189 | ||
190 | %attr(771,root,radius) %dir %{_var}/log/%{name} | |
191 | %attr(771,root,radius) %dir %{_var}/log/%{name}/radacct | |
192 | %attr(771,root,radius) %dir %{_var}/log/archive/%{name} | |
193 | %attr(771,root,radius) %dir %{_var}/log/archive/%{name}/radacct | |
194 | %attr(775,root,radius) %dir /var/run/%{name} | |
195 | ||
196 | %attr(754,root,root) /etc/rc.d/init.d/%{name} | |
197 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/* | |
198 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/* | |
199 | ||
200 | %{_mandir}/man?/* |