Fix brp-java-repack-jars to work with builddirs that aren't %name-%version

This commit is contained in:
Deepak Bhole 2006-09-12 22:24:31 +00:00
parent 83a5b2cc39
commit de9ce505bb
2 changed files with 27 additions and 11 deletions

View File

@ -42,15 +42,22 @@ if [ ! -z "$JARS" ]; then
# Get the modtime from the newest ChangeLog. If the project
# doesn't have a ChangeLog, Jan 1, 1970 will be used.
CHANGELOGS=`find $RPM_BUILD_DIR/$RPM_PACKAGE_NAME-$RPM_PACKAGE_VERSION -type f -name ChangeLog`
DATE="1970-01-01 UTC"
if [ ! -z "$CHANGELOGS" ]; then
for c in $CHANGELOGS; do
TMPDATE=`stat -c %y $c | cut -d " " -f 1-2`
if [ `date --date="$TMPDATE" +%s` -gt `date --date="$DATE" +%s` ]; then
DATE="$TMPDATE"
fi
done
if [ -z $_PACKAGE_BUILD_DIR ]; then
_PACKAGE_BUILD_DIR=$RPM_BUILD_DIR/$RPM_PACKAGE_NAME-$RPM_PACKAGE_VERSION
fi
if [ -d $_PACKAGE_BUILD_DIR ]; then
CHANGELOGS=`find $_PACKAGE_BUILD_DIR -type f -name ChangeLog`
if [ ! -z "$CHANGELOGS" ]; then
for c in $CHANGELOGS; do
TMPDATE=`stat -c %y $c | cut -d " " -f 1-2`
if [ `date --date="$TMPDATE" +%s` -gt `date --date="$DATE" +%s` ]; then
DATE="$TMPDATE"
fi
done
fi
fi
# move the contents over to the a new directory in order and set
@ -66,7 +73,13 @@ if [ ! -z "$JARS" ]; then
# make the jar
pushd $JARDIR > /dev/null
find . -type f -print | LC_ALL=C sort | /usr/bin/zip -q -X -9 $j -@
if [ -n "`find -type f`" ]; then
find -type f -print | LC_ALL=C sort | /usr/bin/zip -q -X -9 $j -@
else
# Put the empty jar back
touch $j
fi
popd > /dev/null
# Cleanup.

View File

@ -1,7 +1,7 @@
Summary: Red Hat specific rpm configuration files.
Name: redhat-rpm-config
Version: 8.0.45
Release: 5
Release: 6
License: GPL
Group: Development/System
Source: redhat-rpm-config-%{version}.tar.gz
@ -40,6 +40,9 @@ rm -rf ${RPM_BUILD_ROOT}
%{_prefix}/lib/rpm/redhat
%changelog
* Tue Sep 12 2006 Deepak Bhole <dbhole@redhat.com> 8.0.45-6
- Fix brp-java-repack-jars to work with builddirs that aren't %name-%version
* Mon Sep 11 2006 Fernando Nasser <fnasser@redhat.com> - 8.0.45-5
- Fix order of tokens in find command (thanks mikeb@redhat.com)