]>
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 | |
4e6a6407 | 7 | Summary: High-performance and highly configurable RADIUS server |
62d00dee | 8 | Summary(pl.UTF-8): Szybki i wysoce konfigurowalny serwer RADIUS |
94afa185 | 9 | Name: freeradius |
e0fc8eec | 10 | Version: 1.1.7 |
e218a559 | 11 | Release: 0.2 |
94afa185 | 12 | License: GPL |
4e6a6407 | 13 | Group: Networking/Daemons |
a96a40cf | 14 | Source0: ftp://ftp.freeradius.org/pub/radius/%{name}-%{version}.tar.gz |
e0fc8eec | 15 | # Source0-md5: 5c126cb2122b8e2ba9784b511fbefd96 |
f8b238b6 AM |
16 | Source1: %{name}.logrotate |
17 | Source2: %{name}.init | |
18 | Source3: %{name}.pam | |
fd0f773b | 19 | Patch0: %{name}-makefile.patch |
e218a559 | 20 | Patch1: %{name}-linking.patch |
21 | Patch2: %{name}-moduledir.patch | |
22 | Patch3: %{name}-rundir.patch | |
23 | Patch4: %{name}-config.patch | |
a96a40cf | 24 | URL: http://www.freeradius.org/ |
041912e5 JB |
25 | BuildRequires: autoconf |
26 | BuildRequires: automake | |
27 | BuildRequires: cyrus-sasl-devel | |
28 | BuildRequires: gdbm-devel | |
82b1026c | 29 | BuildRequires: krb5-devel |
e218a559 | 30 | BuildRequires: libcom_err-devel |
4e6a6407 | 31 | BuildRequires: libltdl-devel |
041912e5 | 32 | BuildRequires: libtool |
4e6a6407 | 33 | BuildRequires: mysql-devel |
062d3f7c | 34 | BuildRequires: net-snmp-devel |
14b8fb3b | 35 | BuildRequires: openldap-devel >= 2.4.6 |
17d2eca0 | 36 | BuildRequires: openssl-devel >= 0.9.7d |
4e6a6407 | 37 | BuildRequires: pam-devel |
f8b238b6 AM |
38 | BuildRequires: perl-devel |
39 | BuildRequires: postgresql-backend-devel | |
40 | BuildRequires: postgresql-devel | |
7c19d94e | 41 | BuildRequires: python |
f8b238b6 | 42 | BuildRequires: python-devel |
f8b238b6 | 43 | BuildRequires: rpm-perlprov |
062d3f7c ER |
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 | |
9c9b6568 | 49 | Requires(pre): /bin/id |
062d3f7c | 50 | Requires(pre): /usr/bin/getgid |
9c9b6568 | 51 | Requires(pre): /usr/sbin/groupadd |
9c9b6568 | 52 | Requires(pre): /usr/sbin/useradd |
062d3f7c | 53 | Requires(pre): /usr/sbin/usermod |
24927a7b | 54 | Requires: perl(DynaLoader) = %(%{__perl} -MDynaLoader -e 'print DynaLoader->VERSION') |
dccca3ce | 55 | Requires: rc-scripts |
dccca3ce | 56 | Provides: group(radius) |
062d3f7c | 57 | Provides: user(radius) |
4e6a6407 | 58 | Obsoletes: cistron-radius |
6d188efb | 59 | Conflicts: logrotate < 3.7-4 |
dccca3ce | 60 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
4e6a6407 | 61 | |
4e6a6407 | 62 | %description |
94afa185 MP |
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. | |
4e6a6407 | 67 | |
ca834a53 | 68 | %description -l pl.UTF-8 |
94afa185 MP |
69 | Projekt FreeRadius ma na celu stworzenie szybkiego i wysoce |
70 | konfigurowalnego serwera RADIUS na licencji GPL. Ten jest podobny do | |
ca834a53 JR |
71 | Livingston 2.0 RADIUS server ale ma o wiele więcej funkcji i posiada |
72 | większe możliwości konfigurowania. | |
4e6a6407 | 73 | |
4ba06a7d | 74 | %prep |
4e6a6407 | 75 | %setup -q |
fd0f773b | 76 | %patch0 -p1 |
e218a559 | 77 | %patch1 -p1 |
42226f79 | 78 | %patch2 -p1 |
e218a559 | 79 | %patch3 -p1 |
80 | %patch4 -p1 | |
598a5b29 | 81 | |
7eb28883 | 82 | sed -e '/m4_include..libtool/d' < aclocal.m4 > acinclude.m4 |
598a5b29 | 83 | |
041912e5 JB |
84 | %build |
85 | maindir="$(pwd)" | |
86 | for d in rlm_attr_rewrite rlm_checkval rlm_counter rlm_dbm \ | |
598a5b29 | 87 | rlm_eap/types/rlm_eap_{md5,mschapv2,peap,sim,tls,ttls} \ |
31c93271 JR |
88 | rlm_eap rlm_example rlm_ippool rlm_krb5 rlm_ldap rlm_otp \ |
89 | rlm_pam rlm_perl rlm_python rlm_radutmp rlm_smb \ | |
041912e5 | 90 | rlm_sql/drivers/rlm_sql_{db2,iodbc,mysql,oracle,postgresql,unixodbc} \ |
e218a559 | 91 | rlm_sql rlm_sqlcounter rlm_sql_log rlm_unix ; do |
598a5b29 | 92 | |
041912e5 | 93 | cd src/modules/${d} |
e218a559 | 94 | if [ -f configure.in ]; then |
95 | %{__aclocal} -I ${maindir} | |
96 | %{__autoconf} | |
97 | fi | |
041912e5 JB |
98 | if [ -f config.h.in ]; then |
99 | %{__autoheader} | |
100 | fi | |
101 | cd ${maindir} | |
102 | done | |
041912e5 JB |
103 | %{__libtoolize} |
104 | %{__aclocal} | |
105 | %{__autoconf} | |
106 | %{__autoheader} | |
107 | %configure \ | |
15aabf61 JB |
108 | SNMPGET="/usr/bin/snmpget" \ |
109 | SNMPWALK="/usr/bin/snmpwalk" \ | |
f8b238b6 AM |
110 | --enable-strict-dependencies \ |
111 | --with-logdir=%{_var}/log/freeradius \ | |
112 | --with-experimental-modules \ | |
4e6a6407 | 113 | --with-threads \ |
114 | --with-thread-pool \ | |
115 | --with-gnu-ld \ | |
f8b238b6 AM |
116 | --with-ltdl-include=%{_includedir}/none \ |
117 | --with-ltdl-lib=%{_libdir} \ | |
118 | --disable-ltdl-install \ | |
e218a559 | 119 | --with-rlm_krb5 |
42226f79 | 120 | %{__make} -j1 \ |
598a5b29 | 121 | LIBTOOL="`pwd`/libtool --tag=CC" |
4e6a6407 | 122 | |
4e6a6407 | 123 | %install |
4e6a6407 | 124 | rm -rf $RPM_BUILD_ROOT |
598a5b29 | 125 | install -d $RPM_BUILD_ROOT{%{_sysconfdir}/raddb,%{_libdir}/%{name}} \ |
cbb8711d | 126 | $RPM_BUILD_ROOT/etc/{logrotate.d,pam.d,rc.d/init.d} \ |
1a569c7d | 127 | $RPM_BUILD_ROOT%{_var}/log/{,archive}/freeradius/radacct |
4e6a6407 | 128 | |
42226f79 | 129 | %{__make} -j1 install \ |
598a5b29 | 130 | LIBTOOL="`pwd`/libtool --tag=CC" \ |
f8b238b6 | 131 | R=$RPM_BUILD_ROOT |
4e6a6407 | 132 | |
f8b238b6 AM |
133 | rm -f $RPM_BUILD_ROOT{%{_mandir}/man8/builddbm.8,%{_sbindir}/rc.radiusd} |
134 | rm -f $RPM_BUILD_ROOT%{_sysconfdir}/raddb/{clients,*.pl} | |
4e6a6407 | 135 | |
c1bdca4c | 136 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/%{name} |
1abb7669 | 137 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} |
c1bdca4c | 138 | install %{SOURCE3} $RPM_BUILD_ROOT/etc/pam.d/radius |
2512122e | 139 | |
041912e5 JB |
140 | # remove useless static modules and library |
141 | # rlm*.la are used (lt_dlopen) | |
91c21a2d JK |
142 | rm -f $RPM_BUILD_ROOT%{_libdir}/{*.a,*.la} |
143 | rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/*.a | |
041912e5 | 144 | |
a96a40cf JB |
145 | %clean |
146 | rm -rf $RPM_BUILD_ROOT | |
147 | ||
9794d47a | 148 | %pre |
9c9b6568 ER |
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 || : | |
9794d47a | 158 | fi |
159 | ||
a96a40cf | 160 | %post |
f8b238b6 | 161 | /sbin/chkconfig --add %{name} |
062d3f7c | 162 | %service %{name} restart "%{name} daemon" |
a96a40cf | 163 | |
4e6a6407 | 164 | %preun |
586d47cd | 165 | if [ "$1" = "0" ]; then |
062d3f7c | 166 | %service %{name} stop |
f1e65093 | 167 | /sbin/chkconfig --del %{name} |
f8b238b6 AM |
168 | fi |
169 | ||
9794d47a | 170 | %postun |
171 | if [ "$1" = "0" ]; then | |
598a5b29 JK |
172 | %userremove radius |
173 | %groupremove radius | |
9794d47a | 174 | fi |
175 | ||
4e6a6407 | 176 | %files |
94afa185 | 177 | %defattr(644,root,root,755) |
f8b238b6 | 178 | %doc doc/* |
94afa185 MP |
179 | %attr(755,root,root) %{_bindir}/* |
180 | %attr(755,root,root) %{_sbindir}/* | |
f8b238b6 | 181 | %attr(755,root,root) %{_libdir}/*.so |
598a5b29 | 182 | %dir %{_libdir}/%{name} |
e218a559 | 183 | %attr(755,root,root) %{_libdir}/%{name}/*.so |
184 | %{_libdir}/%{name}/*.la | |
041912e5 | 185 | %{_datadir}/freeradius |
f8b238b6 AM |
186 | |
187 | %dir %{_sysconfdir}/raddb | |
e7f77506 | 188 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/raddb/* |
f8b238b6 | 189 | |
83fab564 JK |
190 | %attr(771,root,radius) %dir %{_var}/log/%{name} |
191 | %attr(771,root,radius) %dir %{_var}/log/%{name}/radacct | |
a9e309e5 JR |
192 | %attr(771,root,radius) %dir %{_var}/log/archive/%{name} |
193 | %attr(771,root,radius) %dir %{_var}/log/archive/%{name}/radacct | |
e218a559 | 194 | %attr(775,root,radius) %dir /var/run/%{name} |
f8b238b6 | 195 | |
1abb7669 | 196 | %attr(754,root,root) /etc/rc.d/init.d/%{name} |
e7f77506 ER |
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/* | |
f8b238b6 AM |
199 | |
200 | %{_mandir}/man?/* |