]> git.pld-linux.org Git - packages/freeradius.git/blob - freeradius.spec
- rel 4
[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:        4
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 Provides:       user(radius)
30 Provides:       group(radius)
31 BuildRequires:  autoconf
32 BuildRequires:  automake
33 BuildRequires:  cyrus-sasl-devel
34 BuildRequires:  gdbm-devel
35 BuildRequires:  libltdl-devel
36 BuildRequires:  libtool
37 BuildRequires:  mysql-devel
38 BuildRequires:  openldap-devel
39 BuildRequires:  openssl-devel >= 0.9.7d
40 BuildRequires:  pam-devel
41 BuildRequires:  perl-devel
42 BuildRequires:  postgresql-backend-devel
43 BuildRequires:  postgresql-devel
44 BuildRequires:  python
45 BuildRequires:  python-devel
46 BuildRequires:  net-snmp-devel
47 BuildRequires:  unixODBC-devel
48 BuildRequires:  rpm-perlprov
49 BuildRequires:  rpmbuild(macros) >= 1.202
50 PreReq:         rc-scripts
51 Requires(pre):  /usr/bin/getgid
52 Requires(pre):  /bin/id
53 Requires(pre):  /usr/sbin/groupadd
54 Requires(pre):  /usr/sbin/usermod
55 Requires(pre):  /usr/sbin/useradd
56 Requires(postun):       /usr/sbin/userdel
57 Requires(postun):       /usr/sbin/groupdel
58 Requires(post,preun):   /sbin/chkconfig
59 Requires:       perl(DynaLoader) = %(%{__perl} -MDynaLoader -e 'print DynaLoader->VERSION')
60 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
61 Obsoletes:      cistron-radius
62
63 %description
64 The FreeRADIUS Server Project is an attempt to create a
65 high-performance and highly configurable GPL'd RADIUS server. It is
66 generally similar to the Livingston 2.0 RADIUS server, but has a lot
67 more features, and is much more configurable.
68
69 %description -l pl
70 Projekt FreeRadius ma na celu stworzenie szybkiego i wysoce
71 konfigurowalnego serwera RADIUS na licencji GPL. Ten jest podobny do
72 Livingston 2.0 RADIUS server ale ma o wiele wiêcej funkcji i posiada
73 wiêksze mo¿liwo¶ci konfigurowania.
74
75 %prep
76 %setup -q
77 %patch0 -p1
78 %patch1 -p1
79 %patch2 -p1
80 %patch3 -p1
81 %patch4 -p1
82 %patch5 -p1
83 %patch6 -p1
84 %patch7 -p1
85 %patch8 -p1
86
87 awk 'BEGIN { printit=0; } { if (printit) print $0; } /## end libtool.m4/ { printit=1;}' \
88         < aclocal.m4 > acinclude.m4
89
90 %build
91 maindir="$(pwd)"
92 for d in rlm_attr_rewrite rlm_checkval rlm_counter rlm_dbm \
93         rlm_eap/types/rlm_eap_{md5,mschapv2,peap,sim,tls,ttls} \
94         rlm_eap rlm_example rlm_ippool rlm_krb5 rlm_ldap rlm_pam rlm_perl rlm_python \
95         rlm_radutmp rlm_smb \
96         rlm_sql/drivers/rlm_sql_{db2,iodbc,mysql,oracle,postgresql,unixodbc} \
97         rlm_sql rlm_sqlcounter rlm_unix rlm_x99_token ; do
98
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
107 %{__libtoolize}
108 %{__aclocal}
109 %{__autoconf}
110 %{__autoheader}
111 %configure \
112         SNMPGET="/usr/bin/snmpget" \
113         SNMPWALK="/usr/bin/snmpwalk" \
114         --enable-strict-dependencies \
115         --with-logdir=%{_var}/log/freeradius \
116         --with-experimental-modules \
117         --with-threads \
118         --with-thread-pool \
119         --with-gnu-ld \
120         --with-ltdl-include=%{_includedir}/none \
121         --with-ltdl-lib=%{_libdir} \
122         --disable-ltdl-install \
123         --without-rlm_krb5 \
124         --without-rlm_dbm
125 %{__make} \
126         LIBTOOL="`pwd`/libtool --tag=CC"
127
128 %install
129 rm -rf $RPM_BUILD_ROOT
130 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/raddb,%{_libdir}/%{name}} \
131         $RPM_BUILD_ROOT/etc/{logrotate.d,pam.d,rc.d/init.d} \
132         $RPM_BUILD_ROOT%{_var}/log/{,archiv}/freeradius
133
134 %{__make} install \
135         LIBTOOL="`pwd`/libtool --tag=CC" \
136         R=$RPM_BUILD_ROOT
137
138 rm -f $RPM_BUILD_ROOT{%{_mandir}/man8/builddbm.8,%{_sbindir}/rc.radiusd}
139 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/raddb/{clients,*.pl}
140
141 install %{SOURCE1}      $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
142 install %{SOURCE2}      $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
143 install %{SOURCE3}      $RPM_BUILD_ROOT/etc/pam.d/radius
144
145 # remove useless static modules and library
146 # rlm*.la are used (lt_dlopen)
147 rm -f $RPM_BUILD_ROOT%{_libdir}/{*.a,*.la}
148 rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/*.a
149
150 %clean
151 rm -rf $RPM_BUILD_ROOT
152
153 %pre
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 || :
163 fi
164
165 %post
166 /sbin/chkconfig --add %{name}
167 if [ -f /var/lock/subsys/%{name} ]; then
168         /etc/rc.d/init.d/%{name} restart 1>&2
169 else
170         echo "Run \"/etc/rc.d/init.d/%{name} start\" to start %{name} daemon."
171 fi
172
173 %preun
174 if [ "$1" = "0" ]; then
175         if [ -f /var/lock/subsys/%{name} ]; then
176                 /etc/rc.d/init.d/%{name} stop 1>&2
177         fi
178         /sbin/chkconfig --del %{name}
179 fi
180
181 %postun
182 if [ "$1" = "0" ]; then
183         %userremove radius
184         %groupremove radius
185 fi
186
187 %files
188 %defattr(644,root,root,755)
189 %doc doc/*
190 %doc src/modules/rlm_sql/drivers/*/*.sql
191 %attr(755,root,root) %{_bindir}/*
192 %attr(755,root,root) %{_sbindir}/*
193 %attr(755,root,root) %{_libdir}/*.so
194 %dir %{_libdir}/%{name}
195 %attr(755,root,root) %{_libdir}/%{name}/*.so
196 %{_libdir}/%{name}/*.la
197 %{_datadir}/freeradius
198
199 %dir %{_sysconfdir}/raddb
200 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/raddb/*
201
202 %attr(771,root,radius) %dir %{_var}/log/%{name}
203 %attr(771,root,radius) %dir %{_var}/log/%{name}/radacct
204 %attr(771,root,radius) %dir %{_var}/log/archiv/%{name}
205 %attr(771,root,radius) %dir %{_var}/log/archiv/%{name}/radacct
206 %attr(775,root,radius) %dir /var/run/%{name}
207
208 %attr(754,root,root) /etc/rc.d/init.d/%{name}
209 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/*
210 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/*
211
212 %{_mandir}/man?/*
This page took 0.101219 seconds and 3 git commands to generate.