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