]> git.pld-linux.org Git - packages/freeradius.git/blob - freeradius.spec
- 1.1.1, NFY, patches need review (too much for me right now)
[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 # TODO
8 # - (CVE-2006-1354) http://security.gentoo.org/glsa/glsa-200604-03.xml
9 # - finish update to 1.1.1
10 Summary:        High-performance and highly configurable RADIUS server
11 Summary(pl):    Szybki i wysoce konfigurowalny serwer RADIUS
12 Name:           freeradius
13 Version:        1.1.1
14 Release:        0.1
15 License:        GPL
16 Group:          Networking/Daemons
17 Source0:        ftp://ftp.freeradius.org/pub/radius/%{name}-%{version}.tar.gz
18 # Source0-md5:  b38b24f6352090fdb571b9e8da52e12e
19 Source1:        %{name}.logrotate
20 Source2:        %{name}.init
21 Source3:        %{name}.pam
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
29 URL:            http://www.freeradius.org/
30 BuildRequires:  autoconf
31 BuildRequires:  automake
32 BuildRequires:  cyrus-sasl-devel
33 BuildRequires:  gdbm-devel
34 BuildRequires:  libltdl-devel
35 BuildRequires:  libtool
36 BuildRequires:  mysql-devel
37 BuildRequires:  net-snmp-devel
38 BuildRequires:  openldap-devel >= 2.3.0
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:  rpm-perlprov
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
86 awk 'BEGIN { printit=0; } { if (printit) print $0; } /## end libtool.m4/ { printit=1;}' \
87         < aclocal.m4 > acinclude.m4
88
89 %build
90 maindir="$(pwd)"
91 for d in rlm_attr_rewrite rlm_checkval rlm_counter rlm_dbm \
92         rlm_eap/types/rlm_eap_{md5,mschapv2,peap,sim,tls,ttls} \
93         rlm_eap rlm_example rlm_ippool rlm_krb5 rlm_ldap rlm_otp \
94         rlm_pam rlm_perl rlm_python rlm_radutmp rlm_smb \
95         rlm_sql/drivers/rlm_sql_{db2,iodbc,mysql,oracle,postgresql,unixodbc} \
96         rlm_sql rlm_sql_log rlm_sqlcounter rlm_unix ; do
97
98         cd src/modules/${d}
99         %{__aclocal} -I ${maindir}
100         %{__autoconf}
101         if [ -f config.h.in ]; then
102                 %{__autoheader}
103         fi
104         cd ${maindir}
105 done
106 %{__libtoolize}
107 %{__aclocal}
108 %{__autoconf}
109 %{__autoheader}
110 %configure \
111         SNMPGET="/usr/bin/snmpget" \
112         SNMPWALK="/usr/bin/snmpwalk" \
113         --enable-strict-dependencies \
114         --with-logdir=%{_var}/log/freeradius \
115         --with-experimental-modules \
116         --with-threads \
117         --with-thread-pool \
118         --with-gnu-ld \
119         --with-ltdl-include=%{_includedir}/none \
120         --with-ltdl-lib=%{_libdir} \
121         --disable-ltdl-install \
122         --without-rlm_krb5 \
123         --without-rlm_dbm
124 %{__make} \
125         LIBTOOL="`pwd`/libtool --tag=CC"
126
127 %install
128 rm -rf $RPM_BUILD_ROOT
129 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/raddb,%{_libdir}/%{name}} \
130         $RPM_BUILD_ROOT/etc/{logrotate.d,pam.d,rc.d/init.d} \
131         $RPM_BUILD_ROOT%{_var}/log/{,archiv}/freeradius/radacct
132
133 %{__make} install \
134         LIBTOOL="`pwd`/libtool --tag=CC" \
135         R=$RPM_BUILD_ROOT
136
137 rm -f $RPM_BUILD_ROOT{%{_mandir}/man8/builddbm.8,%{_sbindir}/rc.radiusd}
138 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/raddb/{clients,*.pl}
139
140 install %{SOURCE1}      $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
141 install %{SOURCE2}      $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
142 install %{SOURCE3}      $RPM_BUILD_ROOT/etc/pam.d/radius
143
144 # remove useless static modules and library
145 # rlm*.la are used (lt_dlopen)
146 rm -f $RPM_BUILD_ROOT%{_libdir}/{*.a,*.la}
147 rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/*.a
148
149 %clean
150 rm -rf $RPM_BUILD_ROOT
151
152 %pre
153 %groupadd -g 29 -r -f radius
154 %useradd -u 29 -d %{_localstatedir} -s /bin/false -M -r -c "%{name}" -g radius radius
155
156 # TODO: should be in trigger instead.
157 # upgrade from previous versions of the package, where radius' gid was "nobody"
158 if [ "`id -g radius`" = "99" ]; then
159         usermod -g 29 radius
160         chown radius:radius /var/log/%{name}/*.log >/dev/null 2>&1 || :
161         chown radius:radius /var/log/%{name}/radacct/* >/dev/null 2>&1 || :
162 fi
163
164 %post
165 /sbin/chkconfig --add %{name}
166 %service %{name} restart "%{name} daemon"
167
168 %preun
169 if [ "$1" = "0" ]; then
170         %service %{name} stop
171         /sbin/chkconfig --del %{name}
172 fi
173
174 %postun
175 if [ "$1" = "0" ]; then
176         %userremove radius
177         %groupremove radius
178 fi
179
180 %files
181 %defattr(644,root,root,755)
182 %doc doc/*
183 %doc src/modules/rlm_sql/drivers/*/*.sql
184 %attr(755,root,root) %{_bindir}/*
185 %attr(755,root,root) %{_sbindir}/*
186 %attr(755,root,root) %{_libdir}/*.so
187 %dir %{_libdir}/%{name}
188 %attr(755,root,root) %{_libdir}/%{name}/*.so
189 %{_libdir}/%{name}/*.la
190 %{_datadir}/freeradius
191
192 %dir %{_sysconfdir}/raddb
193 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/raddb/*
194
195 %attr(771,root,radius) %dir %{_var}/log/%{name}
196 %attr(771,root,radius) %dir %{_var}/log/%{name}/radacct
197 %attr(771,root,radius) %dir %{_var}/log/archiv/%{name}
198 %attr(771,root,radius) %dir %{_var}/log/archiv/%{name}/radacct
199 %attr(775,root,radius) %dir /var/run/%{name}
200
201 %attr(754,root,root) /etc/rc.d/init.d/%{name}
202 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/*
203 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/*
204
205 %{_mandir}/man?/*
This page took 0.127407 seconds and 3 git commands to generate.