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