]> git.pld-linux.org Git - packages/freeradius.git/blob - freeradius.spec
f328999b5bacd7efc6850f6bf1dcc46c691efff4
[packages/freeradius.git] / freeradius.spec
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):    Szybki i wysoce konfigurowalny serwer RADIUS
9 Name:           freeradius
10 Version:        1.0.2
11 Release:        5
12 License:        GPL
13 Group:          Networking/Daemons
14 Source0:        ftp://ftp.freeradius.org/pub/radius/%{name}-%{version}.tar.gz
15 # Source0-md5:  f5dfce4efbb03bbc47ceae08270a875e
16 Source1:        %{name}.logrotate
17 Source2:        %{name}.init
18 Source3:        %{name}.pam
19 Patch0:         %{name}-autoconf_mysql.patch
20 Patch1:         %{name}-makefile.patch
21 Patch2:         %{name}-smbencrypt.patch
22 Patch3:         %{name}-linking.patch
23 Patch4:         %{name}-moduledir.patch
24 Patch5:         %{name}-rundir.patch
25 Patch6:         %{name}-config.patch
26 Patch7:         %{name}-eap_install_order.patch
27 Patch8:         %{name}-sql_injection.patch
28 URL:            http://www.freeradius.org/
29 BuildRequires:  autoconf
30 BuildRequires:  automake
31 BuildRequires:  cyrus-sasl-devel
32 BuildRequires:  gdbm-devel
33 BuildRequires:  libltdl-devel
34 BuildRequires:  libtool
35 BuildRequires:  mysql-devel
36 BuildRequires:  net-snmp-devel
37 BuildRequires:  openldap-devel >= 2.3.0
38 BuildRequires:  openssl-devel >= 0.9.7d
39 BuildRequires:  pam-devel
40 BuildRequires:  perl-devel
41 BuildRequires:  postgresql-backend-devel
42 BuildRequires:  postgresql-devel
43 BuildRequires:  python
44 BuildRequires:  python-devel
45 BuildRequires:  rpm-perlprov
46 BuildRequires:  rpmbuild(macros) >= 1.202
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
52 Requires(pre):  /bin/id
53 Requires(pre):  /usr/bin/getgid
54 Requires(pre):  /usr/sbin/groupadd
55 Requires(pre):  /usr/sbin/useradd
56 Requires(pre):  /usr/sbin/usermod
57 Requires:       perl(DynaLoader) = %(%{__perl} -MDynaLoader -e 'print DynaLoader->VERSION')
58 Requires:       rc-scripts
59 Provides:       group(radius)
60 Provides:       user(radius)
61 Obsoletes:      cistron-radius
62 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
63
64 %description
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.
69
70 %description -l pl
71 Projekt FreeRadius ma na celu stworzenie szybkiego i wysoce
72 konfigurowalnego serwera RADIUS na licencji GPL. Ten jest podobny do
73 Livingston 2.0 RADIUS server ale ma o wiele wiêcej funkcji i posiada
74 wiêksze mo¿liwo¶ci konfigurowania.
75
76 %prep
77 %setup -q
78 %patch0 -p1
79 %patch1 -p1
80 %patch2 -p1
81 %patch3 -p1
82 %patch4 -p1
83 %patch5 -p1
84 %patch6 -p1
85 %patch7 -p1
86 %patch8 -p1
87
88 awk 'BEGIN { printit=0; } { if (printit) print $0; } /## end libtool.m4/ { printit=1;}' \
89         < aclocal.m4 > acinclude.m4
90
91 %build
92 maindir="$(pwd)"
93 for d in rlm_attr_rewrite rlm_checkval rlm_counter rlm_dbm \
94         rlm_eap/types/rlm_eap_{md5,mschapv2,peap,sim,tls,ttls} \
95         rlm_eap rlm_example rlm_ippool rlm_krb5 rlm_ldap rlm_pam rlm_perl rlm_python \
96         rlm_radutmp rlm_smb \
97         rlm_sql/drivers/rlm_sql_{db2,iodbc,mysql,oracle,postgresql,unixodbc} \
98         rlm_sql rlm_sqlcounter rlm_unix rlm_x99_token ; do
99
100         cd src/modules/${d}
101         %{__aclocal} -I ${maindir}
102         %{__autoconf}
103         if [ -f config.h.in ]; then
104                 %{__autoheader}
105         fi
106         cd ${maindir}
107 done
108 %{__libtoolize}
109 %{__aclocal}
110 %{__autoconf}
111 %{__autoheader}
112 %configure \
113         SNMPGET="/usr/bin/snmpget" \
114         SNMPWALK="/usr/bin/snmpwalk" \
115         --enable-strict-dependencies \
116         --with-logdir=%{_var}/log/freeradius \
117         --with-experimental-modules \
118         --with-threads \
119         --with-thread-pool \
120         --with-gnu-ld \
121         --with-ltdl-include=%{_includedir}/none \
122         --with-ltdl-lib=%{_libdir} \
123         --disable-ltdl-install \
124         --without-rlm_krb5 \
125         --without-rlm_dbm
126 %{__make} \
127         LIBTOOL="`pwd`/libtool --tag=CC"
128
129 %install
130 rm -rf $RPM_BUILD_ROOT
131 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/raddb,%{_libdir}/%{name}} \
132         $RPM_BUILD_ROOT/etc/{logrotate.d,pam.d,rc.d/init.d} \
133         $RPM_BUILD_ROOT%{_var}/log/{,archiv}/freeradius/radacct
134
135 %{__make} install \
136         LIBTOOL="`pwd`/libtool --tag=CC" \
137         R=$RPM_BUILD_ROOT
138
139 rm -f $RPM_BUILD_ROOT{%{_mandir}/man8/builddbm.8,%{_sbindir}/rc.radiusd}
140 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/raddb/{clients,*.pl}
141
142 install %{SOURCE1}      $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
143 install %{SOURCE2}      $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
144 install %{SOURCE3}      $RPM_BUILD_ROOT/etc/pam.d/radius
145
146 # remove useless static modules and library
147 # rlm*.la are used (lt_dlopen)
148 rm -f $RPM_BUILD_ROOT%{_libdir}/{*.a,*.la}
149 rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/*.a
150
151 %clean
152 rm -rf $RPM_BUILD_ROOT
153
154 %pre
155 %groupadd -g 29 -r -f radius
156 %useradd -u 29 -d %{_localstatedir} -s /bin/false -M -r -c "%{name}" -g radius radius
157
158 # TODO: should be in trigger instead.
159 # upgrade from previous versions of the package, where radius' gid was "nobody"
160 if [ "`id -g radius`" = "99" ]; then
161         usermod -g 29 radius
162         chown radius:radius /var/log/%{name}/*.log >/dev/null 2>&1 || :
163         chown radius:radius /var/log/%{name}/radacct/* >/dev/null 2>&1 || :
164 fi
165
166 %post
167 /sbin/chkconfig --add %{name}
168 %service %{name} restart "%{name} daemon"
169
170 %preun
171 if [ "$1" = "0" ]; then
172         %service %{name} stop
173         /sbin/chkconfig --del %{name}
174 fi
175
176 %postun
177 if [ "$1" = "0" ]; then
178         %userremove radius
179         %groupremove radius
180 fi
181
182 %files
183 %defattr(644,root,root,755)
184 %doc doc/*
185 %doc src/modules/rlm_sql/drivers/*/*.sql
186 %attr(755,root,root) %{_bindir}/*
187 %attr(755,root,root) %{_sbindir}/*
188 %attr(755,root,root) %{_libdir}/*.so
189 %dir %{_libdir}/%{name}
190 %attr(755,root,root) %{_libdir}/%{name}/*.so
191 %{_libdir}/%{name}/*.la
192 %{_datadir}/freeradius
193
194 %dir %{_sysconfdir}/raddb
195 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/raddb/*
196
197 %attr(771,root,radius) %dir %{_var}/log/%{name}
198 %attr(771,root,radius) %dir %{_var}/log/%{name}/radacct
199 %attr(771,root,radius) %dir %{_var}/log/archiv/%{name}
200 %attr(771,root,radius) %dir %{_var}/log/archiv/%{name}/radacct
201 %attr(775,root,radius) %dir /var/run/%{name}
202
203 %attr(754,root,root) /etc/rc.d/init.d/%{name}
204 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/*
205 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/*
206
207 %{_mandir}/man?/*
This page took 0.101679 seconds and 3 git commands to generate.