]> git.pld-linux.org Git - packages/freeradius.git/blobdiff - freeradius.spec
- 1.1.1, NFY, patches need review (too much for me right now)
[packages/freeradius.git] / freeradius.spec
index 9abe461e1711716c758495a2d5ced4b10a4d7c44..f0bf6ab8b13756c7e067482a1629edcf05be1ba0 100644 (file)
-# FIXME: find a way of getting rid of "-" on versions ... rpm will be happy
+#
+%include       /usr/lib/rpm/macros.perl
+# FIXME:
+# - won't be good to include these contrib examples?
+#   Source1:   http://www.ping.de/~fdc/radius/radacct-replay
+#   Source3:   ftp://ftp.freeradius.org/pub/radius/contrib/radwho.cgi
+# TODO
+# - (CVE-2006-1354) http://security.gentoo.org/glsa/glsa-200604-03.xml
+# - finish update to 1.1.1
 Summary:       High-performance and highly configurable RADIUS server
-Summary(pl):   Szybki i wysoce konfigurowalny serwer RADIUS.
-Name:          freeradius
-Version:       0.1
-Release:       0
-URL:           http://www.freeradius.org/
-Copyright:     GPL
+Summary(pl):   Szybki i wysoce konfigurowalny serwer RADIUS
+Name:          freeradius
+Version:       1.1.1
+Release:       0.1
+License:       GPL
 Group:         Networking/Daemons
-Group(pl):     Sieciowe/Demony
-Prereq:                /sbin/chkconfig
-# FIXME: snmpwalk, snmpget and rusers POSSIBLY needed by checkrad
-Requires:      libtool
+Source0:       ftp://ftp.freeradius.org/pub/radius/%{name}-%{version}.tar.gz
+# Source0-md5: b38b24f6352090fdb571b9e8da52e12e
+Source1:       %{name}.logrotate
+Source2:       %{name}.init
+Source3:       %{name}.pam
+Patch0:                %{name}-makefile.patch
+Patch1:                %{name}-smbencrypt.patch
+Patch2:                %{name}-linking.patch
+Patch3:                %{name}-moduledir.patch
+Patch4:                %{name}-rundir.patch
+Patch5:                %{name}-config.patch
+Patch6:                %{name}-eap_install_order.patch
+URL:           http://www.freeradius.org/
+BuildRequires: autoconf
+BuildRequires: automake
+BuildRequires: cyrus-sasl-devel
+BuildRequires: gdbm-devel
 BuildRequires: libltdl-devel
-BuildRequires: openldap-devel
-#someone's help needed:split&test into %{name}-{mysql,pgsql,common,devel,static,ldap,pam?} hunter.
+BuildRequires: libtool
 BuildRequires: mysql-devel
-BuildRequires: postgresql-devel
+BuildRequires: net-snmp-devel
+BuildRequires: openldap-devel >= 2.3.0
+BuildRequires: openssl-devel >= 0.9.7d
 BuildRequires: pam-devel
+BuildRequires: perl-devel
+BuildRequires: postgresql-backend-devel
+BuildRequires: postgresql-devel
+BuildRequires: python
+BuildRequires: python-devel
+BuildRequires: rpm-perlprov
+BuildRequires: rpmbuild(macros) >= 1.268
+BuildRequires: unixODBC-devel
+Requires(post,preun):  /sbin/chkconfig
+Requires(postun):      /usr/sbin/groupdel
+Requires(postun):      /usr/sbin/userdel
+Requires(pre): /bin/id
+Requires(pre): /usr/bin/getgid
+Requires(pre): /usr/sbin/groupadd
+Requires(pre): /usr/sbin/useradd
+Requires(pre): /usr/sbin/usermod
+Requires:      perl(DynaLoader) = %(%{__perl} -MDynaLoader -e 'print DynaLoader->VERSION')
+Requires:      rc-scripts
+Provides:      group(radius)
+Provides:      user(radius)
 Obsoletes:     cistron-radius
-Source0:       ftp://ftp.freeradius.org/pub/radius/freeradius-0.1.tar.gz
-
-%define         _localstatedir  /var/radius
-%define                _make           make
-
-
-# FIXME: won't be good to include these contrib examples?
-# Source1:     http://www.ping.de/~fdc/radius/radacct-replay
-# Source2:     http://www.ping.de/~fdc/radius/radlast-0.03
-# Source3:     ftp://ftp.freeradius.org/pub/radius/contrib/radwho.cgi
-
-BuildRoot: /tmp/%{name}-%{version}-root
+BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
-The FreeRADIUS Server Project is an attempt to create a high-performance 
-and highly configurable GPL'd RADIUS server. It is generally similar to 
-the Livingston 2.0 RADIUS server, but has a lot more features, and is 
-much more configurable.
-
-%description(pl)
-Projekt FreeRadius ma na celu stworzenie szybkiego i wysoce konfigurowalnego 
-serwera RADIUS na licencji GPL. Ten jest podobny do Livingston 2.0 RADIUS server
-ale ma o wiele wiêcej ficzersów i jest bardziej podatny na konfiguracjê.
-
-%prep 
+The FreeRADIUS Server Project is an attempt to create a
+high-performance and highly configurable GPL'd RADIUS server. It is
+generally similar to the Livingston 2.0 RADIUS server, but has a lot
+more features, and is much more configurable.
+
+%description -l pl
+Projekt FreeRadius ma na celu stworzenie szybkiego i wysoce
+konfigurowalnego serwera RADIUS na licencji GPL. Ten jest podobny do
+Livingston 2.0 RADIUS server ale ma o wiele wiêcej funkcji i posiada
+wiêksze mo¿liwo¶ci konfigurowania.
+
+%prep
 %setup -q
+%patch0 -p1
+#%patch1 -p1
+#%patch2 -p1
+#%patch3 -p1
+#%patch4 -p1
+%patch5 -p1
+#%patch6 -p1
 
-# FIXME: some folks prefer -dist files ... rename them or not?
-#cd raddb
-#chmod 640 clients naspasswd radiusd.conf.in
-#cd ..
+awk 'BEGIN { printit=0; } { if (printit) print $0; } /## end libtool.m4/ { printit=1;}' \
+       < aclocal.m4 > acinclude.m4
 
 %build
-CFLAGS="$RPM_OPT_FLAGS" 
-#libtoolize --copy --force
-#aclocal
-#autoconf
-#automake -a -c
-
-%configure --prefix=/usr --localstatedir=%{_localstatedir} --sysconfdir=/etc \
-       --mandir=/usr/man \
+maindir="$(pwd)"
+for d in rlm_attr_rewrite rlm_checkval rlm_counter rlm_dbm \
+       rlm_eap/types/rlm_eap_{md5,mschapv2,peap,sim,tls,ttls} \
+       rlm_eap rlm_example rlm_ippool rlm_krb5 rlm_ldap rlm_otp \
+       rlm_pam rlm_perl rlm_python rlm_radutmp rlm_smb \
+       rlm_sql/drivers/rlm_sql_{db2,iodbc,mysql,oracle,postgresql,unixodbc} \
+       rlm_sql rlm_sql_log rlm_sqlcounter rlm_unix ; do
+
+       cd src/modules/${d}
+       %{__aclocal} -I ${maindir}
+       %{__autoconf}
+       if [ -f config.h.in ]; then
+               %{__autoheader}
+       fi
+       cd ${maindir}
+done
+%{__libtoolize}
+%{__aclocal}
+%{__autoconf}
+%{__autoheader}
+%configure \
+       SNMPGET="/usr/bin/snmpget" \
+       SNMPWALK="/usr/bin/snmpwalk" \
+       --enable-strict-dependencies \
+       --with-logdir=%{_var}/log/freeradius \
+       --with-experimental-modules \
        --with-threads \
        --with-thread-pool \
        --with-gnu-ld \
-       --disable-ltdl-install
-%{_make}
-
-libtool --finish /usr/lib
+       --with-ltdl-include=%{_includedir}/none \
+       --with-ltdl-lib=%{_libdir} \
+       --disable-ltdl-install \
+       --without-rlm_krb5 \
+       --without-rlm_dbm
+%{__make} \
+       LIBTOOL="`pwd`/libtool --tag=CC"
 
 %install
-# prepare $RPM_BUILD_ROOT
 rm -rf $RPM_BUILD_ROOT
-mkdir -p $RPM_BUILD_ROOT/etc/{logrotate.d,pam.d,rc.d/init.d}
-
-# install files
-make install R=$RPM_BUILD_ROOT
-# done here & put noreplace in %files to avoid messing up existing installations
-for i in radutmp radwtmp  radius.log radwatch.log checkrad.log
-do
-  touch  $RPM_BUILD_ROOT%{_localstatedir}/log/$i
-  echo  $RPM_BUILD_ROOT%{_localstatedir}/log/$i
-  #who the hell should own logfiles/ and what sgid should have radiusd ?
-  # do we need /etc/shadow do be +r for wheel ? or better use PAM ?
-  # Hunter
-done
+install -d $RPM_BUILD_ROOT{%{_sysconfdir}/raddb,%{_libdir}/%{name}} \
+       $RPM_BUILD_ROOT/etc/{logrotate.d,pam.d,rc.d/init.d} \
+       $RPM_BUILD_ROOT%{_var}/log/{,archiv}/freeradius/radacct
+
+%{__make} install \
+       LIBTOOL="`pwd`/libtool --tag=CC" \
+       R=$RPM_BUILD_ROOT
+
+rm -f $RPM_BUILD_ROOT{%{_mandir}/man8/builddbm.8,%{_sbindir}/rc.radiusd}
+rm -f $RPM_BUILD_ROOT%{_sysconfdir}/raddb/{clients,*.pl}
+
+install %{SOURCE1}     $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
+install %{SOURCE2}     $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
+install %{SOURCE3}     $RPM_BUILD_ROOT/etc/pam.d/radius
+
+# remove useless static modules and library
+# rlm*.la are used (lt_dlopen)
+rm -f $RPM_BUILD_ROOT%{_libdir}/{*.a,*.la}
+rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/*.a
+
+%clean
+rm -rf $RPM_BUILD_ROOT
 
+%pre
+%groupadd -g 29 -r -f radius
+%useradd -u 29 -d %{_localstatedir} -s /bin/false -M -r -c "%{name}" -g radius radius
 
-# remove unneeded stuff
-rm -f $RPM_BUILD_ROOT/usr/{man/man8/builddbm.8,sbin/rc.radiusd}
+# TODO: should be in trigger instead.
+# upgrade from previous versions of the package, where radius' gid was "nobody"
+if [ "`id -g radius`" = "99" ]; then
+       usermod -g 29 radius
+       chown radius:radius /var/log/%{name}/*.log >/dev/null 2>&1 || :
+       chown radius:radius /var/log/%{name}/radacct/* >/dev/null 2>&1 || :
+fi
 
-cd redhat
-install -m 555 rc.radiusd-redhat $RPM_BUILD_ROOT/etc/rc.d/init.d/radiusd
-install -m 644 radiusd-logrotate $RPM_BUILD_ROOT/etc/logrotate.d/radiusd
-install -m 644 radiusd-pam       $RPM_BUILD_ROOT/etc/pam.d/radius
-cd ..
+%post
+/sbin/chkconfig --add %{name}
+%service %{name} restart "%{name} daemon"
 
 %preun
 if [ "$1" = "0" ]; then
-       /sbin/chkconfig --del radiusd.init
+       %service %{name} stop
+       /sbin/chkconfig --del %{name}
 fi
 
-%postin
+%postun
 if [ "$1" = "0" ]; then
-       /sbin/chkconfig --add radiusd.init
+       %userremove radius
+       %groupremove radius
 fi
 
-%clean
-rm -rf $RPM_BUILD_ROOT
-
 %files
-%defattr(-,root,root)
-%doc doc/ChangeLog doc/README* todo/ COPYRIGHT INSTALL
-%config /etc/pam.d/radius
-%config /etc/logrotate.d/radiusd
-%config /etc/rc.d/init.d/radiusd
-%config /etc/raddb/*
-/usr/man/*
-/usr/bin/*
-/usr/sbin/*
-/usr/lib/*
-%dir %{_localstatedir}/log/radacct/
-%config(missingok noreplace) %{_localstatedir}/log/checkrad.log
-%config(missingok noreplace) %{_localstatedir}/log/radwatch.log
-%config(missingok noreplace) %{_localstatedir}/log/radius.log
-%config(missingok noreplace) %{_localstatedir}/log/radwtmp
-%config(missingok noreplace) %{_localstatedir}/log/radutmp
-
-%changelog
-* Fri Sep 22 2000 Bruno Lopes F. Cabral <bruno@openline.com.br>
-- spec file clear accordling to the libltdl fix and minor updates
-
-* Wed Sep 12 2000 Bruno Lopes F. Cabral <bruno@openline.com.br>
-- Updated to snapshot-12-Sep-00
-
-* Fri Jun 16 2000 Bruno Lopes F. Cabral <bruno@openline.com.br>
-- Initial release
+%defattr(644,root,root,755)
+%doc doc/*
+%doc src/modules/rlm_sql/drivers/*/*.sql
+%attr(755,root,root) %{_bindir}/*
+%attr(755,root,root) %{_sbindir}/*
+%attr(755,root,root) %{_libdir}/*.so
+%dir %{_libdir}/%{name}
+%attr(755,root,root) %{_libdir}/%{name}/*.so
+%{_libdir}/%{name}/*.la
+%{_datadir}/freeradius
+
+%dir %{_sysconfdir}/raddb
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/raddb/*
+
+%attr(771,root,radius) %dir %{_var}/log/%{name}
+%attr(771,root,radius) %dir %{_var}/log/%{name}/radacct
+%attr(771,root,radius) %dir %{_var}/log/archiv/%{name}
+%attr(771,root,radius) %dir %{_var}/log/archiv/%{name}/radacct
+%attr(775,root,radius) %dir /var/run/%{name}
+
+%attr(754,root,root) /etc/rc.d/init.d/%{name}
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/*
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/*
+
+%{_mandir}/man?/*
This page took 0.083253 seconds and 4 git commands to generate.