freeradius-server/freeradius-server.spec

465 lines
16 KiB
RPMSpec

%define radiusd_uid 65024
%define radiusd_gid 65024
%define libname libfreeradius
Name: freeradius-server
Version: 3.0.21
Release: 2mamba
Summary: A high performance and highly configurable GPL'd free RADIUS server
Group: System/Servers
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: http://www.freeradius.org
Source0: ftp://ftp.freeradius.org/pub/radius/freeradius-server-%{version}.tar.gz
Source1: freeradius-RADIUS-LDAPv3.schema
Source2: freeradius-initscript
Source3: freeradius-pam
Patch0: freeradius-1.0.5-configure_libgdbm.patch
Patch1: freeradius-1.0.0-samba3.patch
Patch2: freeradius-2.1.3-qafixes.patch
License: GPL
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
BuildRequires: libe2fs-devel
BuildRequires: libgdbm-devel
BuildRequires: libgssapi-devel
BuildRequires: libkrb5-devel
BuildRequires: libltdl-devel
BuildRequires: libmysql5-devel
BuildRequires: libodbc-devel
BuildRequires: libopenldap-devel
BuildRequires: libopenssl-devel
BuildRequires: libpcap-devel
BuildRequires: libpostgresql-devel
BuildRequires: libsasl-devel
BuildRequires: libsqlite-devel
BuildRequires: libstdc++6-devel
BuildRequires: libz-devel
BuildRequires: pam-devel
BuildRequires: perl-DBI
BuildRequires: perl-devel
## AUTOBUILDREQ-END
BuildRequires: libhiredis-devel >= 1.0.0-1mamba
BuildRequires: libopenldap-devel >= 2.2.20
Provides: freeradius
Obsoletes: freeradius
Requires: %{libname} = %{version}
Requires: openldap-servers >= 2.1.22
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description
The FreeRADIUS Server Project is a high performance and highly configurable GPL'd free RADIUS server.
The server is similar in some respects to Livingston's 2.0 server.
While FreeRADIUS started as a variant of the Cistron RADIUS server, they don't share a lot in common any more.
It now has many more features than Cistron or Livingston, and is much more configurable.
%package -n %{libname}
Summary: Libraries for %{name}
Group: System/Libraries
%description -n %{libname}
The FreeRADIUS Server Project is a high performance and highly configurable GPL'd free RADIUS server.
This package contrains the dynamic libraries needed by FreeRADIUS.
%package -n %{libname}-devel
Summary: Static libraries and headers for %{name}
Group: Development/Libraries
Requires: %{name} = %{version}
Requires: %{libname} = %{version}
%description -n %{libname}-devel
Development headers and libraries for %{name}
%package -n %{libname}-krb5
Summary: The Kerberos module for %{name}
Group: System/Servers
Requires: libkrb5
Requires: %{name} = %{version}
%description -n %{libname}-krb5
The FreeRADIUS server can use Kerberos to authenticate users, and this module is necessary for that.
%package -n %{libname}-ldap
Summary: The LDAP module for %{name}
Group: System/Servers
Requires: %{name} = %{version}
%description -n %{libname}-ldap
The FreeRADIUS server can use LDAP to authenticate users, and this module is necessary for that.
%package -n %{libname}-postgresql
Summary: The PostgreSQL module for %{name}
Group: System/Servers
Requires: %{name} = %{version}
%description -n %{libname}-postgresql
The FreeRADIUS server can use PostgreSQL to authenticate users and do accounting, and this module is necessary for that.
%package -n %{libname}-mysql
Summary: The MySQL module for %{name}
Group: System/Servers
Requires: %{name} = %{version}
%description -n %{libname}-mysql
The FreeRADIUS server can use MySQL to authenticate users and do accounting, and this module is necessary for that.
%package -n %{libname}-unixODBC
Summary: The unixODBC module for %{name}
Group: System/Servers
Requires: %{name} = %{version}
%description -n %{libname}-unixODBC
The FreeRADIUS server can use unixODBC to authenticate users and do accounting, and this module is necessary for that.
%prep
%setup -q
#%patch0 -p1 -b .libgdbm
#%patch1 -p1 -b .samba3
#%patch2 -p1
find -type f -name "configure*" | xargs perl -pi -e "s|/lib\b|/%{_lib}|g"
export CFLAGS="%{optflags} -fPIC -DLDAP_DEPRECATED"
export CXXFLAGS="%{optflags} -fPIC -DLDAP_DEPRECATED"
%build
#libtoolize --force --copy
#autoreconf
%configure \
--with-gnu-ld \
--with-threads \
--with-thread-pool \
--libdir=%{_libdir}/%{name} \
--libexecdir=%{_libdir}/%{name} \
--disable-ltdl-install \
--with-ltdl-lib=%{_libdir} \
--with-rlm-dbm-lib-dir=%{_libdir} \
--with-snmp \
--with-experimental-modules \
--with-large-files \
--with-system-libltdl \
--with-system-libtool \
LIBS="-ltermcap"
%make -j1
[ -e doc/README ] && mv -f doc/README doc/README-FreeRadius
%install
[ "%{buildroot}" != / ] && rm -rf %{buildroot}
install -d %{buildroot}%{_libdir}/%{name}
%makeinstall R=%{buildroot}
sed -i "s|#user = .*|user=radiusd|
s|#group = .*|group=radiusd|" \
%{buildroot}%{_sysconfdir}/raddb/radiusd.conf
install -D -m0644 %{SOURCE1} \
%{buildroot}%{_sysconfdir}/openldap/schema/radius.schema
install -D -m0755 %{SOURCE2} \
%{buildroot}%{_initrddir}/radiusd
install -D -m0644 %{SOURCE3} \
%{buildroot}%{_sysconfdir}/pam.d/radiusd
install -D redhat/freeradius-radiusd-init \
%{buildroot}%{_initrddir}/radiusd
install -D -m0644 redhat/freeradius-logrotate \
%{buildroot}%{_sysconfdir}/logrotate.d/freeradius
## fix the naming of the sql.conf file
#mv %{buildroot}%{_sysconfdir}/raddb/sql.conf \
# %{buildroot}%{_sysconfdir}/raddb/mysql.conf
# install header files
install -d %{buildroot}%{_includedir}/%{name}
install -m0644 src/include/*.h %{buildroot}%{_includedir}/%{name}/
# put the mibs in place
install -d %{buildroot}%{_datadir}/snmp/mibs
install -m0644 mibs/FREERADIUS* mibs/RADIUS* %{buildroot}%{_datadir}/snmp/mibs/
install -d %{buildroot}/var/log/radius/radacct
touch %{buildroot}/var/log/radius/radutmp
touch %{buildroot}/var/log/radius/radwtmp
touch %{buildroot}/var/log/radius/radius.log
install -d %{buildroot}/var/run/radiusd
# remove unpackages files
rm -f %{buildroot}%{_sysconfdir}/raddb/mssql.conf
rm -f %{buildroot}%{_sysconfdir}/raddb/oraclesql.conf
%clean
[ "%{buildroot}" != / ] && rm -rf %{buildroot}
%pre
if [ $1 -eq 1 ]; then
# new install
/usr/sbin/groupadd -g %{radiusd_gid} radiusd
/usr/sbin/useradd -u %{radiusd_uid} -c radiusd -d /dev/null -g radiusd -s /bin/false radiusd
fi
exit 0
%preun
if [ $1 -eq 0 ]; then
# erase
chkconfig --del radiusd
/sbin/service radiusd stop &>/dev/null
/usr/sbin/userdel radiusd
/usr/sbin/groupdel radiusd
fi
exit 0
%postun
if [ $1 -eq 1 ]; then
# upgrade
/sbin/service radiusd condrestart
fi
exit 0
%post -n %{libname}-krb5 -p /sbin/ldconfig
%postun -n %{libname}-krb5 -p /sbin/ldconfig
%post -n %{libname}-ldap
/sbin/ldconfig
if [ $1 -eq 1 ]; then
if [ ! `grep radius.schema /etc/openldap/slapd.conf` ]; then
sed -i -e '/# Define global ACLs/i \
include /etc/openldap/schema/radius.schema' \
/etc/openldap/slapd.conf
/bin/chgrp ldap /etc/openldap/slapd.conf
/sbin/service openldap condrestart
fi
fi
exit 0
%postun -n %{libname}-ldap -p /sbin/ldconfig
%preun -n %{libname}-ldap
if [ $1 -eq 0 ]; then
sed -i 's/include.*qmail.schema//' /etc/openldap/slapd.conf
/bin/chgrp ldap /etc/openldap/slapd.conf
/sbin/service openldap restart
fi
exit 0
%post -n %{libname}-postgresql -p /sbin/ldconfig
%postun -n %{libname}-postgresql -p /sbin/ldconfig
%post -n %{libname}-mysql -p /sbin/ldconfig
%postun -n %{libname}-mysql -p /sbin/ldconfig
%post -n %{libname}-unixODBC -p /sbin/ldconfig
%postun -n %{libname}-unixODBC -p /sbin/ldconfig
%files
%defattr(-,root,root)
%config(noreplace) %{_sysconfdir}/logrotate.d/freeradius
%config(noreplace) %{_sysconfdir}/pam.d/radiusd
%dir %{_sysconfdir}/raddb
%config(noreplace) %attr(-,root,root) %{_sysconfdir}/raddb/certs/*
#%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/raddb/acct_users
#%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/raddb/attrs*
##%config(noreplace) %attr(0640,root,root) %{_sysconfdir}/raddb/clients
%config(noreplace) %attr(0640,root,root) %{_sysconfdir}/raddb/clients.conf
%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/raddb/dictionary
#%config(noreplace) %attr(0640,root,root) %{_sysconfdir}/raddb/eap.conf
#%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/raddb/example.pl
%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/raddb/experimental.conf
%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/raddb/hints
%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/raddb/huntgroups
#%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/raddb/modules
##%config(noreplace) %attr(0640,root,root) %{_sysconfdir}/raddb/naspasswd
##%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/raddb/postgresql.conf
#%config(noreplace) %attr(0640,root,root) %{_sysconfdir}/raddb/policy.conf
#%config(noreplace) %attr(0640,root,root) %{_sysconfdir}/raddb/policy.txt
%config(noreplace) %attr(0640,root,root) %{_sysconfdir}/raddb/proxy.conf
%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/raddb/radiusd.conf
#%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/raddb/realms
%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/raddb/sites-available
%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/raddb/sites-enabled
#%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/raddb/sql
#%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/raddb/sqlippool.conf
%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/raddb/templates.conf
#%config(noreplace) %attr(0640,root,root) %{_sysconfdir}/raddb/snmp.conf
#%config(noreplace) %attr(0640,root,root) %{_sysconfdir}/raddb/x99.conf
#%config(noreplace) %attr(0640,root,root) %{_sysconfdir}/raddb/x99passwd.sample
#%config(noreplace) %attr(0640,root,radiusd) %{_sysconfdir}/raddb/preproxy_users
%config(noreplace) %attr(0640,root,radiusd) %{_sysconfdir}/raddb/users
%{_sysconfdir}/raddb/panic.gdb
%config(noreplace) %attr(0640,root,radiusd) %{_sysconfdir}/raddb/trigger.conf
%{_sysconfdir}/raddb/README.rst
%dir %{_sysconfdir}/raddb/mods-available
%{_sysconfdir}/raddb/mods-available/*
%dir %{_sysconfdir}/raddb/mods-config
%config(noreplace) %{_sysconfdir}/raddb/mods-config/*
%dir %{_sysconfdir}/raddb/mods-enabled
%config(noreplace) %{_sysconfdir}/raddb/mods-enabled/*
%dir %{_sysconfdir}/raddb/policy.d
%{_sysconfdir}/raddb/policy.d/*
%{_sysconfdir}/openldap/schema/radius.schema
%attr(0755,root,root) %{_initrddir}/radiusd
%{_bindir}/*
%{_sbindir}/*
%dir %{_datadir}/freeradius
%{_datadir}/freeradius/*
%attr(0644,root,root) %{_datadir}/snmp/mibs/*
%dir %attr(0755,radiusd,radiusd) /var/log/radius
%dir %attr(0755,radiusd,radiusd) /var/log/radius/radacct
%dir %attr(0755,radiusd,radiusd) /var/run/radiusd
%attr(0644,radiusd,radiusd) %ghost /var/log/radius/radutmp
%attr(0644,radiusd,radiusd) %ghost /var/log/radius/radwtmp
%attr(0644,radiusd,radiusd) %ghost /var/log/radius/radius.log
%{_datadir}/doc/freeradius/*
%{_mandir}/man1/*
%{_mandir}/man5/*
%{_mandir}/man8/*
%doc COPYRIGHT CREDITS LICENSE doc/*
%files -n %{libname}
%defattr(-,root,root)
#%{_libdir}/%{name}/libradius*.la
#%{_libdir}/%{name}/libradius*.so
#%{_libdir}/%{name}/libeap*.la
#%{_libdir}/%{name}/libeap*.so
%{_libdir}/%{name}/proto_dhcp.la
%{_libdir}/%{name}/proto_dhcp.so
%{_libdir}/%{name}/proto_vmps.la
%{_libdir}/%{name}/proto_vmps.so
%{_libdir}/%{name}/rlm_*.la
%{_libdir}/%{name}/rlm_*.so
%{_libdir}/%{name}/libfreeradius-eap*.la
%{_libdir}/%{name}/libfreeradius-eap*.so
%{_libdir}/freeradius-server/libfreeradius-dhcp.la
%{_libdir}/freeradius-server/libfreeradius-dhcp.so
%{_libdir}/%{name}/libfreeradius-radius*.la
%{_libdir}/%{name}/libfreeradius-radius*.so
%{_libdir}/%{name}/libfreeradius-server*.la
%{_libdir}/%{name}/libfreeradius-server*.so
%exclude %{_libdir}/%{name}/rlm_sql_mysql*
%exclude %{_libdir}/%{name}/rlm_sql_postgresql*
%exclude %{_libdir}/%{name}/rlm_sql_unixodbc*
%exclude %{_libdir}/%{name}/rlm_ldap*
%files -n %{libname}-devel
%defattr(-,root,root)
%{_libdir}/%{name}/*.a
%{_includedir}/%{name}
%{_includedir}/freeradius/*.h
%files -n %{libname}-krb5
%defattr(-,root,root)
#%{_libdir}/%{name}/rlm_krb5-%{version}.so*
%files -n %{libname}-ldap
%defattr(-,root,root)
#%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/raddb/ldap.attrmap
%{_libdir}/%{name}/rlm_ldap*.so*
%{_libdir}/%{name}/rlm_ldap*.la
%files -n %{libname}-postgresql
%defattr(-,root,root)
#%config(noreplace) %attr(0640,root,root) %{_sysconfdir}/raddb/postgresql.conf
%{_libdir}/%{name}/rlm_sql_postgresql*.so*
%{_libdir}/%{name}/rlm_sql_postgresql*.la
%files -n %{libname}-mysql
%defattr(-,root,root)
#%config(noreplace) %attr(0640,root,root) %{_sysconfdir}/raddb/mysql.conf
%{_libdir}/%{name}/rlm_sql_mysql*.so*
%{_libdir}/%{name}/rlm_sql_mysql*.la
%files -n %{libname}-unixODBC
%defattr(-,root,root)
%{_libdir}/%{name}/rlm_sql_unixodbc*.so*
%{_libdir}/%{name}/rlm_sql_unixodbc*.la
%changelog
* Sat Aug 22 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 3.0.21-2mamba
- rebuilt by autoport with build requirements: libhiredis-devel>=1.0.0-1mamba--buildreqlibhiredis-devel>=1.0.0-1mamba
* Sat May 02 2020 Automatic Build System <autodist@mambasoft.it> 3.0.21-1mamba
- automatic update by autodist
* Sat Nov 18 2017 Automatic Build System <autodist@mambasoft.it> 3.0.15-1mamba
- automatic update by autodist
* Wed May 20 2015 Automatic Build System <autodist@mambasoft.it> 3.0.8-1mamba
- automatic update by autodist
* Wed Mar 18 2015 Automatic Build System <autodist@mambasoft.it> 3.0.7-1mamba
- automatic update by autodist
* Sat Dec 20 2014 Automatic Build System <autodist@mambasoft.it> 3.0.6-1mamba
- automatic update by autodist
* Mon Jun 23 2014 Automatic Build System <autodist@mambasoft.it> 3.0.3-1mamba
- automatic update by autodist
* Thu Sep 19 2013 Automatic Build System <autodist@mambasoft.it> 2.2.1-1mamba
- automatic update by autodist
* Fri Nov 23 2012 Automatic Build System <autodist@mambasoft.it> 2.2.0-1mamba
- automatic version update by autodist
* Tue Jun 22 2010 Automatic Build System <autodist@mambasoft.it> 2.1.9-1mamba
- automatic update by autodist
* Mon Feb 08 2010 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.8-2mamba
- rebuilt without libshadow
* Thu Jan 14 2010 Automatic Build System <autodist@mambasoft.it> 2.1.8-1mamba
- automatic update by autodist
* Sun Sep 20 2009 Automatic Build System <autodist@mambasoft.it> 2.1.7-1mamba
- automatic update by autodist
* Sat May 30 2009 Automatic Build System <autodist@mambasoft.it> 2.1.6-1mamba
- automatic update by autodist
* Fri Apr 03 2009 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.4-1mamba
- update to 2.1.4
* Fri Apr 03 2009 Silvan Calarco <silvan.calarco@mambasoft.it> 1.0.5-4mamba
- automatic rebuild by autodist
* Tue Mar 21 2006 Davide Madrisan <davide.madrisan@qilinux.it> 1.0.5-3qilnx
- install freeradius mibs and headers files
- libraries splitted into several packages
- added ghost logging files to main package
* Wed Nov 16 2005 Davide Madrisan <davide.madrisan@qilinux.it> 1.0.5-2qilnx
- fixed test for gdbm library usability in the configure script
* Wed Nov 16 2005 Davide Madrisan <davide.madrisan@qilinux.it> 1.0.5-1qilnx
- update to version 1.0.5 by autospec
* Wed Mar 09 2005 Davide Madrisan <davide.madrisan@qilinux.it> 1.0.2-1qilnx
- update to version 1.0.2 by autospec
- also fix security issues QSA-2005-023 (CAN-2004-[0938,0960,0961])
- added missing build requirements
* Wed Aug 18 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 1.0.0-1qilnx
- new version build
- use radiusd userid from QiLinux database
* Tue Apr 13 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 0.9.3-3qilnx
- rebuild with libtool's libltdl fixed (don't install freeradius' own)
* Thu Feb 19 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 0.9.3-2qilnx
- fixed initscript chkconfig stuff
* Mon Nov 24 2003 Davide Madrisan <davide.madrisan@qilinux.it> 0.9.3-1qilnx
- rebuilt with version 0.9.3 (security fix)
* Tue Sep 23 2003 Silvan Calarco <silvan.calarco@mambasoft.it> 0.9.1-1qilnx
- upgrade to new version
* Mon Sep 22 2003 Silvan Calarco <silvan.calarco@mambasoft.it> 0.8.1-1qilnx
- first build