[cpp-linbuild] 03/05: Remove obsolete shibboleth.spec conditionals

Codeberg noreply at shibboleth.net
Sun Feb 15 00:12:10 UTC 2026


This is an automated email from the git hooks/post-receive script.

codeberg pushed a commit to branch maint-3
in repository cpp-linbuild.

View the commit online:
https://codeberg.org/Shibboleth/cpp-linbuild/commit/fe9ecc2e101fda15b84a9c71f08a8b67578f4118

commit fe9ecc2e101fda15b84a9c71f08a8b67578f4118
Author: John W. O'Brien <john at saltant.com>
AuthorDate: Sat Feb 14 20:56:00 2026 +0000

    Remove obsolete shibboleth.spec conditionals
    
    Every platform for which we currently build RPMs either sets
    %_vendor to "redhat" and %rhel to >= 7, or $_vendor to "amazon"
    and %amzn to >= 2.
    
    In this patch, all removals are for no-op conditional with the
    exception of a few cases where "%{?amzn} == 2" would not cover
    Amazon Linux 2023, which are deemed of no consequence.
---
 common/SPECS/shibboleth.spec | 107 ++++++++++---------------------------------
 1 file changed, 24 insertions(+), 83 deletions(-)

diff --git a/common/SPECS/shibboleth.spec b/common/SPECS/shibboleth.spec
index 2e4f3c1..371e631 100644
--- a/common/SPECS/shibboleth.spec
+++ b/common/SPECS/shibboleth.spec
@@ -9,20 +9,11 @@ URL: http://shibboleth.net/
 Source0: https://shibboleth.net/downloads/service-provider/%{version}/%{name}-sp-%{version}.tar.bz2
 Obsoletes: shibboleth-sp = 2.5.0
 Requires: openssl
-%if 0%{?rhel} >= 7 || 0%{?amzn} == 2
 Requires(pre,preun): xmltooling-schemas%{?_isa} >= 3.3.0
 Requires(pre,preun): opensaml-schemas%{?_isa} >= 3.3.0
-%else
-Requires(pre,preun): xmltooling-schemas >= 3.3.0
-Requires(pre,preun): opensaml-schemas >= 3.3.0
-%endif
-%if 0%{?rhel} >= 7 || 0%{?amzn} >= 2
 Requires: hostname
 BuildRequires: systemd-devel
 %{?systemd_requires}
-%else
-Requires: net-tools
-%endif
 %if 0%{?rhel} >= 8
 BuildRequires: gdb
 %endif
@@ -47,15 +38,9 @@ BuildRequires: boost-devel >= 1.32.0
 BuildRequires: libmemcached-devel
 %endif
 %{?_with_memcached:BuildRequires: libmemcached-devel}
-%if "%{_vendor}" == "redhat" || "%{_vendor}" == "amazon"
-%if 0%{?rhel} >= 7 || 0%{?amzn} == 2
 %{!?_without_builtinapache:BuildRequires: httpd-devel%{?_isa}}
-%else
-%{!?_without_builtinapache:BuildRequires: httpd-devel}
-%endif
 BuildRequires: redhat-rpm-config
 Requires(pre): shadow-utils
-%endif
 
 %define runuser shibd
 %define pkgdocdir %{_docdir}/shibboleth-%{version}
@@ -97,12 +82,8 @@ This package includes files needed for development with Shibboleth.
 %if 0%{?rhel} >= 8
     %configure %{?_without_odbc:--disable-odbc} %{?_without_adfs:--disable-adfs} %{?_with_fastcgi} %{!?_without_gssapi:--with-gssapi} %{?_with_memcached} %{!?_without_systemd:--enable-systemd} %{?shib_options}
 %else
-%if 0%{?rhel} >= 7
     # includes Amazon Linux 2
     %configure %{?_without_odbc:--disable-odbc} %{?_without_adfs:--disable-adfs} %{?_with_fastcgi} %{!?_without_gssapi:--with-gssapi} %{!?_without_memcached:--with-memcached} %{!?_without_systemd:--enable-systemd} %{?shib_options} PKG_CONFIG_PATH=/opt/shibboleth/%{_lib}/pkgconfig
-%else
-    %configure %{?_without_odbc:--disable-odbc} %{?_without_adfs:--disable-adfs} %{?_with_fastcgi} %{!?_without_gssapi:--with-gssapi} %{?_with_memcached} %{?shib_options}
-%endif
 %endif
 %endif
 %{__make} pkgdocdir=%{pkgdocdir}
@@ -143,27 +124,23 @@ fi
 
 # Establish location of systemd file, if any.
 SYSTEMD_SHIBD="no"
-%if 0%{?rhel} >= 7 || 0%{?amzn} >= 2
-    %{__mkdir} -p $RPM_BUILD_ROOT%{_unitdir}
-    echo "%attr(0444,-,-) %{_unitdir}/shibd.service" >> rpm.filelist
-    SYSTEMD_SHIBD="$RPM_BUILD_ROOT%{_unitdir}/shibd.service"
-
-    # Get run directory created at boot time.
-    %{__mkdir} -p $RPM_BUILD_ROOT%{_tmpfilesdir}
-    echo "%attr(0444,-,-) %{_tmpfilesdir}/%{name}.conf" >> rpm.filelist
-    cat > $RPM_BUILD_ROOT%{_tmpfilesdir}/%{name}.conf <<EOF
+%{__mkdir} -p $RPM_BUILD_ROOT%{_unitdir}
+echo "%attr(0444,-,-) %{_unitdir}/shibd.service" >> rpm.filelist
+SYSTEMD_SHIBD="$RPM_BUILD_ROOT%{_unitdir}/shibd.service"
+
+# Get run directory created at boot time.
+%{__mkdir} -p $RPM_BUILD_ROOT%{_tmpfilesdir}
+echo "%attr(0444,-,-) %{_tmpfilesdir}/%{name}.conf" >> rpm.filelist
+cat > $RPM_BUILD_ROOT%{_tmpfilesdir}/%{name}.conf <<EOF
 d /run/%{name} 755 %{runuser} %{runuser} -
 EOF
-%endif
 
 # Otherwise, establish location of sysconfig file, if any.
 SYSCONFIG_SHIBD="no"
 if [ "$SYSTEMD_SHIBD" == "no" ] ; then
-%if "%{_vendor}" == "redhat" || "%{_vendor}" == "amazon"
     %{__mkdir} -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
     echo "%config(noreplace) %{_sysconfdir}/sysconfig/shibd" >> rpm.filelist
     SYSCONFIG_SHIBD="$RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/shibd"
-%endif
 fi
 
 if [ "$SYSTEMD_SHIBD" != "no" ] ; then
@@ -224,12 +201,10 @@ fi
     chrpath -d $RPM_BUILD_ROOT%{_bindir}/resolvertest
 %endif
 
-%if "%{_vendor}" == "redhat" || "%{_vendor}" == "amazon"
 if [ "$SYSTEMD_SHIBD" == "no" ] ; then
     install -d -m 0755 $RPM_BUILD_ROOT%{_initddir}
     install -m 0755 $RPM_BUILD_ROOT%{_sysconfdir}/shibboleth/shibd-%{_vendor} $RPM_BUILD_ROOT%{_initddir}/shibd
 fi
-%endif
 
 %check
 %{__make} check
@@ -253,7 +228,6 @@ if [ $1 -eq 1 ] ; then
     /bin/sh ./keygen.sh -b -n sp-encrypt -u %{runuser} -g %{runuser}
 fi
 
-%if "%{_vendor}" == "redhat" || "%{_vendor}" == "amazon"
 if [ $1 -gt 1 ] ; then
         # On Red Hat with shib.conf installed, clean up old Alias commands
         # by pointing them at new version-independent /usr/share/share tree.
@@ -271,52 +245,30 @@ if [ $1 -gt 1 ] ; then
         fi
     fi
 
-%if 0%{?rhel} >= 7 || 0%{?amzn} >= 2
-    # Initial prep for systemd
-    %systemd_post shibd.service
-    if [ $1 -gt 1 ] ; then
-        systemctl daemon-reload
-    fi
-%else
-    # Add the proper /etc/rc*.d links for the script
-    /sbin/chkconfig --add shibd
-%endif
-%endif
+# Initial prep for systemd
+%systemd_post shibd.service
+if [ $1 -gt 1 ] ; then
+    systemctl daemon-reload
+fi
 
 %preun
 # On final removal, stop shibd and remove service, restart Apache if running.
-%if "%{_vendor}" == "redhat" || "%{_vendor}" == "amazon"
-%if 0%{?rhel} >= 7 || 0%{?amzn} >= 2
-    %systemd_preun shibd.service
-%else
-    if [ $1 -eq 0 ] ; then
-        /sbin/service shibd stop >/dev/null 2>&1
-        /sbin/chkconfig --del shibd
-    fi
-%endif
-    if [ $1 -eq 0 ] ; then
-        %{!?_without_builtinapache:/sbin/service httpd status 1>/dev/null && /sbin/service httpd restart 1>/dev/null}
-        exit 0
-    fi
-%endif
+%systemd_preun shibd.service
+
+if [ $1 -eq 0 ] ; then
+    %{!?_without_builtinapache:/sbin/service httpd status 1>/dev/null && /sbin/service httpd restart 1>/dev/null}
+    exit 0
+fi
 exit 0
 
 %postun
 /sbin/ldconfig
-%if "%{_vendor}" == "redhat" || "%{_vendor}" == "amazon"
 # On upgrade, restart components if they're already running.
-%if 0%{?rhel} >= 7 || 0%{?amzn} >= 2
-    %systemd_postun_with_restart shibd.service
-%else
-    if [ $1 -ge 1 ] ; then
-        /sbin/service shibd status 1>/dev/null && /sbin/service shibd restart 1>/dev/null
-    fi
-%endif
-    if [ $1 -ge 1 ] ; then
-        %{!?_without_builtinapache:/sbin/service httpd status 1>/dev/null && /sbin/service httpd restart 1>/dev/null}
-        exit 0
-    fi
-%endif
+%systemd_postun_with_restart shibd.service
+if [ $1 -ge 1 ] ; then
+    %{!?_without_builtinapache:/sbin/service httpd status 1>/dev/null && /sbin/service httpd restart 1>/dev/null}
+    exit 0
+fi
 
 %posttrans
 exit 0
@@ -349,18 +301,7 @@ exit 0
 %config(noreplace) %{_sysconfdir}/shibboleth/security-policy.xml
 %config(noreplace) %{_sysconfdir}/shibboleth/*.html
 %config(noreplace) %{_sysconfdir}/shibboleth/*.logger
-%if "%{_vendor}" == "redhat"
-%if 0%{?rhel} >= 7
-%else
-%config %{_initddir}/shibd
-%endif
-%endif
-%if "%{_vendor}" == "amazon" && 0%{?amzn} == 2
-%config %{_initddir}/shibd
-%endif
-%if 0%{?rhel} >= 7 || 0%{?amzn2023}
 %{_tmpfilesdir}/%{name}.conf
-%endif
 %{_sysconfdir}/shibboleth/example-shibboleth2.xml
 %{_sysconfdir}/shibboleth/*.dist
 %{_sysconfdir}/shibboleth/apache*.config

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list