diff --git a/find-provides.golang-vendor-bundled b/find-provides.golang-vendor-bundled new file mode 100644 index 0000000000000000000000000000000000000000..4fd14228bc005446e0219f8d2877a52897051588 --- /dev/null +++ b/find-provides.golang-vendor-bundled @@ -0,0 +1,33 @@ +#!/bin/bash +# Copyright (C) 2021 Jakub ńĆajka jcajka@redhat.com +# Modified by Funda Wang for golang bundled +# dependecy generator, 2025 +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +provides="" + +dir="${1:-.}" + +for bundle in $(find $dir -name modules.txt); do + provides="$provides\n$(cat "$bundle" | + grep "^# " | + grep -v "# explicit" | + sed -r s/"^#.* => "// | + sed -r "s/# //" | + sed -r "s:(.*) v(.*):bundled(golang(\1)) = \2:" | + sed '/= .*/s/-/./g')" + done +echo -e "$provides" | sed 's/-/./g' | sort -u diff --git a/golangvendorbundled.attr b/golangvendorbundled.attr new file mode 100644 index 0000000000000000000000000000000000000000..f93b22e588a44f778229ee9c021d88a17c0ed481 --- /dev/null +++ b/golangvendorbundled.attr @@ -0,0 +1,3 @@ +%__golangvendorbundled_provides %{_rpmconfigdir}/@VENDOR@/find-provides.golang-vendor-bundled %{_builddir}/%{buildsubdir} +%__golangvendorbundled_magic ^(setuid,? )?(setgid,? )?(sticky )?ELF (32|64)-bit.*$ +%__golangvendorbundled_exclude_path ^/lib/modules/.*\.ko?(\.[[:alnum:]]*)$ diff --git a/openEuler-rpm-config.spec b/openEuler-rpm-config.spec index 072000abe6f5360ff0b642451dcd4e996a1da97d..1ea4b235ca96a49cd9d3be79a07e4e20181d27ea 100644 --- a/openEuler-rpm-config.spec +++ b/openEuler-rpm-config.spec @@ -3,7 +3,7 @@ Name: %{vendor}-rpm-config Version: 31 -Release: 17 +Release: 18 License: GPL+ AND MIT Summary: specific rpm configuration files URL: https://gitee.com/src-openeuler/openEuler-rpm-config @@ -44,6 +44,14 @@ Source206: kabi.sh Source207: kmod.attr Source208: libsymlink.attr +# Produce "bundled(golang(MODULE_NAME)) = VERSION" provides if there are +# vendored sources inside source directory. +Source209: golangvendorbundled.attr +# Source 210 from fedora, licened under GPL-2.0-or-later +# https://src.fedoraproject.org/rpms/golang/blob/rawhide/f/bundled-deps.sh +# modified to be used as dependency generator +Source210: find-provides.golang-vendor-bundled + # Misc helper scripts Source300: kmodtool Source301: find-requires @@ -178,6 +186,7 @@ sed -i "s/@VENDOR@/%{vendor}/g" `grep "@VENDOR@" -rl %{buildroot}%{_rpmconfigdir %{_rpmconfigdir}/brp-* %{rpmvdir}/config.* %{rpmvdir}/find-provides.nbdkit +%{rpmvdir}/find-provides.golang-vendor-bundled %{_rpmconfigdir}/generic-* %{_rpmconfigdir}/fix-libtool-from-moving-options-after-libs %{_fileattrsdir}/*.attr @@ -195,6 +204,10 @@ sed -i "s/@VENDOR@/%{vendor}/g" `grep "@VENDOR@" -rl %{buildroot}%{_rpmconfigdir %{_fileattrsdir}/kmod.attr %changelog +* Thu Feb 20 2025 Funda Wang - 31-18 +- Produce "bundled(golang(MODULE_NAME)) = VERSION" provides if there are + vendored sources inside source directory + * Tue Feb 18 2025 Jun He - 31-17 - Add compile flag (-mbranch-protection=standard) to enable PAC/BTI features on aarch64 as default