]>
Commit | Line | Data |
---|---|---|
a35c3a00 | 1 | # |
f1e65093 | 2 | %include /usr/lib/rpm/macros.perl |
6c1c28f9 ER |
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 | |
ab174399 ER |
7 | # TODO |
8 | # - (CVE-2006-1354) http://security.gentoo.org/glsa/glsa-200604-03.xml | |
b8ecaeaa | 9 | # - finish update to 1.1.1 |
4e6a6407 | 10 | Summary: High-performance and highly configurable RADIUS server |
62d00dee | 11 | Summary(pl.UTF-8): Szybki i wysoce konfigurowalny serwer RADIUS |
94afa185 | 12 | Name: freeradius |
b8ecaeaa ER |
13 | Version: 1.1.1 |
14 | Release: 0.1 | |
94afa185 | 15 | License: GPL |
4e6a6407 | 16 | Group: Networking/Daemons |
a96a40cf | 17 | Source0: ftp://ftp.freeradius.org/pub/radius/%{name}-%{version}.tar.gz |
b8ecaeaa | 18 | # Source0-md5: b38b24f6352090fdb571b9e8da52e12e |
f8b238b6 AM |
19 | Source1: %{name}.logrotate |
20 | Source2: %{name}.init | |
21 | Source3: %{name}.pam | |
fd0f773b JR |
22 | Patch0: %{name}-makefile.patch |
23 | Patch1: %{name}-smbencrypt.patch | |
24 | Patch2: %{name}-linking.patch | |
25 | Patch3: %{name}-moduledir.patch | |
26 | Patch4: %{name}-rundir.patch | |
27 | Patch5: %{name}-config.patch | |
28 | Patch6: %{name}-eap_install_order.patch | |
a96a40cf | 29 | URL: http://www.freeradius.org/ |
041912e5 JB |
30 | BuildRequires: autoconf |
31 | BuildRequires: automake | |
32 | BuildRequires: cyrus-sasl-devel | |
33 | BuildRequires: gdbm-devel | |
4e6a6407 | 34 | BuildRequires: libltdl-devel |
041912e5 | 35 | BuildRequires: libtool |
4e6a6407 | 36 | BuildRequires: mysql-devel |
062d3f7c | 37 | BuildRequires: net-snmp-devel |
aaab8964 | 38 | BuildRequires: openldap-devel >= 2.3.0 |
17d2eca0 | 39 | BuildRequires: openssl-devel >= 0.9.7d |
4e6a6407 | 40 | BuildRequires: pam-devel |
f8b238b6 AM |
41 | BuildRequires: perl-devel |
42 | BuildRequires: postgresql-backend-devel | |
43 | BuildRequires: postgresql-devel | |
7c19d94e | 44 | BuildRequires: python |
f8b238b6 | 45 | BuildRequires: python-devel |
f8b238b6 | 46 | BuildRequires: rpm-perlprov |
062d3f7c ER |
47 | BuildRequires: rpmbuild(macros) >= 1.268 |
48 | BuildRequires: unixODBC-devel | |
49 | Requires(post,preun): /sbin/chkconfig | |
50 | Requires(postun): /usr/sbin/groupdel | |
51 | Requires(postun): /usr/sbin/userdel | |
9c9b6568 | 52 | Requires(pre): /bin/id |
062d3f7c | 53 | Requires(pre): /usr/bin/getgid |
9c9b6568 | 54 | Requires(pre): /usr/sbin/groupadd |
9c9b6568 | 55 | Requires(pre): /usr/sbin/useradd |
062d3f7c | 56 | Requires(pre): /usr/sbin/usermod |
24927a7b | 57 | Requires: perl(DynaLoader) = %(%{__perl} -MDynaLoader -e 'print DynaLoader->VERSION') |
dccca3ce | 58 | Requires: rc-scripts |
dccca3ce | 59 | Provides: group(radius) |
062d3f7c | 60 | Provides: user(radius) |
4e6a6407 | 61 | Obsoletes: cistron-radius |
dccca3ce | 62 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
4e6a6407 | 63 | |
4e6a6407 | 64 | %description |
94afa185 MP |
65 | The FreeRADIUS Server Project is an attempt to create a |
66 | high-performance and highly configurable GPL'd RADIUS server. It is | |
67 | generally similar to the Livingston 2.0 RADIUS server, but has a lot | |
68 | more features, and is much more configurable. | |
4e6a6407 | 69 | |
ca834a53 | 70 | %description -l pl.UTF-8 |
94afa185 MP |
71 | Projekt FreeRadius ma na celu stworzenie szybkiego i wysoce |
72 | konfigurowalnego serwera RADIUS na licencji GPL. Ten jest podobny do | |
ca834a53 JR |
73 | Livingston 2.0 RADIUS server ale ma o wiele więcej funkcji i posiada |
74 | większe możliwości konfigurowania. | |
4e6a6407 | 75 | |
4ba06a7d | 76 | %prep |
4e6a6407 | 77 | %setup -q |
fd0f773b | 78 | %patch0 -p1 |
b8ecaeaa ER |
79 | #%patch1 -p1 |
80 | #%patch2 -p1 | |
81 | #%patch3 -p1 | |
82 | #%patch4 -p1 | |
598a5b29 | 83 | %patch5 -p1 |
b8ecaeaa | 84 | #%patch6 -p1 |
598a5b29 JK |
85 | |
86 | awk 'BEGIN { printit=0; } { if (printit) print $0; } /## end libtool.m4/ { printit=1;}' \ | |
87 | < aclocal.m4 > acinclude.m4 | |
88 | ||
041912e5 JB |
89 | %build |
90 | maindir="$(pwd)" | |
91 | for d in rlm_attr_rewrite rlm_checkval rlm_counter rlm_dbm \ | |
598a5b29 | 92 | rlm_eap/types/rlm_eap_{md5,mschapv2,peap,sim,tls,ttls} \ |
31c93271 JR |
93 | rlm_eap rlm_example rlm_ippool rlm_krb5 rlm_ldap rlm_otp \ |
94 | rlm_pam rlm_perl rlm_python rlm_radutmp rlm_smb \ | |
041912e5 | 95 | rlm_sql/drivers/rlm_sql_{db2,iodbc,mysql,oracle,postgresql,unixodbc} \ |
31c93271 | 96 | rlm_sql rlm_sql_log rlm_sqlcounter rlm_unix ; do |
598a5b29 | 97 | |
041912e5 JB |
98 | cd src/modules/${d} |
99 | %{__aclocal} -I ${maindir} | |
100 | %{__autoconf} | |
101 | if [ -f config.h.in ]; then | |
102 | %{__autoheader} | |
103 | fi | |
104 | cd ${maindir} | |
105 | done | |
041912e5 JB |
106 | %{__libtoolize} |
107 | %{__aclocal} | |
108 | %{__autoconf} | |
109 | %{__autoheader} | |
110 | %configure \ | |
15aabf61 JB |
111 | SNMPGET="/usr/bin/snmpget" \ |
112 | SNMPWALK="/usr/bin/snmpwalk" \ | |
f8b238b6 AM |
113 | --enable-strict-dependencies \ |
114 | --with-logdir=%{_var}/log/freeradius \ | |
115 | --with-experimental-modules \ | |
4e6a6407 | 116 | --with-threads \ |
117 | --with-thread-pool \ | |
118 | --with-gnu-ld \ | |
f8b238b6 AM |
119 | --with-ltdl-include=%{_includedir}/none \ |
120 | --with-ltdl-lib=%{_libdir} \ | |
121 | --disable-ltdl-install \ | |
c014f587 | 122 | --without-rlm_krb5 \ |
123 | --without-rlm_dbm | |
598a5b29 JK |
124 | %{__make} \ |
125 | LIBTOOL="`pwd`/libtool --tag=CC" | |
4e6a6407 | 126 | |
4e6a6407 | 127 | %install |
4e6a6407 | 128 | rm -rf $RPM_BUILD_ROOT |
598a5b29 | 129 | install -d $RPM_BUILD_ROOT{%{_sysconfdir}/raddb,%{_libdir}/%{name}} \ |
cbb8711d | 130 | $RPM_BUILD_ROOT/etc/{logrotate.d,pam.d,rc.d/init.d} \ |
bcc7605c | 131 | $RPM_BUILD_ROOT%{_var}/log/{,archiv}/freeradius/radacct |
4e6a6407 | 132 | |
f8b238b6 | 133 | %{__make} install \ |
598a5b29 | 134 | LIBTOOL="`pwd`/libtool --tag=CC" \ |
f8b238b6 | 135 | R=$RPM_BUILD_ROOT |
4e6a6407 | 136 | |
f8b238b6 AM |
137 | rm -f $RPM_BUILD_ROOT{%{_mandir}/man8/builddbm.8,%{_sbindir}/rc.radiusd} |
138 | rm -f $RPM_BUILD_ROOT%{_sysconfdir}/raddb/{clients,*.pl} | |
4e6a6407 | 139 | |
c1bdca4c | 140 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/%{name} |
1abb7669 | 141 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} |
c1bdca4c | 142 | install %{SOURCE3} $RPM_BUILD_ROOT/etc/pam.d/radius |
2512122e | 143 | |
041912e5 JB |
144 | # remove useless static modules and library |
145 | # rlm*.la are used (lt_dlopen) | |
91c21a2d JK |
146 | rm -f $RPM_BUILD_ROOT%{_libdir}/{*.a,*.la} |
147 | rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/*.a | |
041912e5 | 148 | |
a96a40cf JB |
149 | %clean |
150 | rm -rf $RPM_BUILD_ROOT | |
151 | ||
9794d47a | 152 | %pre |
9c9b6568 ER |
153 | %groupadd -g 29 -r -f radius |
154 | %useradd -u 29 -d %{_localstatedir} -s /bin/false -M -r -c "%{name}" -g radius radius | |
155 | ||
156 | # TODO: should be in trigger instead. | |
157 | # upgrade from previous versions of the package, where radius' gid was "nobody" | |
158 | if [ "`id -g radius`" = "99" ]; then | |
159 | usermod -g 29 radius | |
160 | chown radius:radius /var/log/%{name}/*.log >/dev/null 2>&1 || : | |
161 | chown radius:radius /var/log/%{name}/radacct/* >/dev/null 2>&1 || : | |
9794d47a | 162 | fi |
163 | ||
a96a40cf | 164 | %post |
f8b238b6 | 165 | /sbin/chkconfig --add %{name} |
062d3f7c | 166 | %service %{name} restart "%{name} daemon" |
a96a40cf | 167 | |
4e6a6407 | 168 | %preun |
586d47cd | 169 | if [ "$1" = "0" ]; then |
062d3f7c | 170 | %service %{name} stop |
f1e65093 | 171 | /sbin/chkconfig --del %{name} |
f8b238b6 AM |
172 | fi |
173 | ||
9794d47a | 174 | %postun |
175 | if [ "$1" = "0" ]; then | |
598a5b29 JK |
176 | %userremove radius |
177 | %groupremove radius | |
9794d47a | 178 | fi |
179 | ||
4e6a6407 | 180 | %files |
94afa185 | 181 | %defattr(644,root,root,755) |
f8b238b6 | 182 | %doc doc/* |
8b3c8403 | 183 | %doc src/modules/rlm_sql/drivers/*/*.sql |
94afa185 MP |
184 | %attr(755,root,root) %{_bindir}/* |
185 | %attr(755,root,root) %{_sbindir}/* | |
f8b238b6 | 186 | %attr(755,root,root) %{_libdir}/*.so |
598a5b29 | 187 | %dir %{_libdir}/%{name} |
e7f77506 | 188 | %attr(755,root,root) %{_libdir}/%{name}/*.so |
598a5b29 | 189 | %{_libdir}/%{name}/*.la |
041912e5 | 190 | %{_datadir}/freeradius |
f8b238b6 AM |
191 | |
192 | %dir %{_sysconfdir}/raddb | |
e7f77506 | 193 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/raddb/* |
f8b238b6 | 194 | |
83fab564 JK |
195 | %attr(771,root,radius) %dir %{_var}/log/%{name} |
196 | %attr(771,root,radius) %dir %{_var}/log/%{name}/radacct | |
8ee5d18f JR |
197 | %attr(771,root,radius) %dir %{_var}/log/archiv/%{name} |
198 | %attr(771,root,radius) %dir %{_var}/log/archiv/%{name}/radacct | |
83fab564 | 199 | %attr(775,root,radius) %dir /var/run/%{name} |
f8b238b6 | 200 | |
1abb7669 | 201 | %attr(754,root,root) /etc/rc.d/init.d/%{name} |
e7f77506 ER |
202 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/* |
203 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/* | |
f8b238b6 AM |
204 | |
205 | %{_mandir}/man?/* |