Accepting request 425076 from home:adamm:branches:network

- use %{with} macro for conditional inclusions instead of hardcoding
  version numbers
- improved package descriptions
- fixed builds on SLE12 and SLE11SP4

OBS-URL: https://build.opensuse.org/request/show/425076
OBS-URL: https://build.opensuse.org/package/show/network/freeradius-server?expand=0&rev=83
This commit is contained in:
Ismail Dönmez 2016-09-06 11:59:19 +00:00 committed by Git OBS Bridge
parent 8f53a8841d
commit 122c166ff2
2 changed files with 110 additions and 45 deletions

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Fri Sep 2 12:16:56 UTC 2016 - adam.majer@suse.de
- use %{with} macro for conditional inclusions instead of hardcoding
version numbers
- improved package descriptions
- fixed builds on SLE12 and SLE11SP4
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Jan 25 18:48:55 UTC 2016 - michael@stroeder.com Mon Jan 25 18:48:55 UTC 2016 - michael@stroeder.com

View File

@ -1,7 +1,7 @@
# #
# spec file for package freeradius-server # spec file for package freeradius-server
# #
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -22,7 +22,26 @@
Name: freeradius-server Name: freeradius-server
Version: 3.0.11 Version: 3.0.11
Release: 0 Release: 0
Summary: Very Highly Configurable Radius Server
%if 0%{?suse_version} > 1140
%bcond_without systemd
%bcond_without freetds
%bcond_without libjson
%define runpath /run
%else
%bcond_with systemd
%bcond_with freetds
%bcond_with libjson
%define runpath /var/run
%endif
%if 0%{?is_opensuse}
%bcond_without memcached
%else
%bcond_with memcached
%endif
Summary: RADIUS Server
License: GPL-2.0 and LGPL-2.1 License: GPL-2.0 and LGPL-2.1
Group: Productivity/Networking/Radius/Servers Group: Productivity/Networking/Radius/Servers
Url: http://www.freeradius.org/ Url: http://www.freeradius.org/
@ -38,7 +57,12 @@ Patch5: freeradius-server-rlm_sql_unixodbc-configure.patch
BuildRequires: apache2-devel BuildRequires: apache2-devel
BuildRequires: cyrus-sasl-devel BuildRequires: cyrus-sasl-devel
BuildRequires: db-devel BuildRequires: db-devel
%if 0%{?suse_version} > 0 && 0%{?suse_version} <= 1110
BuildRequires: libdb-5_1-devel
%endif
%if %{with freetds}
BuildRequires: freetds-devel BuildRequires: freetds-devel
%endif
BuildRequires: gcc-c++ BuildRequires: gcc-c++
BuildRequires: gdbm-devel BuildRequires: gdbm-devel
BuildRequires: gettext-devel BuildRequires: gettext-devel
@ -47,8 +71,12 @@ BuildRequires: krb5-devel
BuildRequires: libcom_err-devel BuildRequires: libcom_err-devel
BuildRequires: libcurl-devel BuildRequires: libcurl-devel
BuildRequires: libidn-devel BuildRequires: libidn-devel
%if %{with json}
BuildRequires: libjson-devel BuildRequires: libjson-devel
%endif
%if %{with memcached}
BuildRequires: libmemcached-devel BuildRequires: libmemcached-devel
%endif
BuildRequires: libmysqlclient-devel BuildRequires: libmysqlclient-devel
BuildRequires: libpcap-devel BuildRequires: libpcap-devel
BuildRequires: libtalloc-devel BuildRequires: libtalloc-devel
@ -63,7 +91,11 @@ BuildRequires: postgresql-devel
BuildRequires: python-devel BuildRequires: python-devel
BuildRequires: sqlite3-devel BuildRequires: sqlite3-devel
BuildRequires: unixODBC-devel BuildRequires: unixODBC-devel
%if 0%{?suse_version} > 1110
BuildRequires: pkgconfig(apr-1) BuildRequires: pkgconfig(apr-1)
%else
BuildRequires: libapr1-devel
%endif
Requires: %fillup_prereq Requires: %fillup_prereq
Requires: %insserv_prereq Requires: %insserv_prereq
Requires: %{name}-libs = %{version} Requires: %{name}-libs = %{version}
@ -79,21 +111,25 @@ Obsoletes: freeradius < %{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
%{?libperl_requires} %{?libperl_requires}
Conflicts: radiusd-livingston radiusd-cistron icradius Conflicts: radiusd-livingston radiusd-cistron icradius
%if 0%{?suse_version} > 1140 %if %{with systemd}
BuildRequires: systemd BuildRequires: systemd
%{?systemd_requires} %{?systemd_requires}
%endif %endif
%description %description
The FreeRADIUS server has a number of features found in other servers Remote Authentication Dial-In User Service (RADIUS) is a networking
and additional features not found in any other server. protocol that provides centralized Authentication, Authorization, and
Accounting (AAA or Triple A) management for users who connect and
use a network service.
FreeRADIUS is a modular, high performance free RADIUS implementation.
%package libs %package libs
Summary: FreeRADIUS shared library Summary: FreeRADIUS shared library
Group: Productivity/Networking/Radius/Servers Group: Productivity/Networking/Radius/Servers
%description libs %description libs
The FreeRADIUS shared library The FreeRADIUS shared libraries
%package utils %package utils
Summary: FreeRADIUS Clients Summary: FreeRADIUS Clients
@ -101,16 +137,15 @@ Group: Productivity/Networking/Radius/Clients
Requires: %{name}-libs = %{version} Requires: %{name}-libs = %{version}
%description utils %description utils
The FreeRADIUS server has a number of features found in other servers Collection of FreeRADIUS utilities
and additional features not found in any other server.
%package devel %package devel
Summary: FreeRADIUS Development Files (static libs) Summary: FreeRADIUS Development Files
Group: Development/Libraries/C and C++ Group: Development/Libraries/C and C++
Requires: %{name}-libs = %{version} Requires: %{name}-libs = %{version}
%description devel %description devel
These are the static libraries for the FreeRADIUS package. FreeRADIUS development header files
%package doc %package doc
Summary: FreeRADIUS Documentation Summary: FreeRADIUS Documentation
@ -118,7 +153,7 @@ Group: Productivity/Networking/Radius/Servers
Requires: %{name} Requires: %{name}
%description doc %description doc
This package contains FreeRADIUS Documentation FreeRADIUS documentation
%package ldap %package ldap
Summary: LDAP support for freeradius Summary: LDAP support for freeradius
@ -127,7 +162,7 @@ BuildRequires: openldap2-devel
Requires: %{name} = %{version} Requires: %{name} = %{version}
%description ldap %description ldap
This plugin provides the LDAP support for the FreeRADIUS server project. FreeRADIUS plugin providing LDAP support.
%package krb5 %package krb5
Summary: Kerberos 5 support for freeradius Summary: Kerberos 5 support for freeradius
@ -136,7 +171,7 @@ BuildRequires: krb5-devel
Requires: %{name} = %{version} Requires: %{name} = %{version}
%description krb5 %description krb5
This plugin provides the Kerberos 5 support for the FreeRADIUS server project. FreeRADIUS plugin providing Kerberos 5 authentication support.
%package perl %package perl
Summary: Perl support for freeradius Summary: Perl support for freeradius
@ -147,7 +182,7 @@ Requires: %{name} = %{version}
Requires: perl Requires: perl
%description perl %description perl
This plugin provides the Perl support for the FreeRADIUS server project. FreeRADIUS plugin providing Perl support.
%package python %package python
Summary: Python support for freeradius Summary: Python support for freeradius
@ -156,7 +191,7 @@ BuildRequires: python-devel
Requires: %{name} = %{version} Requires: %{name} = %{version}
%description python %description python
This plugin provides the Python support for the FreeRADIUS server project. FreeRADIUS plugin providing Python support.
%package mysql %package mysql
Summary: MySQL support for freeradius Summary: MySQL support for freeradius
@ -165,7 +200,7 @@ BuildRequires: mysql-devel
Requires: %{name} = %{version} Requires: %{name} = %{version}
%description mysql %description mysql
This plugin provides the MySQL support for the FreeRADIUS server project. FreeRADIUS plugin providing MySQL support.
%package postgresql %package postgresql
Summary: Postgresql support for freeradius Summary: Postgresql support for freeradius
@ -174,7 +209,7 @@ BuildRequires: postgresql-devel
Requires: %{name} = %{version} Requires: %{name} = %{version}
%description postgresql %description postgresql
This plugin provides the postgresql support for the FreeRADIUS server project. FreeRADIUS plugin providing PostgreSQL support.
%package sqlite %package sqlite
Summary: SQLite support for freeradius Summary: SQLite support for freeradius
@ -183,7 +218,7 @@ BuildRequires: sqlite3-devel
Requires: %{name} = %{version} Requires: %{name} = %{version}
%description sqlite %description sqlite
This plugin provides the SQLite support for the FreeRADIUS server project. FreeRADIUS plugin providing SQLite support.
%prep %prep
%setup -q %setup -q
@ -222,6 +257,15 @@ export LDFLAGS="-pie"
--without-rlm_rediswho \ --without-rlm_rediswho \
--without-rlm_sql_oracle \ --without-rlm_sql_oracle \
--without-rlm_securid \ --without-rlm_securid \
%if ! %{with memcached}
--without-rlm_cache_memcached \
%endif
%if ! %{with freetds}
--without-rlm_freetds \
%endif
%if ! %{with json}
--without-rlm_rest \
%endif
--disable-silent-rules --disable-silent-rules
make %{?_smp_mflags} make %{?_smp_mflags}
@ -236,25 +280,24 @@ perl -i -pe 's/^#group =.*$/group = radiusd/' $RADDB/radiusd.conf
# logs # logs
touch %{buildroot}%{_localstatedir}/log/radius/radutmp touch %{buildroot}%{_localstatedir}/log/radius/radutmp
touch %{buildroot}%{_localstatedir}/log/radius/radius.log touch %{buildroot}%{_localstatedir}/log/radius/radius.log
mkdir -p %{buildroot}%{_tmpfilesdir}
install -m 0644 %{SOURCE2} %{buildroot}%{_tmpfilesdir}/%{unitname}.conf
install -D -m 755 %{SOURCE1} %{buildroot}%{_unitdir}/%{unitname}.service
# SUSE # SUSE
install -d %{buildroot}%{_sysconfdir}/pam.d install -d %{buildroot}%{_sysconfdir}/pam.d
install -d %{buildroot}%{_sysconfdir}/logrotate.d install -d %{buildroot}%{_sysconfdir}/logrotate.d
install -m 644 suse/radiusd-pam %{buildroot}%{_sysconfdir}/pam.d/radiusd install -m 644 suse/radiusd-pam %{buildroot}%{_sysconfdir}/pam.d/radiusd
install -m 644 suse/radiusd-logrotate %{buildroot}%{_sysconfdir}/logrotate.d/radiusd install -m 644 suse/radiusd-logrotate %{buildroot}%{_sysconfdir}/logrotate.d/radiusd
%if 0%{?suse_version} < 1140 %if %{with systemd}
install -d -m 755 %{buildroot}%{_sysconfdir}/init.d mkdir -p %{buildroot}%{_tmpfilesdir}
install -m 744 suse/rcradiusd %{buildroot}%{_sysconfdir}/init.d/freeradius install -m 0644 %{SOURCE2} %{buildroot}%{_tmpfilesdir}/%{unitname}.conf
ln -sf %{buildroot}%{_sysconfdir}/init.d/freeradius %{buildroot}%{_sbindir}/rcfreeradius install -D -m 755 %{SOURCE1} %{buildroot}%{_unitdir}/%{unitname}.service
%else
# name the rc script according to the systemd unit # name the rc script according to the systemd unit
ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcradiusd ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcradiusd
%else
install -d -m 755 %{buildroot}%{_sysconfdir}/init.d
install -m 744 suse/rcradiusd %{buildroot}%{_sysconfdir}/init.d/freeradius
ln -sf %{_sysconfdir}/init.d/freeradius %{buildroot}%{_sbindir}/rcfreeradius
%endif %endif
mkdir -p %{buildroot}/run/
install -d -m 0710 %{buildroot}/run/radiusd/
cp -al %{buildroot}%{_sbindir}/radiusd %{buildroot}%{_sbindir}/radrelay cp -al %{buildroot}%{_sbindir}/radiusd %{buildroot}%{_sbindir}/radrelay
install -D -d -m 0710 %{buildroot}%{runpath}/radiusd
mv -v doc/README doc/README.doc mv -v doc/README doc/README.doc
# remove unneeded stuff # remove unneeded stuff
rm -f %{buildroot}%{_sysconfdir}/raddb/certs/*.crt rm -f %{buildroot}%{_sysconfdir}/raddb/certs/*.crt
@ -279,6 +322,9 @@ rm -rf %{buildroot}%{_sysconfdir}/raddb/mods-config/sql/main/mssql
rm -rf %{buildroot}%{_sysconfdir}/raddb/mods-config/sql/ippool/oracle rm -rf %{buildroot}%{_sysconfdir}/raddb/mods-config/sql/ippool/oracle
rm -rf %{buildroot}%{_sysconfdir}/raddb/mods-config/sql/ippool-dhcp/oracle rm -rf %{buildroot}%{_sysconfdir}/raddb/mods-config/sql/ippool-dhcp/oracle
rm -rf %{buildroot}%{_sysconfdir}/raddb/mods-config/sql/main/oracle rm -rf %{buildroot}%{_sysconfdir}/raddb/mods-config/sql/main/oracle
%if ! %{with json}
rm %{buildroot}%{_sysconfdir}/raddb/mods-available/rest
%endif
%pre %pre
%{_sbindir}/groupadd -r radiusd 2> /dev/null || : %{_sbindir}/groupadd -r radiusd 2> /dev/null || :
@ -290,9 +336,13 @@ rm -rf %{buildroot}%{_sysconfdir}/raddb/mods-config/sql/main/oracle
%{_bindir}/getent group winbind \ %{_bindir}/getent group winbind \
|| %{_sbindir}/groupadd -r winbind || %{_sbindir}/groupadd -r winbind
# add radiusd to winbind group # add radiusd to winbind group
%if 0%{?suse_version} > 0 && 0%{?suse_version} < 1140
%{_sbindir}/groupmod -A radiusd winbind
%else
%{_bindir}/gpasswd -a radiusd winbind %{_bindir}/gpasswd -a radiusd winbind
%endif
%if 0%{?suse_version} > 1140 %if %{with systemd}
%service_add_pre %{unitname}.service %service_add_pre %{unitname}.service
%endif %endif
@ -303,28 +353,27 @@ if [ $1 -eq 1 ]; then
fi fi
chgrp radiusd %{_sysconfdir}/raddb/certs/* chgrp radiusd %{_sysconfdir}/raddb/certs/*
%if 0%{?suse_version} < 1140 %if %{with systemd}
%service_add_post %{unitname}.service
systemd-tmpfiles --create %{_tmpfilesdir}/%{unitname}.conf
%else
%fillup_and_insserv freeradius %fillup_and_insserv freeradius
%endif %endif
%if 0%{?suse_version} > 1140
%service_add_post %{unitname}.service
systemd-tmpfiles --create %{_tmpfilesdir}/%{unitname}.conf
%endif
%preun %preun
%if 0%{?suse_version} < 1140 %if %{with systemd}
%stop_on_removal freeradius
%else
%service_del_preun %{unitname}.service %service_del_preun %{unitname}.service
%else
%insserv_cleanup
%restart_on_update freeradius
%endif %endif
%postun %postun
%if 0%{?suse_version} < 1140 %if %{with systemd}
%service_del_postun %{unitname}.service
%else
%insserv_cleanup %insserv_cleanup
%restart_on_update freeradius %restart_on_update freeradius
%else
%service_del_postun %{unitname}.service
%endif %endif
%files doc %files doc
@ -338,11 +387,11 @@ systemd-tmpfiles --create %{_tmpfilesdir}/%{unitname}.conf
# SUSE # SUSE
%config %{_sysconfdir}/pam.d/radiusd %config %{_sysconfdir}/pam.d/radiusd
%config %{_sysconfdir}/logrotate.d/radiusd %config %{_sysconfdir}/logrotate.d/radiusd
%if 0%{?suse_version} < 1140 %if %{with systemd}
%{_sbindir}/rcradiusd
%else
%config %{_sysconfdir}/init.d/freeradius %config %{_sysconfdir}/init.d/freeradius
%{_sbindir}/rcfreeradius %{_sbindir}/rcfreeradius
%else
%{_sbindir}/rcradiusd
%endif %endif
%dir %attr(755,radiusd,radiusd) %{_localstatedir}/lib/radiusd %dir %attr(755,radiusd,radiusd) %{_localstatedir}/lib/radiusd
# configs # configs
@ -365,8 +414,10 @@ systemd-tmpfiles --create %{_tmpfilesdir}/%{unitname}.conf
%{_sysconfdir}/raddb/panic.gdb %{_sysconfdir}/raddb/panic.gdb
%attr(640,root,radiusd) %config(noreplace) %{_sysconfdir}/raddb/certs/*.cnf %attr(640,root,radiusd) %config(noreplace) %{_sysconfdir}/raddb/certs/*.cnf
%attr(750,root,radiusd) %{_sysconfdir}/raddb/certs/bootstrap %attr(750,root,radiusd) %{_sysconfdir}/raddb/certs/bootstrap
%if %{with systemd}
%{_tmpfilesdir}/%{unitname}.conf %{_tmpfilesdir}/%{unitname}.conf
%{_unitdir}/%{unitname}.service %{_unitdir}/%{unitname}.service
%endif
# mods-config # mods-config
%dir %attr(750,root,radiusd) %{_sysconfdir}/raddb/mods-config %dir %attr(750,root,radiusd) %{_sysconfdir}/raddb/mods-config
@ -474,7 +525,9 @@ systemd-tmpfiles --create %{_tmpfilesdir}/%{unitname}.conf
%attr(640,root,radiusd) %config(noreplace) %{_sysconfdir}/raddb/mods-available/redis %attr(640,root,radiusd) %config(noreplace) %{_sysconfdir}/raddb/mods-available/redis
%attr(640,root,radiusd) %config(noreplace) %{_sysconfdir}/raddb/mods-available/rediswho %attr(640,root,radiusd) %config(noreplace) %{_sysconfdir}/raddb/mods-available/rediswho
%attr(640,root,radiusd) %config(noreplace) %{_sysconfdir}/raddb/mods-available/replicate %attr(640,root,radiusd) %config(noreplace) %{_sysconfdir}/raddb/mods-available/replicate
%if %{with json}
%attr(640,root,radiusd) %config(noreplace) %{_sysconfdir}/raddb/mods-available/rest %attr(640,root,radiusd) %config(noreplace) %{_sysconfdir}/raddb/mods-available/rest
%endif
%attr(640,root,radiusd) %config(noreplace) %{_sysconfdir}/raddb/mods-available/smbpasswd %attr(640,root,radiusd) %config(noreplace) %{_sysconfdir}/raddb/mods-available/smbpasswd
%attr(640,root,radiusd) %config(noreplace) %{_sysconfdir}/raddb/mods-available/smsotp %attr(640,root,radiusd) %config(noreplace) %{_sysconfdir}/raddb/mods-available/smsotp
%attr(640,root,radiusd) %config(noreplace) %{_sysconfdir}/raddb/mods-available/soh %attr(640,root,radiusd) %config(noreplace) %{_sysconfdir}/raddb/mods-available/soh
@ -541,7 +594,7 @@ systemd-tmpfiles --create %{_tmpfilesdir}/%{unitname}.conf
%config(noreplace) %{_sysconfdir}/raddb/users %config(noreplace) %{_sysconfdir}/raddb/users
%attr(640,root,radiusd) %config(noreplace) %{_sysconfdir}/raddb/templates.conf %attr(640,root,radiusd) %config(noreplace) %{_sysconfdir}/raddb/templates.conf
%attr(700,radiusd,radiusd) %dir %ghost /run/radiusd/ %attr(710,radiusd,radiusd) %dir %ghost %{runpath}/radiusd
# binaries # binaries
%defattr(-,root,root) %defattr(-,root,root)
%{_sbindir}/checkrad %{_sbindir}/checkrad
@ -602,7 +655,9 @@ systemd-tmpfiles --create %{_tmpfilesdir}/%{unitname}.conf
%{_libdir}/freeradius/rlm_radutmp.so %{_libdir}/freeradius/rlm_radutmp.so
%{_libdir}/freeradius/rlm_realm.so %{_libdir}/freeradius/rlm_realm.so
%{_libdir}/freeradius/rlm_replicate.so %{_libdir}/freeradius/rlm_replicate.so
%if %{with json}
%{_libdir}/freeradius/rlm_rest.so %{_libdir}/freeradius/rlm_rest.so
%endif
%{_libdir}/freeradius/rlm_soh.so %{_libdir}/freeradius/rlm_soh.so
%{_libdir}/freeradius/rlm_sometimes.so %{_libdir}/freeradius/rlm_sometimes.so
%{_libdir}/freeradius/rlm_sql.so %{_libdir}/freeradius/rlm_sql.so
@ -616,7 +671,9 @@ systemd-tmpfiles --create %{_tmpfilesdir}/%{unitname}.conf
%{_libdir}/freeradius/rlm_yubikey.so %{_libdir}/freeradius/rlm_yubikey.so
%{_libdir}/freeradius/rlm_sql_unixodbc.so %{_libdir}/freeradius/rlm_sql_unixodbc.so
%{_libdir}/freeradius/rlm_unpack.so %{_libdir}/freeradius/rlm_unpack.so
%if %{with memcached}
%{_libdir}/freeradius/rlm_cache_memcached.so %{_libdir}/freeradius/rlm_cache_memcached.so
%endif
%{_libdir}/freeradius/rlm_cache_rbtree.so %{_libdir}/freeradius/rlm_cache_rbtree.so
%files utils %files utils