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