diff --git a/0001-libreswan-anolis-rebrand-for-anolis.patch b/0001-libreswan-anolis-rebrand-for-anolis.patch new file mode 100644 index 0000000000000000000000000000000000000000..ff0b2d35878dcb62cc8acf4a7e63f4c6dea44fc1 --- /dev/null +++ b/0001-libreswan-anolis-rebrand-for-anolis.patch @@ -0,0 +1,76 @@ +From c13280614d11831980adf9fbfc2f2feecec3487f Mon Sep 17 00:00:00 2001 +From: yangxianzhao +Date: Fri, 15 Oct 2021 14:51:26 +0800 +Subject: [PATCH] rebrand for anolis + +--- + packaging/utils/lswan_detect.sh | 5 +++++ + programs/barf/barf.in | 2 +- + testing/guestbin/swan-transmogrify | 8 +++++--- + 3 files changed, 11 insertions(+), 4 deletions(-) + +diff --git a/packaging/utils/lswan_detect.sh b/packaging/utils/lswan_detect.sh +index 21a3d55..d13f563 100755 +--- a/packaging/utils/lswan_detect.sh ++++ b/packaging/utils/lswan_detect.sh +@@ -82,6 +82,11 @@ return_distro() { + echo "centos/${VER}" + return + fi ++ VER="$(grep Anolis /etc/anolis-release | awk '{ print $3;}')" ++ if [ -n "${VER}" ]; then ++ echo "anolis/${VER}" ++ return ++ fi + VER="$(grep 'Foobar Linux' /etc/redhat-release | awk '{print $4;}')" + if [ -n "${VER}" ]; then + echo "foobar/${VER}" +diff --git a/programs/barf/barf.in b/programs/barf/barf.in +index 4bdec24..7941c00 100755 +--- a/programs/barf/barf.in ++++ b/programs/barf/barf.in +@@ -292,7 +292,7 @@ then + cat /proc/config_built_with + fi + _________________________ distro-release +-for distro in /etc/redhat-release /etc/debian-release /etc/SuSE-release /etc/mandrake-release /etc/mandriva-release /etc/gentoo-release ++for distro in /etc/redhat-release /etc/anolis-release /etc/debian-release /etc/SuSE-release /etc/mandrake-release /etc/mandriva-release /etc/gentoo-release + do + if test -f $distro + then +diff --git a/testing/guestbin/swan-transmogrify b/testing/guestbin/swan-transmogrify +index ea7d971..dec88c7 100755 +--- a/testing/guestbin/swan-transmogrify ++++ b/testing/guestbin/swan-transmogrify +@@ -24,7 +24,9 @@ macs['sunset'] = "12:00:00:ab:cd:01" + # conflicts with north + #macs['japan'] = "12:00:00:ab:cd:02" + +-if os.path.isfile("/etc/redhat-release"): ++if os.path.isfile("/etc/anolis-release"): ++ GUESTOS = "anolis" ++elif os.path.isfile("/etc/redhat-release"): + GUESTOS = "redhat" + elif os.path.isfile("/etc/debian_version"): + GUESTOS = "debian" +@@ -114,7 +116,7 @@ output += "\n" + subprocess.getoutput("chmod 600 /etc/ssh/*key* /root/.ssh/*") + shutil.copyfile("/testing/baseconfigs/%s/etc/hostname" % + hostname, "/etc/hostname") + +-if GUESTOS == "redhat": ++if GUESTOS == "anolis": + shutil.copyfile("/testing/baseconfigs/%s/etc/sysconfig/network" % + hostname, "/etc/sysconfig/network") + fnames = glob.glob("/testing/baseconfigs/all/etc/sysconfig/*") +@@ -182,7 +184,7 @@ for dbfile in glob.glob("/etc/ipsec.d/*.db"): + os.chmod(dbfile, 0o600) + + # SElinux fixup +-if GUESTOS == "redhat": ++if GUESTOS == "anolis": + output += "\n" + subprocess.getoutput("restorecon -R /etc/") + + # selinux does not like our /testing include files +-- +1.8.3.1 + diff --git a/libreswan.spec b/libreswan.spec index fac1da0bc2dcffa87af623d809a0f9c672d79636..4a3b97fe0b4c0c6c28a907d13845d9fd3394cf8c 100644 --- a/libreswan.spec +++ b/libreswan.spec @@ -1,3 +1,4 @@ +%define anolis_release .0.1 # These are rpm macros and are 0 or 1 %global crl_fetching 1 %global _hardened_build 1 @@ -24,7 +25,7 @@ Name: libreswan Summary: IPsec implementation with IKEv1 and IKEv2 keying protocols Version: 3.25 -Release: %{?prever:0.}9.1%{?prever:.%{prever}}%{?dist} +Release: %{?prever:0.}9.1%{?prever:.%{prever}}%{anolis_release}%{?dist} License: GPLv2 Group: System Environment/Daemons Url: https://libreswan.org/ @@ -47,6 +48,10 @@ Patch11: libreswan-3.25-1686991-ikev1-del.patch Patch12: libreswan-3.25-1724200-halfopen-shunt.patch Patch13: libreswan-3.25-1844621-FIPS-RSA-ECDSA.patch +#Add by anolis +Patch100: 0001-libreswan-anolis-rebrand-for-anolis.patch +#End + Requires: iproute >= 2.6.8 Requires: nss-tools nss-softokn @@ -148,6 +153,7 @@ Libreswan is based on Openswan-2.6.38 which in turn is based on FreeS/WAN-2.04 %patch11 -p1 %patch12 -p1 %patch13 -p1 +%patch100 -p1 %build %if %{buildefence} @@ -351,6 +357,9 @@ fi %endif %changelog +* Fri Jul 01 2022 yangxianzhao - 3.25-9.1.0.1 +- Rebrand for anolis + * Tue Jun 16 2020 Paul Wouters - 3.25-9.1 - Resolves: rhbz#1844621 Backport FIPS keysize fixes from RHEL8