Sprout from rpm-4_5 2010-07-09 08:08:06 UTC Arkadiusz Miśkiewicz <arekm@maven.pl> '- rel 43; rebuild with new python'
Cherrypick from master 2009-05-20 00:09:51 UTC Elan Ruusamäe <glen@pld-linux.org> '- workaround for .jar files with stupid permissions inside':
rpm-java-requires -> 1.4
rpm-libtool-deps.patch -> 1.9
rpm.platform -> 1.9
rpm.sysconfig -> 1.4
Delete:
rpm-am.patch
+++ /dev/null
---- rpm-5.1.9/rpmdb/Makefile.am.orig 2009-04-12 21:46:28.000000000 +0200
-+++ rpm-5.1.9/rpmdb/Makefile.am 2009-10-23 21:35:13.000000000 +0200
-@@ -108,7 +108,7 @@
-
- install-data-local:
- $(mkinstalldirs) $(DESTDIR)$(pkgincdir)
-- $(pkgincHEADERS_INSTALL) $(my_DB_HEADER) $(DESTDIR)$(pkgincdir)/db.h
-+ $(install_sh_DATA) $(my_DB_HEADER) $(DESTDIR)$(pkgincdir)/db.h
-
- clean-local:
- rm -f *.o tagtbl.c
--- /dev/null
+#!/bin/sh
+# This script reads filenames from STDIN and outputs any relevant requires
+# information that needs to be included in the package.
+#
+# Based on rpm-4.4.2/scripts/find-req.pl
+# Authors: Elan Ruusamäe <glen@pld-linux.org>
+
+export PATH="/sbin:/usr/sbin:/bin:/usr/bin"
+
+javaclassversion() {
+ [ $# -gt 0 ] || return 1
+
+ local classver=$(echo "$@" | xargs -r file | grep -o 'compiled Java class data, version [0-9.]*' | awk '{print $NF}' | sort -u)
+ if [ -z "$classver" ]; then
+ return 1
+ fi
+
+ local v
+ for v in $classver; do
+ echo "java(ClassDataVersion) >= $v"
+ done
+ return 0
+}
+
+javajarversion() {
+ local jar="$1"
+ local ret=0
+
+ # check only files, symlinks could point outside buildroot
+ [ -f "$jar" -a ! -L "$jar" ] || return $ret
+
+ tmp=$(mktemp -d)
+ unzip -q -d $tmp $jar >&2
+ # workaround for .jar files with stupid permissions
+ chmod -R u+rwX $tmp
+ javaclassversion $(find $tmp -type f -name '*.class') || {
+ echo >&2 "ERROR: Class version could not be extracted from $jar"
+ ret=1
+ }
+ rm -rf $tmp
+
+ return $ret
+}
+
+find_requires() {
+ local ret=0
+ for file in $FILES; do
+ case $file in
+ *.jar)
+ javajarversion "$file" || ret=1
+ ;;
+ *.class)
+ javaclassversion "$file" || {
+ echo >&2 "ERROR: Class version could not be extracted from $file"
+ ret=1
+ }
+ ;;
+ esac
+ done
+ return $ret
+}
+
+FILES=$(cat -)
+
+t=$(mktemp)
+ret=0
+find_requires > $t || ret=1
+cat $t
+rm -f $t
+exit $ret
--- /dev/null
+--- rpm-4.4.8.org/scripts/libtooldeps.sh 2005-11-12 22:20:42.000000000 +0100
++++ rpm-4.4.8/scripts/libtooldeps.sh 2006-11-26 20:06:49.254008750 +0100
+@@ -5,15 +5,18 @@
+ exit 0
+ }
+
++pkgname="$3"
++
+ case $1 in
+ -P|--provides)
+ shift
+- RPM_BUILD_ROOT="$1"
++ RPM_BUILD_ROOT="`readlink -f "$1"`"
+ while read possible
+ do
+ case "$possible" in
+ *.la)
+- if grep -iq '^# Generated by ltmain.sh' "$possible" 2> /dev/null ; then
++ possible="`readlink -f "$possible" 2> /dev/null || echo "$possible"`"
++ if file "$possible" | grep -iq 'libtool library file' 2> /dev/null ; then
+ possible="`echo ${possible} | sed -e s,${RPM_BUILD_ROOT}/,/,`"
+ echo "libtool($possible)"
+ fi
+@@ -22,21 +25,28 @@
+ done
+ ;;
+ -R|--requires)
+- while read possible ; do
+- case "$possible" in
+- *.la)
+- for dep in `grep '^dependency_libs='"$possible" 2> /dev/null | \
+- sed -e "s,^dependency_libs='\(.*\)',\1,g"`
+- do
+- case "$dep" in
+- /*.la)
+- echo "libtool($dep)"
++ case $pkgname in
++ *-devel)
++ while read possible ; do
++ case "$possible" in
++ *.la)
++ for dep in `grep '^dependency_libs=' "$possible" 2> /dev/null | \
++ sed -e "s,^dependency_libs='\(.*\)',\1,g"`
++ do
++ case "$dep" in
++ /*.la)
++ dep="`readlink -f "$dep" 2> /dev/null || echo "$dep"`"
++ echo "libtool($dep)"
++ ;;
++ esac
++ done
+ ;;
+ esac
+ done
+- ;;
+- esac
+- done
+- ;;
++ ;;
++ *)
++ cat > /dev/null
++ ;;
++ esac
+ esac
+ exit 0
--- /dev/null
+# PLD rpm macros
+
+%__id /bin/id
+%__id_u %{__id} -u
+%__chown_Rhf %{__chown} -Rhf
+%__chgrp_Rhf %{__chgrp} -Rhf
+
+%_fixowner [ `%{__id_u}` = '0' ] && %{__chown_Rhf} root:root
+%_fixgroup true
+%_fixperms %{__chmod} -Rf -Rf a+rX,u+w,g-w,o-w
+
+%_exec_prefix %{_prefix}
+%_bindir %{_exec_prefix}/bin
+%_sbindir %{_exec_prefix}/sbin
+%_datadir %{_prefix}/share
+%_sharedstatedir /var/lib
+%_lib @LIB@
+%_libdir %{_exec_prefix}/%{_lib}
+%_libexecdir %{_exec_prefix}/%{_lib}
+%_includedir %{_prefix}/include
+%_oldincludedir /usr/include
+%_sysconfdir /etc
+%_localstatedir /var
+%_infodir /usr/share/info
+%_mandir %{_prefix}/share/man
+%_defaultdocdir /usr/share/doc
+
+%__os_install_post \
+%{__spec_install_post_strip}\
+%{__spec_install_post_chrpath}\
+%{__spec_install_post_check_so}\
+%{__spec_install_post_compress_docs}\
+%{__spec_install_post_compress_modules}\
+%{__spec_install_post_py_hardlink}\
+%{__spec_install_post_perl_clean}\
+%{__arch_install_post}\
+%{nil}
+
--- /dev/null
+# This file is intended for setting rpm options that cannot be set as macros
+#
+# NOTE:
+# At this moment only few packages use this features.
+
+# How verbose the .rpm scripts/triggers should be?
+RPM_SCRIPTVERBOSITY=5
+
+# Should unused users be removed at package deinstallation?
+RPM_USERDEL=yes
+
+# Should automatic restarts from rpm upgrades be skipped?
+# You can also disable this per service, if service supports it from
+# /etc/sysconfig/SERVICE
+#RPM_SKIP_AUTO_RESTART=yes