rpm: remove unnecessary brp-strip scripts (#5693)

* optimize brp-strip scripts in os_install_post

* fix manifests

* fix macros again

* do not strip .la files

* remove brp-elfperms

* add version constraint
This commit is contained in:
Andrew Phelps 2023-06-26 13:37:32 -07:00 committed by GitHub
parent 9225690e15
commit c4c9b17465
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 59 additions and 90 deletions

View File

@ -69,19 +69,26 @@
%_use_internal_dependency_generator 1
%_build_id_links alldebug
# Standard brp-macro naming:
# convert all '-' in basename to '_', add two leading underscores.
%__brp_compress %{_rpmconfigdir}/brp-compress %{?_prefix}
%__brp_strip %{_rpmconfigdir}/brp-strip %{__strip}
%__brp_strip_comment_note %{_rpmconfigdir}/brp-strip-comment-note %{__strip} %{__objdump}
%__brp_strip_static_archive %{_rpmconfigdir}/brp-strip-static-archive %{__strip}
%__brp_elfperms %{_rpmconfigdir}/brp-elfperms
%__brp_remove_la_files %{_rpmconfigdir}/brp-remove-la-files
%__os_install_post_leave_signatures \
%{_rpmconfigdir}/brp-compress \
%{_rpmconfigdir}/brp-strip-comment-note %{__strip} %{__objdump} \
%{_rpmconfigdir}/brp-strip-static-archive %{__strip} \
%{?__brp_compress} \
%{?__brp_strip_comment_note} \
%{?__brp_strip_static_archive} \
%{?py_auto_byte_compile:%{?__brp_python_bytecompile}} \
find %{buildroot} -name "*.pc" | xargs -I{} sed -i -e 's@-Wl,-dT,%{_topdir}/BUILD/module_info.ld@ @' {} \
%{nil}
%__os_install_post \
%{__os_install_post_leave_signatures} \
%{_rpmconfigdir}/brp-strip %{__strip} \
%{_rpmconfigdir}/brp-strip-debug-symbols %{__strip} \
%{_rpmconfigdir}/brp-strip-unneeded %{__strip} \
%{?__brp_strip} \
%{?mariner_ccache_enabled:CCACHE_DIR="/ccache-dir" ; export CCACHE_DIR ;} \
%{?mariner_ccache_enabled:ccache --show-stats} \
%{nil}

View File

@ -10,7 +10,7 @@
"gen-ld-script.sh": "894b394f376dae7be23c314b79f31772aa40a24895122242abd7a178aea9cade",
"generate-package-note.py": "bd76a8e88a1356fed74863c38e5cf6a20c1c26426ac94ba21dd172578e8ca2a2",
"gpgverify": "db0e050f56b694497d70603a6f5c17dd60ddbcf7cee670616851cd389f6767c4",
"macros": "63dcf33711049cc05aa75cf624d5585ee60db8148df63b951a9e3f18e9475f87",
"macros": "c75199f0551d7dbd02db62159d95c0388db43c12d94e0d311921c1984d933516",
"macros.check": "79367176c3c7d10c0158b6e5d881e0fc3c8fd50c5957dad2f097c2d4a37833e7",
"macros.dist": "817653f151349adff8c658143cf01ad1f8b51168be2087e4e02778224da85d63",
"macros.fonts": "f52edc646414c5dd0f5f4cdd570f2f9dbe6fb97d4f0db360908deb56d96492f8",

View File

@ -6,7 +6,7 @@
Summary: Mariner specific rpm macro files
Name: mariner-rpm-macros
Version: 2.0
Release: 21%{?dist}
Release: 22%{?dist}
License: GPL+ AND MIT
Vendor: Microsoft Corporation
Distribution: Mariner
@ -125,6 +125,9 @@ install -p -m 644 -t %{buildroot}%{rcluadir}/srpm forge.lua
%{_rpmconfigdir}/macros.d/macros.check
%changelog
* Thu Jun 15 2023 Andrew Phelps <anphel@microsoft.com> - 2.0-22
- Optimize __os_install_post
* Tue May 09 2023 Andy Zaugg <azaugg@linkedin.com> - 2.0-21
- Set __python macro to python3 interpreter

View File

@ -1,19 +0,0 @@
#!/bin/sh
# If using normal root, avoid changing anything.
if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then
exit 0
fi
STRIP=${1:-strip}
case `uname -a` in
Darwin*) exit 0 ;;
*) ;;
esac
# Strip ELF binaries
for f in `find "$RPM_BUILD_ROOT" -type f -exec file {} \; | \
grep -v "^${RPM_BUILD_ROOT}/\?usr/lib/debug" | \
sed -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'`; do
$STRIP --strip-debug -g "$f" || :
done

View File

@ -1,19 +0,0 @@
#!/bin/sh
# If using normal root, avoid changing anything.
if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then
exit 0
fi
STRIP=${1:-strip}
case `uname -a` in
Darwin*) exit 0 ;;
*) ;;
esac
# Strip ELF binaries
for f in `find "$RPM_BUILD_ROOT" -type f -exec file {} \; | \
grep -v "^${RPM_BUILD_ROOT}/\?usr/lib/debug" | \
sed -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'`; do
$STRIP --strip-unneeded -g "$f" || :
done

View File

@ -1,7 +1,5 @@
{
"Signatures": {
"brp-strip-debug-symbols": "6cd7e01cd3ab55de6a04bd61a2a4f787bbddbfe575d85ec282f8d76563fa1cd4",
"brp-strip-unneeded": "b7d2323c52322b5f0144fd9de3ca86e4ea8ec24a262c0382490a9ea434dda3bf",
"python.attr": "32eebee98c24edcc9524b4553cf05c0ec6707828fe14f76d250e294568e7091a",
"pythondeps.sh": "1cc7665252eb845c7e4741ff3e832c78f54ffb05552f1cdb2d43d2c0cbf7c07d",
"pythondistdeps.py": "f73f01bb78daa75d25d6581a6da40cf6f946654c5e9d166676036367307186d1",

View File

@ -1,15 +1,13 @@
Summary: Package manager
Name: rpm
Version: 4.18.0
Release: 2%{?dist}
Release: 3%{?dist}
License: GPLv2+ AND LGPLv2+ AND BSD
Vendor: Microsoft Corporation
Distribution: Mariner
Group: Applications/System
URL: https://rpm.org
Source0: http://ftp.rpm.org/releases/%{name}-%(echo %{version} | cut -d'.' -f1-2).x/%{name}-%{version}.tar.bz2
Source1: brp-strip-debug-symbols
Source2: brp-strip-unneeded
# The license for the files below is the same as for RPM as they have originally came from rpm.
# The git repo is hosted by centos. The version below is centos 8 stable.
Source3: https://git.centos.org/rpms/python-rpm-generators/raw/c8s/f/SOURCES/python.attr
@ -86,7 +84,7 @@ Requires: elfutils-libelf
Requires: file
Requires: gzip
Requires: lua
Requires: mariner-rpm-macros
Requires: mariner-rpm-macros >= 2.0-22
Requires: patch
Requires: sed
Requires: tar
@ -175,8 +173,6 @@ find %{buildroot} -name 'perl*' -delete
%find_lang %{name}
# System macros and prefix
install -dm 755 %{buildroot}%{_sysconfdir}/rpm
install -vm755 %{SOURCE1} %{buildroot}%{_libdir}/rpm/
install -vm755 %{SOURCE2} %{buildroot}%{_libdir}/rpm/
install -vm644 %{SOURCE3} %{buildroot}%{_fileattrsdir}/
install -vm755 %{SOURCE4} %{buildroot}%{_libdir}/rpm/
install -vm755 %{SOURCE5} %{buildroot}%{_libdir}/rpm/
@ -285,6 +281,9 @@ popd
%{python3_sitelib}/*
%changelog
* Thu Jun 15 2023 Andrew Phelps <anphel@microsoft.com> - 4.18.0-3
- Remove brp-strip-debug-symbols and brp-strip-unneeded scripts
* Fri Sep 30 2022 Andy Caldwell <andycaldwell@microsoft> - 4.18.0-2
- Create versioned dependencies from `python3-rpm` -> `rpm-build-libs` -> `rpm-libs` to ensure ABI compatibility

View File

@ -175,12 +175,12 @@ libcap-devel-2.60-2.cm2.aarch64.rpm
debugedit-5.0-1.cm2.aarch64.rpm
libarchive-3.6.1-2.cm2.aarch64.rpm
libarchive-devel-3.6.1-2.cm2.aarch64.rpm
rpm-4.18.0-2.cm2.aarch64.rpm
rpm-build-4.18.0-2.cm2.aarch64.rpm
rpm-build-libs-4.18.0-2.cm2.aarch64.rpm
rpm-devel-4.18.0-2.cm2.aarch64.rpm
rpm-lang-4.18.0-2.cm2.aarch64.rpm
rpm-libs-4.18.0-2.cm2.aarch64.rpm
rpm-4.18.0-3.cm2.aarch64.rpm
rpm-build-4.18.0-3.cm2.aarch64.rpm
rpm-build-libs-4.18.0-3.cm2.aarch64.rpm
rpm-devel-4.18.0-3.cm2.aarch64.rpm
rpm-lang-4.18.0-3.cm2.aarch64.rpm
rpm-libs-4.18.0-3.cm2.aarch64.rpm
cpio-2.13-4.cm2.aarch64.rpm
cpio-lang-2.13-4.cm2.aarch64.rpm
e2fsprogs-libs-1.46.5-3.cm2.aarch64.rpm
@ -204,8 +204,8 @@ pcre-8.45-2.cm2.aarch64.rpm
pcre-libs-8.45-2.cm2.aarch64.rpm
lua-5.4.4-1.cm2.aarch64.rpm
lua-libs-5.4.4-1.cm2.aarch64.rpm
mariner-rpm-macros-2.0-21.cm2.noarch.rpm
mariner-check-macros-2.0-21.cm2.noarch.rpm
mariner-rpm-macros-2.0-22.cm2.noarch.rpm
mariner-check-macros-2.0-22.cm2.noarch.rpm
tdnf-3.5.2-2.cm2.aarch64.rpm
tdnf-cli-libs-3.5.2-2.cm2.aarch64.rpm
tdnf-devel-3.5.2-2.cm2.aarch64.rpm

View File

@ -175,12 +175,12 @@ libcap-devel-2.60-2.cm2.x86_64.rpm
debugedit-5.0-1.cm2.x86_64.rpm
libarchive-3.6.1-2.cm2.x86_64.rpm
libarchive-devel-3.6.1-2.cm2.x86_64.rpm
rpm-4.18.0-2.cm2.x86_64.rpm
rpm-build-4.18.0-2.cm2.x86_64.rpm
rpm-build-libs-4.18.0-2.cm2.x86_64.rpm
rpm-devel-4.18.0-2.cm2.x86_64.rpm
rpm-lang-4.18.0-2.cm2.x86_64.rpm
rpm-libs-4.18.0-2.cm2.x86_64.rpm
rpm-4.18.0-3.cm2.x86_64.rpm
rpm-build-4.18.0-3.cm2.x86_64.rpm
rpm-build-libs-4.18.0-3.cm2.x86_64.rpm
rpm-devel-4.18.0-3.cm2.x86_64.rpm
rpm-lang-4.18.0-3.cm2.x86_64.rpm
rpm-libs-4.18.0-3.cm2.x86_64.rpm
cpio-2.13-4.cm2.x86_64.rpm
cpio-lang-2.13-4.cm2.x86_64.rpm
e2fsprogs-libs-1.46.5-3.cm2.x86_64.rpm
@ -204,8 +204,8 @@ pcre-8.45-2.cm2.x86_64.rpm
pcre-libs-8.45-2.cm2.x86_64.rpm
lua-5.4.4-1.cm2.x86_64.rpm
lua-libs-5.4.4-1.cm2.x86_64.rpm
mariner-rpm-macros-2.0-21.cm2.noarch.rpm
mariner-check-macros-2.0-21.cm2.noarch.rpm
mariner-rpm-macros-2.0-22.cm2.noarch.rpm
mariner-check-macros-2.0-22.cm2.noarch.rpm
tdnf-3.5.2-2.cm2.x86_64.rpm
tdnf-cli-libs-3.5.2-2.cm2.x86_64.rpm
tdnf-devel-3.5.2-2.cm2.x86_64.rpm

View File

@ -228,7 +228,7 @@ m4-1.4.19-1.cm2.aarch64.rpm
m4-debuginfo-1.4.19-1.cm2.aarch64.rpm
make-4.3-2.cm2.aarch64.rpm
make-debuginfo-4.3-2.cm2.aarch64.rpm
mariner-check-macros-2.0-21.cm2.noarch.rpm
mariner-check-macros-2.0-22.cm2.noarch.rpm
mariner-repos-2.0-8.cm2.noarch.rpm
mariner-repos-debug-2.0-8.cm2.noarch.rpm
mariner-repos-debug-preview-2.0-8.cm2.noarch.rpm
@ -242,7 +242,7 @@ mariner-repos-microsoft-2.0-8.cm2.noarch.rpm
mariner-repos-microsoft-preview-2.0-8.cm2.noarch.rpm
mariner-repos-preview-2.0-8.cm2.noarch.rpm
mariner-repos-shared-2.0-8.cm2.noarch.rpm
mariner-rpm-macros-2.0-21.cm2.noarch.rpm
mariner-rpm-macros-2.0-22.cm2.noarch.rpm
meson-0.60.2-2.cm2.noarch.rpm
mpfr-4.1.0-1.cm2.aarch64.rpm
mpfr-debuginfo-4.1.0-1.cm2.aarch64.rpm
@ -525,20 +525,20 @@ python3-markupsafe-2.1.0-1.cm2.aarch64.rpm
python3-newt-0.52.21-4.cm2.aarch64.rpm
python3-pip-3.9.14-6.cm2.noarch.rpm
python3-pygments-2.4.2-7.cm2.noarch.rpm
python3-rpm-4.18.0-2.cm2.aarch64.rpm
python3-rpm-4.18.0-3.cm2.aarch64.rpm
python3-setuptools-3.9.14-6.cm2.noarch.rpm
python3-test-3.9.14-6.cm2.aarch64.rpm
python3-tools-3.9.14-6.cm2.aarch64.rpm
readline-8.1-1.cm2.aarch64.rpm
readline-debuginfo-8.1-1.cm2.aarch64.rpm
readline-devel-8.1-1.cm2.aarch64.rpm
rpm-4.18.0-2.cm2.aarch64.rpm
rpm-build-4.18.0-2.cm2.aarch64.rpm
rpm-build-libs-4.18.0-2.cm2.aarch64.rpm
rpm-debuginfo-4.18.0-2.cm2.aarch64.rpm
rpm-devel-4.18.0-2.cm2.aarch64.rpm
rpm-lang-4.18.0-2.cm2.aarch64.rpm
rpm-libs-4.18.0-2.cm2.aarch64.rpm
rpm-4.18.0-3.cm2.aarch64.rpm
rpm-build-4.18.0-3.cm2.aarch64.rpm
rpm-build-libs-4.18.0-3.cm2.aarch64.rpm
rpm-debuginfo-4.18.0-3.cm2.aarch64.rpm
rpm-devel-4.18.0-3.cm2.aarch64.rpm
rpm-lang-4.18.0-3.cm2.aarch64.rpm
rpm-libs-4.18.0-3.cm2.aarch64.rpm
sed-4.8-2.cm2.aarch64.rpm
sed-debuginfo-4.8-2.cm2.aarch64.rpm
sed-lang-4.8-2.cm2.aarch64.rpm

View File

@ -228,7 +228,7 @@ m4-1.4.19-1.cm2.x86_64.rpm
m4-debuginfo-1.4.19-1.cm2.x86_64.rpm
make-4.3-2.cm2.x86_64.rpm
make-debuginfo-4.3-2.cm2.x86_64.rpm
mariner-check-macros-2.0-21.cm2.noarch.rpm
mariner-check-macros-2.0-22.cm2.noarch.rpm
mariner-repos-2.0-8.cm2.noarch.rpm
mariner-repos-debug-2.0-8.cm2.noarch.rpm
mariner-repos-debug-preview-2.0-8.cm2.noarch.rpm
@ -242,7 +242,7 @@ mariner-repos-microsoft-2.0-8.cm2.noarch.rpm
mariner-repos-microsoft-preview-2.0-8.cm2.noarch.rpm
mariner-repos-preview-2.0-8.cm2.noarch.rpm
mariner-repos-shared-2.0-8.cm2.noarch.rpm
mariner-rpm-macros-2.0-21.cm2.noarch.rpm
mariner-rpm-macros-2.0-22.cm2.noarch.rpm
meson-0.60.2-2.cm2.noarch.rpm
mpfr-4.1.0-1.cm2.x86_64.rpm
mpfr-debuginfo-4.1.0-1.cm2.x86_64.rpm
@ -525,20 +525,20 @@ python3-markupsafe-2.1.0-1.cm2.x86_64.rpm
python3-newt-0.52.21-4.cm2.x86_64.rpm
python3-pip-3.9.14-6.cm2.noarch.rpm
python3-pygments-2.4.2-7.cm2.noarch.rpm
python3-rpm-4.18.0-2.cm2.x86_64.rpm
python3-rpm-4.18.0-3.cm2.x86_64.rpm
python3-setuptools-3.9.14-6.cm2.noarch.rpm
python3-test-3.9.14-6.cm2.x86_64.rpm
python3-tools-3.9.14-6.cm2.x86_64.rpm
readline-8.1-1.cm2.x86_64.rpm
readline-debuginfo-8.1-1.cm2.x86_64.rpm
readline-devel-8.1-1.cm2.x86_64.rpm
rpm-4.18.0-2.cm2.x86_64.rpm
rpm-build-4.18.0-2.cm2.x86_64.rpm
rpm-build-libs-4.18.0-2.cm2.x86_64.rpm
rpm-debuginfo-4.18.0-2.cm2.x86_64.rpm
rpm-devel-4.18.0-2.cm2.x86_64.rpm
rpm-lang-4.18.0-2.cm2.x86_64.rpm
rpm-libs-4.18.0-2.cm2.x86_64.rpm
rpm-4.18.0-3.cm2.x86_64.rpm
rpm-build-4.18.0-3.cm2.x86_64.rpm
rpm-build-libs-4.18.0-3.cm2.x86_64.rpm
rpm-debuginfo-4.18.0-3.cm2.x86_64.rpm
rpm-devel-4.18.0-3.cm2.x86_64.rpm
rpm-lang-4.18.0-3.cm2.x86_64.rpm
rpm-libs-4.18.0-3.cm2.x86_64.rpm
sed-4.8-2.cm2.x86_64.rpm
sed-debuginfo-4.8-2.cm2.x86_64.rpm
sed-lang-4.8-2.cm2.x86_64.rpm