]> TLD Linux GIT Repositories - packages/rpm-tld-macros.git/commitdiff
- PLD merge
authorMarcin Krol <hawk@tld-linux.org>
Sat, 27 Feb 2021 13:16:01 +0000 (14:16 +0100)
committerMarcin Krol <hawk@tld-linux.org>
Sat, 27 Feb 2021 13:16:01 +0000 (14:16 +0100)
gem_helper.rb
kmod-deps.sh [new file with mode: 0755]
macros.kernel
macros.ruby
macros.tld
pydebuginfo.patch [deleted file]
rpm-find-spec-bcond
rpm-tld-macros.spec
rpmrc

index 6457a7a4b4b33f014f39eb24e1be6d15440c6e36..3a82737be6709e0e29e647eb87bce0b095428e66 100755 (executable)
@@ -60,7 +60,7 @@ if ARGV[0] == "build" or ARGV[0] == "install" or ARGV[0] == "spec"
     opts.on("--fix-permissions", "Force standard permissions for files installed") do
       ARGV.delete("--fix-permissions")
       fixperms = true
-    end    
+    end
     opts.on("-i", "--install-dir GEMDIR", "Gem repository directory") do |val|
       gemdir = val
     end
diff --git a/kmod-deps.sh b/kmod-deps.sh
new file mode 100755 (executable)
index 0000000..a78598b
--- /dev/null
@@ -0,0 +1,61 @@
+#!/bin/sh
+
+# Kernel module dependency extractor.
+#
+# Author(s):   Danny Tholen <obiwan@mandriva.org>
+#              Olivier Blin <blino@mandriva.org>
+#              Per Øyvind Karlsen <peroyvind@mandriva.org>
+# 
+
+provides=0
+requires=0
+modinfo=/sbin/modinfo
+
+while [ "$#" -ne 0 ]; do
+    case $1 in
+       -P|--provides)
+           provides=1
+           ;;
+       -R|--requires)
+           requires=1
+           ;;
+       --modinfo)
+           shift
+           modinfo=$1
+           ;;
+    esac
+    shift
+done
+
+if [ $requires -eq 1 ]; then
+    echo "--requires not implemented!" 1>&2
+    exit 1
+fi
+
+if [ $provides -eq 1 ]; then
+    provideslist=`sed "s/['\"]/\\\&/g"`
+    modulelist=$(echo "$provideslist" | egrep '^.*(/lib/modules/|/var/lib/dkms/).*\.ko(\.gz|\.xz)?$')
+    echo $modulelist | xargs -r $modinfo | \
+       perl -lne '
+    $name = $1 if m!^filename:\s*(?:.*/)?([^/]+)\.k?o!;
+    $ver = $1 if /^version:\s*[a-zA-Z]{0,6}\-?(\d+[\.\:\-\[\]]?\d*[\.\:\-\[\]]?\d*[\.\:\-\[\]]?\d*[\.\:\-\[\]]?\d*-?[a-zA-Z]{0,6}\d?).*/;
+    $ver =~ s/(\:|-)/_/;
+    if (/^vermagic:/) {
+       print "kmod\($name\)" . ($ver ? " = $ver" : "") if $name;
+       undef $name; undef $ver;
+    }
+    '
+    dkmslist=$(echo "$provideslist" | egrep '(/var/lib/dkms-binary/[^/]+/[^/]+|/usr/src)/[^/]+/dkms.conf$')
+    [ -n "$dkmslist" ] && for d in $dkmslist; do
+       VERSION=`sed -rne 's/^PACKAGE_VERSION="?([^"]+)"?$/\1/;T;p' $d`
+       [ -z "$VERSION" ] && continue
+       PACKAGE_NAME=`sed -rne 's/^PACKAGE_NAME="?([^"]+)"?$/\1/;T;p' $d`
+       MODULES=`sed -rne 's/^DEST_MODULE_NAME\[[0-9]+\]="?([^"]+)"?$/\1/;T;p' $d`
+       [ -z "$MODULES" ] && MODULES=`sed -rne 's/^BUILT_MODULE_NAME\[[0-9]+\]="?([^"]+)"?$/\1/;T;p' $d`
+       # default on PACKAGE_NAME if no BUILT_MODULE_NAME is specified
+       [ -z "$MODULES" ] && MODULES=$PACKAGE_NAME
+       echo "$MODULES" | sed -re "s/\\\$PACKAGE_NAME/$PACKAGE_NAME/" | while read m; do
+           echo "kmod($m) = $VERSION"
+       done
+    done
+fi
index 12f2f4cf03e4b146971bb3e64c5a4fe799b3c0da..40cb813e12ed928c2f3a73f0350ed417e5b7e24b 100644 (file)
@@ -83,7 +83,7 @@ done)
 
 %_kernel_version_code   %( \\
        Z=$(awk '/LINUX_VERSION_CODE/{print $3}' %{_kernelsrcdir}/include/linux/version.h 2>/dev/null); \\
-       echo ${Z:-ERROR}; \\
+       echo ${Z:-16777215}; \\
 )
 
 %_kernel_version_magic()        %(echo $((%{1} * 65536 + %{2} * 256 + %{3})))
@@ -164,6 +164,15 @@ done)
        ARCH=%{_target_base_arch} CROSS_COMPILE=%{_target_cpu}-pld-linux- \\\
        %endif                                                                                                                  \\\
 %else                                                                                                                          \\\
+       %ifarch aarch64                                                                                                 \\\
+       ARCH=arm64                                                                                                              \\\
+       %endif                                                                                                                  \\\
+       %ifarch ppc ppc64                                                                                               \\\
+       ARCH=powerpc                                                                                                    \\\
+       %endif                                                                                                                  \\\
+       %ifnarch aarch64 ppc ppc64                                                                              \\\
+       ARCH=%{_target_base_arch}                                                                               \\\
+       %endif                                                                                                                  \\\
        CC="%{__cc}"                                                                                                    \\\
 %endif                                                                                                                         \
 %define        MakeOpts HOSTCC="%{__cc}" SYSSRC=%{_kernelsrcdir} SYSOUT=$PWD/o \\\\\\\
index becda2439db2c17c2ff4226f734684a4400466f4..c6133e919fcbadd8eb600f6ba377f5510be90f86 100644 (file)
@@ -2,18 +2,21 @@
 
 %__ruby                        /usr/bin/ruby
 
+# helpers to get rbconfig parameter
+%__ruby_rbconfig()     %(%{__ruby} -r rbconfig -e 'print RbConfig::CONFIG["%1"]' 2>/dev/null || echo ERROR)
+%__ruby_rbconfig_path()        %(%{__ruby} -r rbconfig -r pathname -e 'print Pathname(RbConfig::CONFIG["%1"]).cleanpath' 2>/dev/null || echo ERROR)
+
 # Ruby ABI version
 # NOTE: %ruby_version may be empty, depending how Ruby was built
 %ruby_abi              %{expand:%%global ruby_abi %(%{__ruby} -r rbconfig -e 'print [RbConfig::CONFIG["MAJOR"], RbConfig::CONFIG["MINOR"]].join(".")' 2>/dev/null || echo ERROR)}%ruby_abi
-
-# get rbconfig parameter
-%__ruby_rbconfig()     %(%{__ruby} -r rbconfig -e 'print RbConfig::CONFIG["%1"]' 2>/dev/null || echo ERROR)
-%__ruby_rbconfig_path()        %(%{__ruby} -r rbconfig -r pathname -e 'print Pathname(RbConfig::CONFIG["%1"]).cleanpath' 2>/dev/null || echo ERROR)
+# Ruby arch combo (CPU-OS, e.g. i686-linux)
+%ruby_arch             %{expand:%%global ruby_arch %{__ruby_rbconfig arch}}%ruby_arch
 
 %ruby_archdir          %{expand:%%global ruby_archdir %{__ruby_rbconfig_path archdir}}%ruby_archdir
 %ruby_libdir           %{expand:%%global ruby_libdir %{__ruby_rbconfig rubylibdir}}%ruby_libdir
 %ruby_ridir            %{expand:%%global ruby_ridir %(%{__ruby} -r rbconfig -e 'print File.join(RbConfig::CONFIG["datadir"], "ri", "system")' 2>/dev/null || echo ERROR)}%ruby_ridir
 %ruby_rubylibdir       %{expand:%%global ruby_rubylibdir %{__ruby_rbconfig_path rubylibdir}}%ruby_rubylibdir
+%ruby_rubyhdrdir       %{expand:%%global ruby_rubyhdrdir %{__ruby_rbconfig_path rubyhdrdir}}%ruby_rubyhdrdir
 %ruby_vendorarchdir    %{expand:%%global ruby_vendorarchdir %{__ruby_rbconfig vendorarchdir}}%ruby_vendorarchdir
 %ruby_vendorlibdir     %{expand:%%global ruby_vendorlibdir %{__ruby_rbconfig_path vendorlibdir}}%ruby_vendorlibdir
 %ruby_sitearchdir      %{expand:%%global ruby_sitearchdir %{__ruby_rbconfig sitearchdir}}%ruby_sitearchdir
index 9f6bcbd3dc88ae0b783f91266a6f31d546faa9f6..27995dd5f4e8d41e885ce3e8a67bd17274a42eb5 100644 (file)
@@ -461,7 +461,7 @@ pakietu oraz przy odpluskwianiu samego pakietu.\
 %{?__cxx:CXX="${CXX:-%{__cxx}}"} \\\
 CPPFLAGS="${CPPFLAGS:-%{rpmcppflags}}" \\\
 %{__cmake} \\\
-       -DCMAKE_VERBOSE_MAKEFILE=BOOL:ON \\\
+       -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \\\
        -DCMAKE_BUILD_TYPE=%{!?debug:TLD}%{?debug:Debug} \\\
        -DCMAKE_INSTALL_BINDIR:PATH=%{_bindir} \\\
        -DCMAKE_INSTALL_SBINDIR:PATH=%{_sbindir} \\\
@@ -648,6 +648,8 @@ LC_ALL=C.UTF-8 %{__meson} \
 %%prep\
 %{nil}
 
+%_build_id_links       %{expand:%%define __dic_%{?_enable_debug_packages} 1}%{?__dic_1:compat}%{?__dic_0:none}%{expand:%%undefine __dic_%{?_enable_debug_packages}}
+
 # If non-empty "debug" macro defined, add "dbg" suffix to release number
 %_rpmfilename          %%{NAME}-%%{VERSION}-%%{RELEASE}%{?debug:dbg}.%%{ARCH}.rpm
 
@@ -1119,7 +1121,6 @@ fi; \
 #
 %__noautoreqfiles      %(sed -e s'/#.*//' /etc/rpm/noautoreqfiles)%{?_noautoreqfiles: %{_noautoreqfiles}}
 %__noautoprovfiles     %(sed -e s'/#.*//' /etc/rpm/noautoprovfiles)%{?_noautoprovfiles: %{_noautoprovfiles}}
-%__noautoreqdep                %(sed -e s'/#.*//' /etc/rpm/noautoreqdep)%{?_noautoreqdep: %{_noautoreqdep}}
 %__noautoprov          %(sed -e s'/#.*//' /etc/rpm/noautoprov) \
        %{?_noautoprov: %{_noautoprov}} \
        %{?_noautoprov_java: %{__noauto_regexp_helper -p java %{_noautoprov_java}}} \
@@ -1131,6 +1132,7 @@ fi; \
        %{nil}
 %__noautoreq           %(sed -e s'/#.*//' /etc/rpm/noautoreq) \
        %{?_noautoreq: %{_noautoreq}} \
+       %{?_noautoreqdep: %{_noautoreqdep}} \
        %{?_noautoreq_java: %{__noauto_regexp_helper -p java %{_noautoreq_java}}} \
        %{?_noautoreq_mono: %{__noauto_regexp_helper -p mono %{_noautoreq_mono}}} \
        %{?_noautoreq_pear: %{__noauto_regexp_helper -p pear %{_noautoreq_pear}}} \
@@ -1139,6 +1141,27 @@ fi; \
        %{?_noautoreq_py3egg: %{__noauto_regexp_helper -p python3egg %{_noautoreq_py3egg}}} \
        %{nil}
 
+%__noautodep_helper() %(awk -v x="%*" 'BEGIN {
+       RS = "\n([ \t]+\n)+";
+       FS = " ";
+       split(x, F);
+       if (length(F) > 0) {
+               printf("(");
+               for (i=1; i<=length(F); i++) {
+                       s = F[i];
+                       sub(/#.*/, "z&z", s);
+                       if (s ~ /^$/) { continue; };
+                       printf(s);
+                       if (i != length(F)) { printf("|"); };
+               };
+               printf(")");
+       }
+}')
+%__requires_exclude_from       %{__noautodep_helper %{__noautoreqfiles}}%{nil}
+%__provides_exclude_from       %{__noautodep_helper %{__noautoprovfiles}}%{nil}
+%__requires_exclude                    %{__noautodep_helper %{__noautoreq}}%{nil}
+%__provides_exclude                    %{__noautodep_helper %{__noautoprov}}%{nil}
+
 # helper for wrapping _noautoreq between perl() or pear()
 # Author: Elan Ruusamäe <glen@pld-linux.org>
 # Usage:
diff --git a/pydebuginfo.patch b/pydebuginfo.patch
deleted file mode 100644 (file)
index 644e08a..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
---- ./rpm.macros~      2008-08-12 20:54:19.000000000 +0300
-+++ ./rpm.macros       2008-08-18 22:58:42.471609996 +0300
-@@ -764,9 +764,14 @@
- # remove python sources, so that check-files won't complain
- # (idea by glen <at> pld-linux <dot> org)
- %py_postclean() \
-+%{expand:%%define __sip_%{?_enable_debug_packages} 1} \
-+%{?__sip_1:> debugfiles-add.list;}\
- for d in %{py_sitescriptdir} %{py_sitedir} %*; do \
-- [ ! -d "$RPM_BUILD_ROOT$d" ] || find "$RPM_BUILD_ROOT$d" -name '*.py' -print0 | xargs -0r -l512 rm;\
-+      [ ! -d "$RPM_BUILD_ROOT$d" ] || find "$RPM_BUILD_ROOT$d" -name '*.py' \\\
-+      %{?__sip_1:>> debugfiles-add.list;}\
-+      %{!?__sip_1:-print0 | xargs -0r %{__rm} -f;}\
- done \
-+%{expand:%%undefine __sip_%{?_enable_debug_packages}}\
- %{nil}
- # depmod macro
index a11dece4e0186148483f6a7ddc20e6c4fcf9b45c..21fdd63abc06be86393926fe9e91fb404d21d27e 100644 (file)
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Display bcond (_with_*, _without_*) macros from given spec 
+# Display bcond (_with_*, _without_*) macros from given spec
 # $Id$
 
 if [ "$#" = 0 ]; then
@@ -25,8 +25,8 @@ bconds=`awk -F"\n" 'BEGIN { chlog=0 }
                /^%changelog/ { chlog=1 }
                /_with(out)?_[_a-zA-Z0-9]+/ && chlog == 0 {
                        match($0, /_with(out)?_[_a-zA-Z0-9]+/);
-                       print substr($0, RSTART, RLENGTH)                       
-               }
+                       print substr($0, RSTART, RLENGTH)
+               }
                /^%bcond_with/ && chlog == 0 {
                        match($0, /bcond_with(out)?[ \t]+[_a-zA-Z0-9]+/);
                                 bcond = substr($0, RSTART +5 , RLENGTH -5);
@@ -39,7 +39,7 @@ for c in $bconds; do
 
     if ! echo `rpm --eval "%$c"` | grep $c >/dev/null; then
        echo " (on)"
-    else 
+    else
        echo ""
     fi
 done
@@ -47,18 +47,18 @@ done
 
 for bcond in $bconds; do
     isset=`awk -F"\n" "BEGIN { val=0 }
-                   /^%define[\t ]+$bcond/ {
-                     if (match(\\$0, /$bcond[\t ]+0[\t ]*$/)) {
-                        val = 0
-                     } else if (match(\\$0, /$bcond[\t ]+1[\t ]*$/)) {
-                        val = 1
-                     } else {
-                        print \"couldn't determine $bcond value from \", \\$0
-                     }
-                  } END { print val }" $SPEC`;
+               /^%define[\t ]+$bcond/ {
+                       if (match(\\$0, /$bcond[\t ]+0[\t ]*$/)) {
+                               val = 0
+                       } else if (match(\\$0, /$bcond[\t ]+1[\t ]*$/)) {
+                               val = 1
+                       } else {
+                               print \"couldn't determine $bcond value from \", \\$0
+                       }
+               }
+               END { print val }" $SPEC`;
 
     if [ x"$isset" = x"1" ]; then
        echo "WARN: $bcond defined in spec";
     fi
 done
-        
index ae25390f649f7cdc1780eb6fb5899833bf5355de..bc5d6e8f79c94faa5c296b071f8a050d746b96e4 100644 (file)
@@ -1,4 +1,4 @@
-%define                rpm_macros_rev  1.753
+%define                rpm_macros_rev  2.001
 %define                find_lang_rev   1.40
 # split into individual X_prov_ver if there is a reason to desync
 %define                prov_ver        4.15
@@ -6,7 +6,7 @@ Summary:        TLD Linux RPM macros
 Summary(pl.UTF-8):     Makra RPM dla Linuksa TLD
 Name:          rpm-tld-macros
 Version:       %{rpm_macros_rev}
-Release:       1.2
+Release:       2
 License:       GPL v2+
 Group:         Development/Building
 Source0:       macros.tld
@@ -54,6 +54,7 @@ Source54:     macros.selinux
 Source60:      macros.gstreamer
 Source61:      attr.gstreamer
 
+Source62:      kmod-deps.sh
 BuildRequires: rpm >= 4.4.9-56
 BuildRequires: sed >= 4.0
 Obsoletes:     rpm-macros
@@ -189,6 +190,7 @@ cp -p %{SOURCE9} $RPM_BUILD_ROOT%{_usrlibrpm}/find-spec-bcond
 
 cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_usrlibrpm}/macros.d/macros.kernel
 cp -p %{SOURCE6} $RPM_BUILD_ROOT%{_usrlibrpm}/fileattrs/kernel.attr
+cp -p %{SOURCE62} $RPM_BUILD_ROOT%{_usrlibrpm}/kmod-deps.sh
 
 cp -p service_generator.sh $RPM_BUILD_ROOT%{_usrlibrpm}
 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_usrlibrpm}/find-lang.sh
@@ -270,6 +272,7 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %{_usrlibrpm}/dokuwiki-find-lang.sh
 %attr(755,root,root) %{_usrlibrpm}/find-lang.sh
 %attr(755,root,root) %{_usrlibrpm}/find-spec-bcond
+%attr(755,root,root) %{_usrlibrpm}/kmod-deps.sh
 %attr(755,root,root) %{_usrlibrpm}/service_generator.sh
 
 %files rubyprov
diff --git a/rpmrc b/rpmrc
index 8957083f32271b7c945e71422626d0073d48ea48..cbac36ead78076d3b2e38faf99ce04e0a275a4b7 100644 (file)
--- a/rpmrc
+++ b/rpmrc
@@ -10,7 +10,7 @@ optflags: alphaev6 %{?__common_cflags_with_ssp:%{__common_cflags_with_ssp} -fomi
 optflags: alphaev67 %{?__common_cflags_with_ssp:%{__common_cflags_with_ssp} -fomit-frame-pointer}%{!?__common_cflags_with_ssp:-O2 -g} -mieee -mcpu=ev67 %{!?nospecflags:%{?specflags_alpha} %{?specflags_alphaev67}}
 optflags: alphapca56 %{?__common_cflags_with_ssp:%{__common_cflags_with_ssp} -fomit-frame-pointer}%{!?__common_cflags_with_ssp:-O2 -g} -mieee -mcpu=pca56 %{!?nospecflags:%{?specflags_alpha} %{?specflags_alphapca56}}
 
-optflags: aarch64 %{?__common_cflags_with_ssp:%{__common_cflags_with_ssp} -fomit-frame-pointer}%{!?__common_cflags_with_ssp:-O2 -g} %{!?nospecflags:%{?specflags_aarch64}}
+optflags: aarch64 %{?__common_cflags_with_ssp:%{__common_cflags_with_ssp} -fomit-frame-pointer}%{!?__common_cflags_with_ssp:-O2 -g} -mbranch-protection=standard %{!?nospecflags:%{?specflags_aarch64}}
 optflags: riscv64 %{?__common_cflags_with_ssp:%{__common_cflags_with_ssp} -fomit-frame-pointer}%{!?__common_cflags_with_ssp:-O2 -g} -march=rv64imafdc -mabi=lp64d %{!?nospecflags:%{?specflags_riscv64}}
 
 optflags: armv6j %{?__common_cflags_with_ssp:%{__common_cflags_with_ssp} -fomit-frame-pointer}%{!?__common_cflags_with_ssp:-O2 -g} -march=armv6j -mfpu=vfp -mfloat-abi=hard %{!?nospecflags:%{?specflags_arm} %{?specflags_arm6j}}