[packages/rpm/dev-5.4.17] - move java macros and dep generators to rpm-build-macros

qboosh qboosh at pld-linux.org
Wed Feb 5 17:22:10 CET 2020


commit bda88bfd0b5c783f21a66f6ae898cfd192fff6a7
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Thu Jan 2 22:41:00 2020 +0900

    - move java macros and dep generators to rpm-build-macros

 eclipse-feature.xslt |  81 ------------------------------
 rpm-java-requires    | 137 ---------------------------------------------------
 rpm-javadeps.patch   |  13 -----
 rpm.spec             |  31 +-----------
 4 files changed, 2 insertions(+), 260 deletions(-)
---
diff --git a/rpm.spec b/rpm.spec
index 742cc55..e8ba05e 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -80,7 +80,6 @@ Source10:	%{name}.sysinfo
 Source11:	perl.prov
 Source12:	%{name}-user_group.sh
 Source13:	%{name}.sysconfig
-Source14:	%{name}-java-requires
 # http://svn.pld-linux.org/banner.sh/
 Source15:	banner.sh
 Source16:	ftp://ftp.pld-linux.org/dists/th/PLD-3.0-Th-GPG-key.asc
@@ -730,24 +729,6 @@ construir pacotes usando o RPM.
 Різноманітні допоміжні скрипти та утиліти, які використовуються для
 побудови RPM'ів.
 
-%package javaprov
-Summary:	Additional utilities for checking Java provides/requires in RPM packages
-Summary(pl.UTF-8):	Dodatkowe narzędzia do sprawdzania zależności kodu w Javie w pakietach RPM
-Group:		Applications/File
-Requires:	%{name} = %{version}-%{release}
-Requires:	file
-Requires:	findutils >= 1:4.2.26
-Requires:	mktemp
-Requires:	unzip
-
-%description javaprov
-Additional utilities for checking Java provides/requires in RPM
-packages.
-
-%description javaprov -l pl.UTF-8
-Dodatkowe narzędzia do sprawdzania zależności kodu w Javie w pakietach
-RPM.
-
 %package perlprov
 Summary:	Additional utilities for checking Perl provides/requires in RPM packages
 Summary(de.UTF-8):	Zusatzwerkzeuge fürs Nachsehen Perl-Abhängigkeiten in RPM-Paketen
@@ -1273,7 +1254,6 @@ install %{SOURCE3} $RPM_BUILD_ROOT%{_rpmlibdir}/install-build-tree
 install %{SOURCE4} $RPM_BUILD_ROOT%{_rpmlibdir}/find-spec-bcond
 install %{SOURCE7} $RPM_BUILD_ROOT%{_rpmlibdir}/compress-doc
 install %{SOURCE12} $RPM_BUILD_ROOT%{_rpmlibdir}/user_group.sh
-install %{SOURCE14} $RPM_BUILD_ROOT%{_rpmlibdir}/java-find-requires
 install scripts/php.{prov,req}	$RPM_BUILD_ROOT%{_rpmlibdir}
 cp -p %{SOURCE25} $RPM_BUILD_ROOT%{_rpmlibdir}/php.req.php
 install %{SOURCE17} $RPM_BUILD_ROOT%{_rpmlibdir}/mimetypedeps.sh
@@ -1304,13 +1284,14 @@ install tools/rpmdb_reset $RPM_BUILD_ROOT%{_rpmlibdir}/bin
 install %{SOURCE29} $RPM_BUILD_ROOT%{_rpmlibdir}/bin/dbupgrade.sh
 
 # create macro loading wrappers for backward compatibility
-for m in gstreamer java mono perl php python; do
+for m in gstreamer mono perl php python; do
 	echo "%%{load:%{_rpmlibdir}/macros.d/$m}" >$RPM_BUILD_ROOT%{_rpmlibdir}/macros.$m
 done
 
 # moved to rpm-build-macros 1.699
 %{__rm} $RPM_BUILD_ROOT%{_rpmlibdir}/macros.d/kernel
 # moved to rpm-build-macros 1.744
+%{__rm} $RPM_BUILD_ROOT%{_rpmlibdir}/{macros.d/java,javadeps.sh}
 %{__rm} $RPM_BUILD_ROOT%{_rpmlibdir}/macros.d/ruby
 
 # for rpm -e|-U --repackage
@@ -1588,7 +1569,6 @@ find %{_rpmlibdir} -name '*-linux' -type l | xargs rm -f
 # must be here for "Requires: rpm-*prov" to work
 %{_rpmlibdir}/macros.d/cmake
 %{_rpmlibdir}/macros.d/gstreamer
-%{_rpmlibdir}/macros.d/java
 %{_rpmlibdir}/macros.d/libtool
 %{_rpmlibdir}/macros.d/mono
 %{_rpmlibdir}/macros.d/perl
@@ -1600,7 +1580,6 @@ find %{_rpmlibdir} -name '*-linux' -type l | xargs rm -f
 %{_rpmlibdir}/macros.rpmbuild
 # compat wrappers
 %{_rpmlibdir}/macros.gstreamer
-%{_rpmlibdir}/macros.java
 %{_rpmlibdir}/macros.mono
 %{_rpmlibdir}/macros.perl
 %{_rpmlibdir}/macros.php
@@ -1621,12 +1600,6 @@ find %{_rpmlibdir} -name '*-linux' -type l | xargs rm -f
 %lang(pl) %{_mandir}/pl/man1/gendiff.1*
 %lang(pl) %{_mandir}/pl/man8/rpmbuild.8*
 
-%files javaprov
-%defattr(644,root,root,755)
-%attr(755,root,root) %{_rpmlibdir}/java-find-requires
-# needs jar (any jdk), jcf-dump (gcc-java) to work
-%attr(755,root,root) %{_rpmlibdir}/javadeps.sh
-
 %files perlprov
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_rpmlibdir}/perl.*
diff --git a/eclipse-feature.xslt b/eclipse-feature.xslt
deleted file mode 100644
index d48df03..0000000
--- a/eclipse-feature.xslt
+++ /dev/null
@@ -1,81 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-<xsl:output method="text"/>
-
-<!-- we match from root, not to left anything to default template -->
-<xsl:template match="/">
-	<xsl:apply-templates select="feature"/>
-</xsl:template>
-
-<xsl:template match="feature">
-	<!-- process provides -->
-	<xsl:if test="$mode = 'provides'">
-		<!-- include root tag of feature -->
-		<xsl:text>eclipse(</xsl:text>
-			<xsl:value-of select="@id"/>
-			<xsl:text>) = </xsl:text>
-			<xsl:value-of select="@version"/>
-		<xsl:text>
</xsl:text>
-
-		<!-- is feature and plugin any way different? -->
-		<!-- process feature/plugin -->
-		<xsl:for-each select="plugin">
-			<xsl:text>eclipse(</xsl:text>
-				<xsl:value-of select="@id"/>
-				<xsl:text>) = </xsl:text>
-				<xsl:value-of select="@version"/>
-			<xsl:text>
</xsl:text>
-		</xsl:for-each>
-		<!-- process feature/includes -->
-		<xsl:for-each select="includes">
-			<xsl:text>eclipse(</xsl:text>
-				<xsl:value-of select="@id"/>
-				<xsl:text>) = </xsl:text>
-				<xsl:value-of select="@version"/>
-			<xsl:text>
</xsl:text>
-		</xsl:for-each>
-	</xsl:if>
-
-	<!-- process requires -->
-	<xsl:if test="$mode = 'requires'">
-		<xsl:for-each select="requires/import">
-			<xsl:text>eclipse(</xsl:text>
-				<!-- match plugin or feature -->
-				<xsl:if test="@plugin != ''">
-					<xsl:value-of select="@plugin"/>
-				</xsl:if>
-				<xsl:if test="@feature != ''">
-					<xsl:value-of select="@feature"/>
-				</xsl:if>
-			<xsl:text>)</xsl:text>
-
-			<!-- handle match="perfect" (probably means: same version as us) -->
-				<xsl:if test="@match = 'perfect'">
-					<xsl:text> = </xsl:text>
-					<xsl:value-of select="//feature/@version"/>
-				</xsl:if>
-
-				<xsl:if test="@match = 'compatible'">
-					<xsl:text> >= </xsl:text>
-					<xsl:value-of select="@version"/>
-				</xsl:if>
-
-				<!-- apparently: base ver or greater -->
-				<xsl:if test="@match = 'equivalent'">
-					<xsl:text> >= </xsl:text>
-					<xsl:value-of select="@version"/>
-				</xsl:if>
-
-				<!-- no qualifier, assume any? -->
-				<xsl:if test="@match = ''">
-					<xsl:text> >= </xsl:text>
-					<xsl:value-of select="@version"/>
-				</xsl:if>
-
-			<xsl:text>
</xsl:text>
-		</xsl:for-each>
-	</xsl:if>
-
-</xsl:template>
-
-</xsl:stylesheet>
diff --git a/rpm-java-requires b/rpm-java-requires
deleted file mode 100755
index 8bbac6f..0000000
--- a/rpm-java-requires
+++ /dev/null
@@ -1,137 +0,0 @@
-#!/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 at pld-linux.org>
-
-export PATH="/sbin:/usr/sbin:/bin:/usr/bin"
-
-# Set the prefix, unless it is overriden
-: ${RPM_LIBDIR=/usr/lib/rpm}
-
-# Enable debug: JAVADEPS_DEBUG=true
-: ${JAVADEPS_DEBUG=false}
-
-# xsltproc for eclipse feature.xml
-: ${xsltproc=/usr/bin/xsltproc}
-
-# "%define java_min_classdataversion 51.0" in spec to minimum version to be 51.0
-: ${MIN_CLASSDATAVERSION=}
-
-# save $- state, to enable in functions
-debug=$-
-
-javaclassversionfilter() {
-	if [ "$MIN_CLASSDATAVERSION" ]; then
-		set -- $* "$MIN_CLASSDATAVERSION"
-	fi
-
-	local v
-	for v in $*; do
-		echo "java(ClassDataVersion) >= $v"
-	done | sort -V | tail -n 1
-}
-
-javaclassversion() {
-	set -$debug
-	local mode=$1; shift
-	[ $# -gt 0 ] || return 1
-	$JAVADEPS_DEBUG && echo >&2 ">> javaclassversion($mode): $*"
-
-	# process only requires
-	[ "$mode" = requires ] || return $ret
-
-	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
-
-	javaclassversionfilter $classver
-	return 0
-}
-
-javajarversion() {
-	set -$debug
-	local mode=$1; shift
-	local jar=$1
-	local tmp ret=0
-	$JAVADEPS_DEBUG && echo >&2 ">> javajarversion($mode): $jar"
-
-	# 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
-
-	# find .jar and .class files
-	find_javadeps $mode $(find $tmp -type f -regextype posix-extended  -regex '^.+\.(class|jar)$') || ret=1
-	rm -rf $tmp
-	return $ret
-}
-
-eclipse_feature() {
-	set -$debug
-	local mode=$1; shift
-	local file=$1
-	local ret=0
-
-	$JAVADEPS_DEBUG && echo >&2 ">> eclipse_feature($mode): $file"
-
-	if [ ! -x $xsltproc ]; then
-		return 0
-	fi
-
-	$xsltproc --stringparam mode $mode ${RPM_LIBDIR}/eclipse-feature.xslt $file
-}
-
-find_javadeps() {
-	set -$debug
-	local mode=$1; shift
-	local ret=0
-
-	$JAVADEPS_DEBUG && echo >&2 ">> find_javadeps($mode): $*"
-	for file in $@; do
-		case $file in
-		*.jar)
-			javajarversion $mode "$file" || ret=1
-		;;
-		*.class)
-			javaclassversion $mode "$file" || {
-				echo >&2 "ERROR: Class version could not be extracted from $file"
-				ret=1
-			}
-		;;
-		*/feature.xml)
-			eclipse_feature $mode "$file" || ret=1
-		;;
-		*)
-			$JAVADEPS_DEBUG && echo >&2 ">> find_javadeps($mode): no handle: $file"
-		;;
-		esac
-	done
-	return $ret
-}
-
-ret=0
-# default mode to requires for backward compat
-mode=requires
-case $1 in
--P|--provides)
-	mode=provides
-	shift
-	;;
--R|--requires)
-	mode=requires
-	shift
-	;;
-esac
-
-t=$(mktemp)
-find_javadeps $mode $(cat -) > $t || ret=1
-sort -u $t
-rm -f $t
-
-exit $ret
diff --git a/rpm-javadeps.patch b/rpm-javadeps.patch
index 3e8303c..a26831e 100644
--- a/rpm-javadeps.patch
+++ b/rpm-javadeps.patch
@@ -11,16 +11,3 @@
      }
  
  /*@-observertrans@*/
---- rpm-4.4.9/macros/java.in.orig	2007-05-24 21:20:49.657284000 +0200
-+++ rpm-4.4.9/macros/java.in	2007-05-24 21:22:32.823163996 +0200
-@@ -1416,8 +1416,8 @@
- #
- # Note: Used iff _use_internal_dependency_generator is non-zero. The
- # helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}.
--%__java_provides	%{_rpmhome}/javadeps.sh --provides
--%__java_requires	%{_rpmhome}/javadeps.sh --requires
-+%__java_provides	%{nil}
-+%__java_requires	env RPM_BUILD_ROOT=%{buildroot} MIN_CLASSDATAVERSION=%{?java_min_classdataversion} %{_rpmhome}/java-find-requires
- 
- #	The value of CLASSPATH in build scriptlets (iff configured).
- #	
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/rpm.git/commitdiff/cffb64ba2db7b311147604c09b2ed00ea8974d6d



More information about the pld-cvs-commit mailing list