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