diff --git a/brp-clean-perl-files b/brp-clean-perl-files new file mode 100644 index 0000000000000000000000000000000000000000..ca30d63967294ccc052b01ba05f3d40524e73db2 --- /dev/null +++ b/brp-clean-perl-files @@ -0,0 +1,31 @@ +#!/bin/sh + +if [ -z "$RPM_BUILD_ROOT" ]; then + printf '%s\n' "No build root defined" >&2 + exit 1 +fi + +if [ ! -d "$RPM_BUILD_ROOT" ]; then + printf '%s\n' "Invalid build root" >&2 + exit 1 +fi + +perldirs="$RPM_BUILD_ROOT/usr/lib/perl5 $RPM_BUILD_ROOT/usr/lib64/perl5 $RPM_BUILD_ROOT/usr/share/perl5" +d="" +for i in $perldirs; do + [ -d "$i" ] || continue + d="$d $i" +done +[ -z "$d" ] && exit 0 + +find $d -name ".packlist" -o -name perllocal.pod | xargs rm -f + +for i in $(find $d -name "*.bs"); do + if [ -s "$i" ]; then + printf '%s\n' "non empty .bs file!" + else + rm -f "$i" + fi +done + +find $d -depth -type d -exec rmdir {} 2>/dev/null \; diff --git a/macros b/macros index 1ee4a4d9d3079c74d3b2e684dc17abf2c4108b20..6ff7d6ac556fa98535162646bff273c5dfb8efc9 100644 --- a/macros +++ b/macros @@ -259,6 +259,7 @@ for k,_ in pairs(stripped_flags) do print(k .. " ") end %__brp_python_hardlink /usr/lib/rpm/brp-python-hardlink %__brp_remove_la_files /usr/lib/rpm/brp-remove-la-files %__brp_remove_info_dir /usr/lib/rpm/brp-remove-info-dir +%__brp_clean_perl_files /usr/lib/rpm/brp-clean-perl-files %__os_install_post \ %{?__brp_ldconfig} \ @@ -272,6 +273,7 @@ for k,_ in pairs(stripped_flags) do print(k .. " ") end %{?__brp_check_elf_files} \ %{?__brp_remove_la_files} \ %{?__brp_remove_info_dir} \ + %{?__brp_clean_perl_files} \ %{?py_auto_byte_compile:%{?__brp_python_bytecompile}} \ %{?__brp_python_hardlink} \ %{nil} diff --git a/openEuler-rpm-config.spec b/openEuler-rpm-config.spec index d044886b08460fbb2d7b11a44e805837626e0d73..b721b528305b98c1a0d68eb1fe0c20eeb143ec12 100644 --- a/openEuler-rpm-config.spec +++ b/openEuler-rpm-config.spec @@ -3,7 +3,7 @@ Name: %{vendor}-rpm-config Version: 31 -Release: 6 +Release: 7 License: GPL+ Summary: specific rpm configuration files URL: https://gitee.com/src-openeuler/openEuler-rpm-config @@ -55,6 +55,7 @@ Source703: brp-ldconfig Source704: brp-remove-info-dir Source705: brp-check-elf-files Source706: brp-strip-lto +Source707: brp-clean-perl-files # Convenience lua functions Source800: common.lua @@ -178,6 +179,10 @@ sed -i "s/@VENDOR@/%{vendor}/g" `grep "@VENDOR@" -rl %{buildroot}%{_rpmconfigdir %{rpmvdir}/find-requires.ksyms %changelog +* Sat Oct 26 2024 Funda Wang - 31-7 +- remove useless perl .packlist, empty .bs files and + wrongly created perllocal.pod from buildroot + * Sat Oct 19 2024 Funda Wang - 31-6 - add extension flags for python modules