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
--- /dev/null
+#!/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
%_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})))
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 \\\\\\\
%__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
%{?__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} \\\
%%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
#
%__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}}} \
%{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}}} \
%{?_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:
+++ /dev/null
---- ./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
#!/bin/sh
-# Display bcond (_with_*, _without_*) macros from given spec
+# Display bcond (_with_*, _without_*) macros from given spec
# $Id$
if [ "$#" = 0 ]; then
/^%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);
if ! echo `rpm --eval "%$c"` | grep $c >/dev/null; then
echo " (on)"
- else
+ else
echo ""
fi
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
-
-%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
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
Source60: macros.gstreamer
Source61: attr.gstreamer
+Source62: kmod-deps.sh
BuildRequires: rpm >= 4.4.9-56
BuildRequires: sed >= 4.0
Obsoletes: rpm-macros
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
%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
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}}