]> git.pld-linux.org Git - packages/freeradius.git/blob - freeradius.spec
- adapterized
[packages/freeradius.git] / freeradius.spec
1 #
2 %include        /usr/lib/rpm/macros.perl
3 # FIXME: won't be good to include these contrib examples?
4 # Source1:      http://www.ping.de/~fdc/radius/radacct-replay
5 # Source3:      ftp://ftp.freeradius.org/pub/radius/contrib/radwho.cgi
6 Summary:        High-performance and highly configurable RADIUS server
7 Summary(pl):    Szybki i wysoce konfigurowalny serwer RADIUS
8 Name:           freeradius
9 Version:        1.0.1
10 Release:        4
11 License:        GPL
12 Group:          Networking/Daemons
13 Source0:        ftp://ftp.freeradius.org/pub/radius/%{name}-%{version}.tar.gz
14 # Source0-md5:  abc30cb71367f859ceed4de6477cd59f
15 Source1:        %{name}.logrotate
16 Source2:        %{name}.init
17 Source3:        %{name}.pam
18 Patch0:         %{name}-autoconf_mysql.patch
19 Patch1:         %{name}-makefile.patch
20 Patch2:         %{name}-smbencrypt.patch
21 Patch3:         %{name}-linking.patch
22 Patch4:         %{name}-moduledir.patch
23 Patch5:         %{name}-rundir.patch
24 Patch6:         %{name}-config.patch
25 URL:            http://www.freeradius.org/
26 Provides:       user(radius)
27 Provides:       group(radius)
28 BuildRequires:  autoconf
29 BuildRequires:  automake
30 BuildRequires:  cyrus-sasl-devel
31 BuildRequires:  gdbm-devel
32 BuildRequires:  libltdl-devel
33 BuildRequires:  libtool
34 BuildRequires:  mysql-devel
35 BuildRequires:  openldap-devel
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-devel
42 BuildRequires:  net-snmp-devel
43 BuildRequires:  unixODBC-devel
44 BuildRequires:  rpm-perlprov
45 BuildRequires:  rpmbuild(macros) >= 1.202
46 PreReq:         rc-scripts
47 Requires(pre):  /usr/bin/getgid
48 Requires(pre):  /bin/id
49 Requires(pre):  /usr/sbin/groupadd
50 Requires(pre):  /usr/sbin/usermod
51 Requires(pre):  /usr/sbin/useradd
52 Requires(postun):       /usr/sbin/userdel
53 Requires(postun):       /usr/sbin/groupdel
54 Requires(post,preun):   /sbin/chkconfig
55 Requires:       libtool
56 Requires:       perl(DynaLoader) = %(%{__perl} -MDynaLoader -e 'print DynaLoader->VERSION')
57 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
58 Obsoletes:      cistron-radius
59
60 %description
61 The FreeRADIUS Server Project is an attempt to create a
62 high-performance and highly configurable GPL'd RADIUS server. It is
63 generally similar to the Livingston 2.0 RADIUS server, but has a lot
64 more features, and is much more configurable.
65
66 %description -l pl
67 Projekt FreeRadius ma na celu stworzenie szybkiego i wysoce
68 konfigurowalnego serwera RADIUS na licencji GPL. Ten jest podobny do
69 Livingston 2.0 RADIUS server ale ma o wiele wiêcej funkcji i posiada
70 wiêksze mo¿liwo¶ci konfigurowania.
71
72 %prep
73 %setup -q
74 %patch0 -p1
75 %patch1 -p1
76 %patch2 -p1
77 %patch3 -p1
78 %patch4 -p1
79 %patch5 -p1
80 %patch6 -p1
81
82 awk 'BEGIN { printit=0; } { if (printit) print $0; } /## end libtool.m4/ { printit=1;}' \
83         < aclocal.m4 > acinclude.m4
84
85 find . -type d -name CVS | xargs rm -r
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_pam rlm_perl rlm_python \
92         rlm_radutmp rlm_smb \
93         rlm_sql/drivers/rlm_sql_{db2,iodbc,mysql,oracle,postgresql,unixodbc} \
94         rlm_sql rlm_sqlcounter rlm_unix rlm_x99_token ; 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/radius
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,libradius.la}
145 rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/{*.a,libradius.la}
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 if [ -f /var/lock/subsys/%{name} ]; then
165         /etc/rc.d/init.d/%{name} restart 1>&2
166 else
167         echo "Run \"/etc/rc.d/init.d/%{name} start\" to start %{name} daemon."
168 fi
169
170 %preun
171 if [ "$1" = "0" ]; then
172         if [ -f /var/lock/subsys/%{name} ]; then
173                 /etc/rc.d/init.d/%{name} stop 1>&2
174         fi
175         /sbin/chkconfig --del %{name}
176 fi
177
178 %postun
179 if [ "$1" = "0" ]; then
180         %userremove radius
181         %groupremove radius
182 fi
183
184 %files
185 %defattr(644,root,root,755)
186 %doc doc/*
187 %doc src/modules/rlm_sql/drivers/*/*.sql
188 %attr(755,root,root) %{_bindir}/*
189 %attr(755,root,root) %{_sbindir}/*
190 %attr(755,root,root) %{_libdir}/*.so
191 %{_libdir}/*.la
192 %dir %{_libdir}/%{name}
193 %attr(755,root,root) %{_libdir}/%{name}/*.so
194 %{_libdir}/%{name}/*.la
195 %{_datadir}/freeradius
196
197 %dir %{_sysconfdir}/raddb
198 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/raddb/*
199
200 %attr(771,root,radius) %dir %{_var}/log/%{name}
201 %attr(771,root,radius) %dir %{_var}/log/%{name}/radacct
202 %attr(775,root,radius) %dir /var/run/%{name}
203
204 %attr(754,root,root) /etc/rc.d/init.d/%{name}
205 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/*
206 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/*
207
208 %{_mandir}/man?/*
This page took 0.077498 seconds and 3 git commands to generate.