From 31e0cea8d0d5656d956042658e9607ea533bba06 Mon Sep 17 00:00:00 2001 From: Yangyang Shen Date: Fri, 26 Mar 2021 16:59:38 +0800 Subject: [PATCH] Revert support for change vendor which is integrated on master and LTS Next --- openEuler-fix-brp-ldconfig.patch | 25 ------ ...replace-openEuler-with-_vendor-macro.patch | 77 ------------------- openEuler-rpm-config.spec | 49 +----------- 3 files changed, 4 insertions(+), 147 deletions(-) delete mode 100644 openEuler-fix-brp-ldconfig.patch delete mode 100644 openEuler-replace-openEuler-with-_vendor-macro.patch diff --git a/openEuler-fix-brp-ldconfig.patch b/openEuler-fix-brp-ldconfig.patch deleted file mode 100644 index 81763f2..0000000 --- a/openEuler-fix-brp-ldconfig.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 13fba7b02178c0196061965155c01061fce004fc Mon Sep 17 00:00:00 2001 -From: orange-snn -Date: Thu, 28 Jan 2021 16:35:20 +0800 -Subject: [PATCH] fix brp ldconfig - ---- - macros | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/macros b/macros -index 678136a..7ef0539 100644 ---- a/macros -+++ b/macros -@@ -89,7 +89,7 @@ - - # Build root policy macros. Standard naming: - # convert all '-' in basename to '_', add two leading underscores. --%__brp_ldconfig /usr/lib/rpm/%{_vendor}/brp-ldconfig -+%__brp_ldconfig /usr/lib/rpm/openEuler/brp-ldconfig - %__brp_compress /usr/lib/rpm/brp-compress - %__brp_strip /usr/lib/rpm/brp-strip %{__strip} - %__brp_strip_comment_note /usr/lib/rpm/brp-strip-comment-note %{__strip} %{__objdump} --- -2.27.0 - diff --git a/openEuler-replace-openEuler-with-_vendor-macro.patch b/openEuler-replace-openEuler-with-_vendor-macro.patch deleted file mode 100644 index 7b02ccb..0000000 --- a/openEuler-replace-openEuler-with-_vendor-macro.patch +++ /dev/null @@ -1,77 +0,0 @@ -From 9ddbf9dcb6de021ad796876282796dc409cdb268 Mon Sep 17 00:00:00 2001 -From: Yangyang Shen -Date: Thu, 7 Jan 2021 21:19:58 +0800 -Subject: [PATCH] replace openEuler with %{_vendor} macro - ---- - macros | 14 +++++++------- - macros.kmp | 2 +- - 2 files changed, 8 insertions(+), 8 deletions(-) - -diff --git a/macros b/macros -index b06faea..678136a 100644 ---- a/macros -+++ b/macros -@@ -52,7 +52,7 @@ - %configure \ - %{set_build_flags}; \ - [ "%_configure_gnuconfig_hack" = 1 ] && for i in $(find $(dirname %{_configure}) -name config.guess -o -name config.sub) ; do \ -- [ -f /usr/lib/rpm/openEuler/$(basename $i) ] && %{__rm} -f $i && %{__cp} -fv /usr/lib/rpm/openEuler/$(basename $i) $i ; \ -+ [ -f /usr/lib/rpm/%{_vendor}/$(basename $i) ] && %{__rm} -f $i && %{__cp} -fv /usr/lib/rpm/%{_vendor}/$(basename $i) $i ; \ - done ; \ - [ "%_configure_libtool_hardening_hack" = 1 ] && [ x != "x%{_hardened_ldflags}" ] && \ - for i in $(find . -name ltmain.sh) ; do \ -@@ -89,7 +89,7 @@ - - # Build root policy macros. Standard naming: - # convert all '-' in basename to '_', add two leading underscores. --%__brp_ldconfig /usr/lib/rpm/openEuler/brp-ldconfig -+%__brp_ldconfig /usr/lib/rpm/%{_vendor}/brp-ldconfig - %__brp_compress /usr/lib/rpm/brp-compress - %__brp_strip /usr/lib/rpm/brp-strip %{__strip} - %__brp_strip_comment_note /usr/lib/rpm/brp-strip-comment-note %{__strip} %{__objdump} -@@ -144,8 +144,8 @@ - # secure options for rpmbuild - # - # #hardened options --%_hardening_cflags -specs=/usr/lib/rpm/%{_vendor}/openEuler-hardened-cc1 --%_hardening_ldflags -Wl,-z,now -specs=/usr/lib/rpm/%{_vendor}/openEuler-hardened-ld -+%_hardening_cflags -specs=/usr/lib/rpm/%{_vendor}/%{_vendor}-hardened-cc1 -+%_hardening_ldflags -Wl,-z,now -specs=/usr/lib/rpm/%{_vendor}/%{_vendor}-hardened-ld - # Use "%undefine _hardened_build" to disable. - %_hardened_build 1 - %_hardened_cflags %{?_hardened_build:%{_hardening_cflags}} -@@ -156,14 +156,14 @@ - #Use "%undefine _sec_opt_build" to disable. - #Use "%undefine _pie_build" to disable. - %_pie_build 1 --%_pie_pre_cflags -specs=/usr/lib/rpm/%{_vendor}/openEuler-pie-cc1 --%_pie_pre_ldflags -Wl,-z,now -specs=/usr/lib/rpm/%{_vendor}/openEuler-pie-ld -+%_pie_pre_cflags -specs=/usr/lib/rpm/%{_vendor}/%{_vendor}-pie-cc1 -+%_pie_pre_ldflags -Wl,-z,now -specs=/usr/lib/rpm/%{_vendor}/%{_vendor}-pie-ld - %_pie_cflags %{?_sec_opt_build:?_pie_build:%{_pie_pre_cflags}} - %_pie_ldflags %{?_sec_opt_build:?_pie_build:%{_pie_pre_ldflags}} - - #Use "%undefine _fs_build" to disable. - %_fs_build 1 --%_fs_pre_cflags -specs=/usr/lib/rpm/%{_vendor}/openEuler-fs-cc1 -+%_fs_pre_cflags -specs=/usr/lib/rpm/%{_vendor}/%{_vendor}-fs-cc1 - %_fs_cflags %{?_fs_build:%{_fs_pre_cflags}} - - -diff --git a/macros.kmp b/macros.kmp -index be66e64..2bf977c 100644 ---- a/macros.kmp -+++ b/macros.kmp -@@ -12,7 +12,7 @@ kernel_module_package_release 1 - kernel-devel - - %kernel_module_package(n:v:r:f:) %{expand:%( \ -- %define kmodtool /usr/lib/rpm/openEuler/kmodtool.py\ -+ %define kmodtool /usr/lib/rpm/%{_vendor}/kmodtool.py\ - %define latest_kernel $(rpm -q --qf '%{VERSION}-%{RELEASE}\\\\n' `rpm -q kernel-devel` | head -n 1) \ - %{!?kernel_version:%{expand:%%global kernel_version %{latest_kernel}}} \ - %global kverrel %(%{kmodtool} verrel %{?kernel_version} 2>/dev/null) \ --- -2.23.0 - diff --git a/openEuler-rpm-config.spec b/openEuler-rpm-config.spec index 9d37a70..c5bb32c 100644 --- a/openEuler-rpm-config.spec +++ b/openEuler-rpm-config.spec @@ -1,15 +1,9 @@ %global vendor %{?_vendor:%{_vendor}}%{!?_vendor:openEuler} %global rpmvdir /usr/lib/rpm/%{vendor} -# the _change_vendor macro should be defined in the project config of obs -# or just in this spec if you want to change openEuler to other vendor. -# If the _change_vendor is 1, it means that it is the first building round for all. -# rpm packages, so we need both openEuler and the vendor as an transistion. -# And the others value of _change_vendor indicates that we don't need openEuler anymore. -%global change_vendor %{?_change_vendor:%{_change_vendor}}%{!?_change_vendor:0} Name: %{vendor}-rpm-config Version: 30 -Release: 16 +Release: 17 License: GPL+ Summary: specific rpm configuration files URL: https://gitee.com/openeuler/openEuler-rpm-config @@ -19,10 +13,6 @@ Source0: https://gitee.com/openeuler/openEuler-rpm-config/repository/arch Patch0: fix-error-message-for-kmodtool.patch Patch2: Fix-a-typo-in-brp-digest-list.patch -Patch9000: openEuler-replace-openEuler-with-_vendor-macro.patch -%if %{vendor} != openEuler && %{change_vendor} == 1 -Patch9001: openEuler-fix-brp-ldconfig.patch -%endif Patch9002: openEuler-remove-fexceptions.patch Provides: python-rpm-macros = %{?epoch:%{epoch}:}%{version}-%{release} @@ -54,11 +44,6 @@ Obsoletes: perl-srpm-macros <= 1-28 Obsoletes: rust-srpm-macros <= 10-1 Obsoletes: go-srpm-macros <= 2-18 -%if %{vendor} != openEuler -Provides: openEuler-rpm-config = %{?epoch:%{epoch}:}%{version}-%{release} -Obsoletes: openEuler-rpm-config <= %{?epoch:%{epoch}:}%{version}-%{release} -%endif - Requires: efi-srpm-macros Requires: qt5-srpm-macros @@ -103,38 +88,12 @@ install -p -m 644 -t %{buildroot}%{_rpmconfigdir}/macros.d/ macros.perl macros.p mkdir -p %{buildroot}%{_fileattrsdir} -%if %{vendor} != openEuler -pushd %{buildroot}%{rpmvdir} -mv openEuler-hardened-cc1 %{vendor}-hardened-cc1 -mv openEuler-hardened-ld %{vendor}-hardened-ld -mv openEuler-pie-cc1 %{vendor}-pie-cc1 -mv openEuler-pie-ld %{vendor}-pie-ld -popd - -%if %{change_vendor} == 1 -pushd %{buildroot}%{rpmvdir}/../ -cp -a %{vendor} openEuler -popd - -pushd %{buildroot}/usr/lib/rpm/openEuler -mv %{vendor}-hardened-cc1 openEuler-hardened-cc1 -mv %{vendor}-hardened-ld openEuler-hardened-ld -mv %{vendor}-pie-cc1 openEuler-pie-cc1 -mv %{vendor}-pie-ld openEuler-pie-ld -popd -%endif -%endif - %files %dir %{rpmvdir} %{rpmvdir}/macros %{rpmvdir}/rpmrc %{rpmvdir}/brp-* %{rpmvdir}/config.* -%if %{vendor} != openEuler && %{change_vendor} == 1 -%exclude %{_prefix}/lib/rpm/openEuler/kmodtool.py -%{_prefix}/lib/rpm/openEuler/* -%endif %{rpmvdir}/%{vendor}-* %{_fileattrsdir}/ %{_rpmconfigdir}/macros.d/ @@ -143,12 +102,12 @@ popd %files -n kernel-rpm-macros %exclude %{_prefix}/lib/rpm/*/__pycache__/* %{rpmvdir}/kmodtool.py -%if %{vendor} != openEuler && %{change_vendor} == 1 -%{_prefix}/lib/rpm/openEuler/kmodtool.py -%endif %{_rpmconfigdir}/macros.d/macros.kmp %changelog +* Thu Mar 25 2021 shenyangyang - 30-17 +- Revert support for change vendor which is integrated on master and LTS Next + * Thu Mar 25 2021 shenyangyang - 30-16 - Change the wrong hardened coded vendor -- Gitee