diff options
-rw-r--r-- | fix-libtool-from-moving-options-after-libs | 15 | ||||
-rw-r--r-- | infopages.attr | 4 | ||||
-rw-r--r-- | macros | 8 | ||||
-rw-r--r-- | manpages.attr | 4 | ||||
-rw-r--r-- | openEuler-rpm-config.spec | 17 |
5 files changed, 42 insertions, 6 deletions
diff --git a/fix-libtool-from-moving-options-after-libs b/fix-libtool-from-moving-options-after-libs new file mode 100644 index 0000000..134a2e3 --- /dev/null +++ b/fix-libtool-from-moving-options-after-libs @@ -0,0 +1,15 @@ +#!/usr/bin/sh + +CONFIGURE_TOP="${1:-.}" +if [ -e $CONFIGURE_TOP/configure ] && grep -q -F '$deplibs $compiler_flags' $CONFIGURE_TOP/configure; then + echo "Fixing libtool inside configure to pass -Wl,xxx options before libraries" + + # a similar patch has been applied in libtool in libtool package (#47273) + # but this works even if autoreconf is not called + + sed -i \ + -e 's,$deplibs $compiler_flags,$compiler_flags $deplibs,' \ + -e 's,$deplibs $postdep_objects $compiler_flags,$compiler_flags $deplibs $postdep_objects,' \ + $CONFIGURE_TOP/configure +fi + diff --git a/infopages.attr b/infopages.attr new file mode 100644 index 0000000..805c570 --- /dev/null +++ b/infopages.attr @@ -0,0 +1,4 @@ +%__infopages_requires() %{lua: + print(string.format("/usr/bin/info", rpm.expand("%1"))) +} +%__infopages_path ^%{_infodir}/.* @@ -172,9 +172,12 @@ diff -u $file.backup $file && mv $file.backup $file \ done +%__fix_libtool_from_moving_options_after_libs /usr/lib/rpm/fix-libtool-from-moving-options-after-libs $(dirname %{_configure}) + %configure \ %{set_build_flags}; \ [ "%{_lto_cflags}"x != x ] && %{_fix_broken_configure_for_lto}; \ + [ "%{_ld_as_needed_flags}"x !=x ] && %{__fix_libtool_from_moving_options_after_libs} ; \ [ "%_configure_gnuconfig_hack" = 1 ] && for i in $(find $(dirname %{_configure}) -name config.guess -o -name config.sub) ; do \ [ -f /usr/lib/rpm/%{_vendor}/$(basename $i) ] && %{__rm} -f $i && %{__cp} -fv /usr/lib/rpm/%{_vendor}/$(basename $i) $i ; \ done ; \ @@ -422,8 +425,8 @@ sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool %delete_la_and_a \ -find $RPM_BUILD_ROOT -type f -name "*.la" -delete \ -find $RPM_BUILD_ROOT -type f -name "*.a" -delete +find "$RPM_BUILD_ROOT" -type f,l -name '*.la' 2>/dev/null -print0 | xargs -0 grep --fixed-strings '.la - a libtool library file' --files-with-matches --null | xargs -0 rm --force \ +find "$RPM_BUILD_ROOT" -type f,l -name "*.a" -delete %delete_la %{nil} @@ -433,7 +436,6 @@ find $RPM_BUILD_ROOT -type f -name "*.a" -delete %package help \ Summary: Documents for %{name} \ Buildarch: noarch \ -Requires: man info \ \ %description help \ Man pages and other related documents for %{name}. diff --git a/manpages.attr b/manpages.attr new file mode 100644 index 0000000..6b4cbd7 --- /dev/null +++ b/manpages.attr @@ -0,0 +1,4 @@ +%__manpages_requires() %{lua: + print(string.format("/usr/bin/man", rpm.expand("%1"))) +} +%__manpages_path ^%{_mandir}/.* diff --git a/openEuler-rpm-config.spec b/openEuler-rpm-config.spec index d61dc6b..d6e2000 100644 --- a/openEuler-rpm-config.spec +++ b/openEuler-rpm-config.spec @@ -3,7 +3,7 @@ Name: %{vendor}-rpm-config Version: 31 -Release: 4 +Release: 5 License: GPL+ Summary: specific rpm configuration files URL: https://gitee.com/src-openeuler/openEuler-rpm-config @@ -33,10 +33,13 @@ Source104: macros.kmp # Dependency generator scripts Source200: find-requires.ksyms +Source201: infopages.attr +Source202: manpages.attr # Misc helper scripts Source300: kmodtool Source301: find-requires +Source303: fix-libtool-from-moving-options-after-libs # Snapshots from http://git.savannah.gnu.org/gitweb/?p=config.git Source500: config.guess @@ -134,6 +137,7 @@ install -p -m 644 -t %{buildroot}%{rpmvdir} macros rpmrc install -p -m 755 -t %{buildroot}%{rpmvdir} config.* install -p -m 755 -t %{buildroot}%{_rpmconfigdir} brp-* install -p -m 644 -t %{buildroot}%{_rpmconfigdir} generic-* +install -p -m 755 -t %{buildroot}%{_rpmconfigdir} fix-libtool-from-moving-options-after-libs install -p -m 755 -t %{buildroot}%{rpmvdir} kmodtool install -p -m 755 -t %{buildroot}%{rpmvdir} find-requires* @@ -141,6 +145,7 @@ mkdir -p %{buildroot}%{_rpmconfigdir}/macros.d install -p -m 644 -t %{buildroot}%{_rpmconfigdir}/macros.d/ macros.perl macros.python macros.go macros.forge macros.kmp mkdir -p %{buildroot}%{_fileattrsdir} +install -p -m 644 -t %{buildroot}%{_fileattrsdir} *.attr mkdir -p %{buildroot}%{_rpmluadir}/%{_vendor}/{rpm,srpm} install -p -m 644 -t %{buildroot}%{_rpmluadir}/%{_vendor} common.lua @@ -155,7 +160,8 @@ sed -i "s/@VENDOR@/%{vendor}/g" `grep "@VENDOR@" -rl %{buildroot}%{_rpmconfigdir %{_rpmconfigdir}/brp-* %{rpmvdir}/config.* %{_rpmconfigdir}/generic-* -%{_fileattrsdir}/ +%{_rpmconfigdir}/fix-libtool-from-moving-options-after-libs +%{_fileattrsdir}/*.attr %{_rpmconfigdir}/macros.d/ %{_rpmluadir}/%{_vendor}/*.lua %exclude %{_rpmconfigdir}/macros.d/macros.kmp @@ -167,6 +173,11 @@ sed -i "s/@VENDOR@/%{vendor}/g" `grep "@VENDOR@" -rl %{buildroot}%{_rpmconfigdir %{rpmvdir}/find-requires.ksyms %changelog +* Thu Sep 19 2024 Funda Wang <fundawang@yeah.net> - 31-5 +- Drop symlinks of .la and .a also +- move hardcode requires on man and info to file attrs +- add helper script for mageia to fix libtool linking order + * Fri Sep 06 2024 Funda Wang <fudnawang@yeah.net> - 31-4 - Enable LTO by default @@ -292,7 +303,7 @@ sed -i "s/@VENDOR@/%{vendor}/g" `grep "@VENDOR@" -rl %{buildroot}%{_rpmconfigdir - update the definition of python3_version * Wed Oct 13 2021 wangkerong <wangkerong@huawei.com> - 30-23 -- add common lua scripts resolve "%fontpkg" macro translation failure +- add common lua scripts resolve "%%fontpkg" macro translation failure * Sat Sep 4 2021 yangmingtai <yangmingtai@huawei.com> - 30-22 - add brp scripts to delete rpath |