]> git.pld-linux.org Git - packages/freeradius.git/blob - freeradius.spec
- Release: 1 (no protests -> it is going to Ac)
[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:        1
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:  rpm-pythonprov
46 PreReq:         rc-scripts
47 Requires(post,preun):   /sbin/chkconfig
48 Requires:       libtool
49 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
50 Obsoletes:      cistron-radius
51
52 %description
53 The FreeRADIUS Server Project is an attempt to create a
54 high-performance and highly configurable GPL'd RADIUS server. It is
55 generally similar to the Livingston 2.0 RADIUS server, but has a lot
56 more features, and is much more configurable.
57
58 %description -l pl
59 Projekt FreeRadius ma na celu stworzenie szybkiego i wysoce
60 konfigurowalnego serwera RADIUS na licencji GPL. Ten jest podobny do
61 Livingston 2.0 RADIUS server ale ma o wiele wiêcej ficzersów i jest
62 bardziej podatny na konfiguracjê.
63
64 %prep
65 %setup -q
66 %patch0 -p1
67 %patch1 -p1
68 %patch2 -p1
69 %patch3 -p1
70 %patch4 -p1
71 %patch5 -p1
72 %patch6 -p1
73
74 awk 'BEGIN { printit=0; } { if (printit) print $0; } /## end libtool.m4/ { printit=1;}' \
75         < aclocal.m4 > acinclude.m4
76
77 find . -type d -name CVS | xargs rm -r
78
79 %build
80 maindir="$(pwd)"
81 for d in rlm_attr_rewrite rlm_checkval rlm_counter rlm_dbm \
82         rlm_eap/types/rlm_eap_{md5,mschapv2,peap,sim,tls,ttls} \
83         rlm_eap rlm_example rlm_ippool rlm_krb5 rlm_ldap rlm_pam rlm_perl rlm_python \
84         rlm_radutmp rlm_smb \
85         rlm_sql/drivers/rlm_sql_{db2,iodbc,mysql,oracle,postgresql,unixodbc} \
86         rlm_sql rlm_sqlcounter rlm_unix rlm_x99_token ; do
87
88         cd src/modules/${d}
89         %{__aclocal} -I ${maindir}
90         %{__autoconf}
91         if [ -f config.h.in ]; then
92                 %{__autoheader}
93         fi
94         cd ${maindir}
95 done
96 %{__libtoolize}
97 %{__aclocal}
98 %{__autoconf}
99 %{__autoheader}
100 %configure \
101         SNMPGET="/usr/bin/snmpget" \
102         SNMPWALK="/usr/bin/snmpwalk" \
103         --enable-strict-dependencies \
104         --with-logdir=%{_var}/log/freeradius \
105         --with-experimental-modules \
106         --with-threads \
107         --with-thread-pool \
108         --with-gnu-ld \
109         --with-ltdl-include=%{_includedir}/none \
110         --with-ltdl-lib=%{_libdir} \
111         --disable-ltdl-install \
112         --without-rlm_krb5 \
113         --without-rlm_dbm
114 %{__make} \
115         LIBTOOL="`pwd`/libtool --tag=CC"
116
117 %install
118 rm -rf $RPM_BUILD_ROOT
119 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/raddb,%{_libdir}/%{name}} \
120         $RPM_BUILD_ROOT/etc/{logrotate.d,pam.d,rc.d/init.d} \
121         $RPM_BUILD_ROOT%{_var}/log/radius
122
123 %{__make} install \
124         LIBTOOL="`pwd`/libtool --tag=CC" \
125         R=$RPM_BUILD_ROOT
126
127 rm -f $RPM_BUILD_ROOT{%{_mandir}/man8/builddbm.8,%{_sbindir}/rc.radiusd}
128 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/raddb/{clients,*.pl}
129
130 install %{SOURCE1}      $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
131 install %{SOURCE2}      $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
132 install %{SOURCE3}      $RPM_BUILD_ROOT/etc/pam.d/radius
133
134 # remove useless static modules and library
135 # rlm*.la are used (lt_dlopen)
136 rm -f $RPM_BUILD_ROOT%{_libdir}/{*.a,libradius.la}
137 rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/{*.a,libradius.la}
138
139 %clean
140 rm -rf $RPM_BUILD_ROOT
141
142 %pre
143 if [ -n "`/usr/bin/getgid radius`" ]; then
144         if [ "`getgid radius`" != "29" ]; then
145                 echo "Error: group radius doesn't have gid=29. Correct this before installing radius." 1>&2
146                 exit 1
147         fi
148 else
149         /usr/sbin/groupadd -g 29 -r -f radius
150         if [ -n "`id -u radius 2>/dev/null`" ]; then
151                 # upgrade from previous versions of the package, where radius' gid was "nobody"
152                 if [ "`id -g radius`" = "99" ]; then
153                         usermod -g 29 radius
154                         chown radius:radius /var/log/%{name}/*.log >/dev/null 2>&1 || :
155                         chown radius:radius /var/log/%{name}/radacct/* >/dev/null 2>&1 || :
156                 fi
157         fi
158 fi
159 if [ -n "`id -u radius 2>/dev/null`" ]; then
160         if [ "`id -u radius`" != "29" ]; then
161                 echo "Error: user radius doesn't have uid=29. Correct this before installing radius server." 1>&2
162                 exit 1
163         fi
164 else
165         /usr/sbin/useradd -u 29 -d %{_localstatedir} -s /bin/false -M -r -c "%{name}" -g radius radius 1>&2
166 fi
167
168 %post
169 /sbin/chkconfig --add %{name}
170 if [ -f /var/lock/subsys/%{name} ]; then
171         /etc/rc.d/init.d/%{name} restart 1>&2
172 else
173         echo "Run \"/etc/rc.d/init.d/%{name} start\" to start %{name} daemon."
174 fi
175
176 %preun
177 if [ "$1" = "0" ]; then
178         if [ -f /var/lock/subsys/%{name} ]; then
179                 /etc/rc.d/init.d/%{name} stop 1>&2
180         fi
181         /sbin/chkconfig --del %{name}
182 fi
183
184 %postun
185 if [ "$1" = "0" ]; then
186         %userremove radius
187         %groupremove radius
188 fi
189
190 %files
191 %defattr(644,root,root,755)
192 %doc doc/*
193 %doc src/modules/rlm_sql/drivers/*/*.sql
194 %attr(755,root,root) %{_bindir}/*
195 %attr(755,root,root) %{_sbindir}/*
196 %attr(755,root,root) %{_libdir}/*.so
197 %{_libdir}/*.la
198 %dir %{_libdir}/%{name}
199 %{_libdir}/%{name}/*.so
200 %{_libdir}/%{name}/*.la
201 %{_datadir}/freeradius
202
203 %dir %{_sysconfdir}/raddb
204 %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/raddb/*
205
206 %attr(771,root,radius) %dir %{_var}/log/%{name}
207 %attr(771,root,radius) %dir %{_var}/log/%{name}/radacct
208 %attr(775,root,radius) %dir /var/run/%{name}
209
210 %attr(754,root,root) /etc/rc.d/init.d/%{name}
211 %attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/pam.d/*
212 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/logrotate.d/*
213
214 %{_mandir}/man?/*
This page took 0.078578 seconds and 4 git commands to generate.