Sprout from rpm-4_5 2010-02-02 22:26:32 UTC Elan Ruusamäe <glen@pld-linux.org> '- fixed pkgconfig file; rel 36'
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-popt-aliases.patch -> 1.3
rpm.platform -> 1.9
rpm.sysconfig -> 1.4
Cherrypick from rpm-4_4_9 2008-11-26 21:45:37 UTC sparky <sparky@pld-linux.org> '- unambiguous -z combreloc':
rpm-macros-th.patch -> 1.5.2.3
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
+--- rpm-4.4.9.org/macros.in 2008-07-24 08:52:35.205363000 +0200
++++ rpm-4.4.9/macros.in 2008-07-24 09:01:00.351355186 +0200
+@@ -275,6 +275,9 @@
+ #
+ #%distribution
+
++# PLD Linux Release
++%pld_release th
++
+ # Configurable distribution URL, same as DistURL: tag in a specfile.
+ # The URL will be used to supply reliable information to tools like
+ # rpmfind.
+@@ -1468,6 +1471,9 @@
+ # -feliminate-dwarf2-dups disabled until PR ld/3290 is fixed.
+
+ %debugcflags -O0 -g -Wall
++%debugcppflags %{nil}
++%optldflags -Wl,--as-needed -Wl,-z,relro -Wl,-z,combreloc
++%optcppflags -D_FORTIFY_SOURCE=2
+
+ # Warning: those macros are overwritten by macros.build,
+ # left here for compatibility
--- /dev/null
+--- rpm-4.4.9/rpmpopt.in 2008-03-24 22:09:33.709972364 +0200
++++ rpm-4.4.9/rpmpopt.in 2008-04-04 18:51:45.658923774 +0300
+@@ -595,4 +595,16 @@
+ rpmv alias --httpproxy --define '_httpproxy !#:+'
+
++rpm alias --downgrade --oldpackage \
++ --POPTdesc=$"Allow an upgrade to replace a newer package with an older one."
++
++rpm alias --what-provides --whatprovides \
++ --POPTdesc=$"find package name that contains a provided capability"
++
++rpm alias --what-requires --whatrequires \
++ --POPTdesc=$"find package name that contains a required capability"
++
++rpm alias --norepackage --define '_repackage_all_erasures 0' \
++ --POPTdesc=$"Disable re-package of the files before erasing"
++
+ # \endverbatim
+ #*/
--- /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