diff --git a/freeradius-server.spec b/freeradius-server.spec index 55378dc..299d426 100644 --- a/freeradius-server.spec +++ b/freeradius-server.spec @@ -4,8 +4,8 @@ %define libname libfreeradius Name: freeradius-server -Version: 3.2.0 -Release: 1mamba +Version: 3.2.1 +Release: 2mamba Summary: A high performance and highly configurable GPL'd free RADIUS server Group: System/Servers Vendor: openmamba @@ -16,6 +16,9 @@ Source0: ftp://ftp.freeradius.org/pub/radius/freeradius-server-%{version}. Source1: freeradius-RADIUS-LDAPv3.schema Source2: freeradius-initscript Source3: freeradius-pam +Source4: freeradius.service +Source5: freeradius-tmpfiles.conf +Source6: freeradius-sysusers.conf Patch0: freeradius-1.0.5-configure_libgdbm.patch Patch1: freeradius-1.0.0-samba3.patch Patch2: freeradius-2.1.3-qafixes.patch @@ -45,7 +48,6 @@ BuildRequires: libpcap-devel BuildRequires: libpcre-devel BuildRequires: libperl BuildRequires: libpostgresql-devel -BuildRequires: libpython3-devel BuildRequires: libreadline-devel BuildRequires: libruby-devel BuildRequires: libsqlite-devel @@ -60,8 +62,9 @@ BuildRequires: perl-devel ## AUTOBUILDREQ-END BuildRequires: libhiredis-devel >= 1.0.0-1mamba BuildRequires: libopenldap-devel >= 2.2.20 +BuildRequires: libruby-devel >= 3.2.0 Provides: freeradius -Obsoletes: freeradius +Obsoletes: freeradius < 3.2.1 Requires: %{libname} = %{version} Requires: openldap-servers >= 2.1.22 @@ -131,6 +134,8 @@ The FreeRADIUS server can use unixODBC to authenticate users and do accounting, %prep %setup -q +#-D -T +#:<< _EOF #%patch0 -p1 -b .libgdbm #%patch1 -p1 -b .samba3 #%patch2 -p1 @@ -141,6 +146,7 @@ export CFLAGS="%{optflags} -fPIC -DLDAP_DEPRECATED" export CXXFLAGS="%{optflags} -fPIC -DLDAP_DEPRECATED" %build +#:<< _EOF #libtoolize --force --copy #autoreconf %configure \ @@ -157,6 +163,8 @@ export CXXFLAGS="%{optflags} -fPIC -DLDAP_DEPRECATED" --with-large-files \ --with-system-libltdl \ --with-system-libtool \ + --without-rlm_python \ + --without-rlm_python3 \ LIBS="-ltermcap" %make -j1 @@ -176,13 +184,15 @@ sed -i "s|#user = .*|user=radiusd| 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 -m0644 %{SOURCE4} \ + %{buildroot}%{_unitdir}/freeradius.service +install -D -m0644 %{SOURCE5} \ + %{buildroot}%{_tmpfilesdir}/freeradius.conf +#install -D -m0644 %{SOURCE6} \ +# %{buildroot}%{_sysusersdir}/freeradius.conf -install -D redhat/freeradius-radiusd-init \ - %{buildroot}%{_initrddir}/radiusd install -D -m0644 redhat/freeradius-logrotate \ %{buildroot}%{_sysconfdir}/logrotate.d/freeradius @@ -219,51 +229,27 @@ if [ $1 -eq 1 ]; then /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 +%systemd_pre freeradius +: %preun +%systemd_preun freeradius 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 +%systemd_postun_with_restart freeradius +: %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 - +%post -n %{libname}-ldap -p /sbin/ldconfig %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 @@ -279,36 +265,19 @@ exit 0 %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/panic.gdb %{_sysconfdir}/raddb/README.rst %dir %{_sysconfdir}/raddb/mods-available %{_sysconfdir}/raddb/mods-available/* @@ -319,9 +288,10 @@ exit 0 %dir %{_sysconfdir}/raddb/policy.d %{_sysconfdir}/raddb/policy.d/* %{_sysconfdir}/openldap/schema/radius.schema -%attr(0755,root,root) %{_initrddir}/radiusd %{_bindir}/* %{_sbindir}/* +%{_unitdir}/freeradius.service +%{_tmpfilesdir}/freeradius.conf %dir %{_datadir}/freeradius %{_datadir}/freeradius/* %attr(0644,root,root) %{_datadir}/snmp/mibs/* @@ -396,6 +366,12 @@ exit 0 %{_libdir}/%{name}/rlm_sql_unixodbc*.la %changelog +* Mon Jan 02 2023 Silvan Calarco 3.2.1-2mamba +- rebuilt with ruby 3.2.0 + +* Sun Dec 11 2022 Automatic Build System 3.2.1-1mamba +- automatic version update by autodist + * Mon Jun 06 2022 Automatic Build System 3.2.0-1mamba - automatic version update by autodist diff --git a/freeradius-sysusers.conf b/freeradius-sysusers.conf new file mode 100644 index 0000000..209ec89 --- /dev/null +++ b/freeradius-sysusers.conf @@ -0,0 +1 @@ +u radiusd - "radius daemon" - diff --git a/freeradius-tmpfiles.conf b/freeradius-tmpfiles.conf new file mode 100644 index 0000000..b527814 --- /dev/null +++ b/freeradius-tmpfiles.conf @@ -0,0 +1,8 @@ +# configuration directory +C /etc/raddb 0755 radiusd radiusd - /etc/raddb.default + +# log file +f /var/log/radius/radius.log 0644 radiusd radiusd - + +# run directory +d /run/radiusd 0755 radiusd radiusd - diff --git a/freeradius.service b/freeradius.service new file mode 100644 index 0000000..92a1c2a --- /dev/null +++ b/freeradius.service @@ -0,0 +1,19 @@ +[Unit] +Description=FreeRADIUS high performance RADIUS server. +After=syslog.target network.target +Documentation=man:radiusd(8) man:radiusd.conf(5) https://wiki.freeradius.org/Home https://networkradius.com/freeradius-documentation/ + +[Service] +Type=forking +PIDFile=/run/radiusd/radiusd.pid +ExecStartPre=/usr/bin/radiusd -C +ExecStart=/usr/bin/radiusd -d /etc/raddb +ExecReload=/usr/bin/radiusd -C +ExecReload=/bin/kill -HUP $MAINPID +Restart=on-failure +RestartSec=2 +ProtectSystem=full +ProtectHome=on + +[Install] +WantedBy=multi-user.target