Commit dd7f5992 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Accept multiple package names.

Include xml files.
Remove files before copying.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2382 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 209965ba
...@@ -9,18 +9,17 @@ RPM_PATH=/home/$USER/rpm ...@@ -9,18 +9,17 @@ RPM_PATH=/home/$USER/rpm
PRODUCT_PATH=%{_libdir}/zope/lib/python/Products/ PRODUCT_PATH=%{_libdir}/zope/lib/python/Products/
FULL_RPM_BUILD_ROOT=\$RPM_BUILD_ROOT$PRODUCT_PATH FULL_RPM_BUILD_ROOT=\$RPM_BUILD_ROOT$PRODUCT_PATH
if [ $# -lt "$PARAMS" ] || [ $# -gt "$PARAMS" ] if [ $# -lt "$PARAMS" ]
then then
echo echo
echo "Give me exactly $PARAMS command-line arguments!" echo "build-spec PACKAGE_NAME..."
echo "build-rpm PACKAGE_NAME"
exit 0 exit 0
fi fi
if [ -n "$1" ] while test $# -gt 0; do
then
echo Starting Building $1
NAME=$1 NAME=$1
shift
echo Starting Building $NAME
# Retrieve the version in the source code # Retrieve the version in the source code
cd $CVS_PATH/$NAME/ && cvs update -RdP && cd - cd $CVS_PATH/$NAME/ && cvs update -RdP && cd -
VERSION=`awk '{print $2}' $CVS_PATH/$NAME/VERSION.txt` VERSION=`awk '{print $2}' $CVS_PATH/$NAME/VERSION.txt`
...@@ -29,6 +28,7 @@ then ...@@ -29,6 +28,7 @@ then
cp -a $CVS_PATH/$NAME $CVS_PATH/$NAME-$VERSION cp -a $CVS_PATH/$NAME $CVS_PATH/$NAME-$VERSION
# remove because this does not remove files # remove because this does not remove files
cd $CVS_PATH && tar jcvf $NAME-$VERSION.tar.bz2 $NAME-$VERSION && cd - cd $CVS_PATH && tar jcvf $NAME-$VERSION.tar.bz2 $NAME-$VERSION && cd -
rm -f $RPM_PATH/SOURCES/$NAME-$VERSION.tar.bz2
cp $CVS_PATH/$NAME-$VERSION.tar.bz2 $RPM_PATH/SOURCES/ cp $CVS_PATH/$NAME-$VERSION.tar.bz2 $RPM_PATH/SOURCES/
#rpmbuild -ba $RPM_PATH/SPECS/$NAME.spec #rpmbuild -ba $RPM_PATH/SPECS/$NAME.spec
...@@ -42,7 +42,7 @@ then ...@@ -42,7 +42,7 @@ then
for directory in "" `cd $CVS_PATH/$NAME && find * -type d -not -name "CVS" && cd -` for directory in "" `cd $CVS_PATH/$NAME && find * -type d -not -name "CVS" && cd -`
do echo install -d $FULL_RPM_BUILD_ROOT/%{name}/$directory | sed -e "s/\/\//\//g" >> /tmp/build-rpm-install.tmp do echo install -d $FULL_RPM_BUILD_ROOT/%{name}/$directory | sed -e "s/\/\//\//g" >> /tmp/build-rpm-install.tmp
# then add files we want to include into the rpm # then add files we want to include into the rpm
for file_type in py dtml txt png pt stx form zsql gif jpg css html props for file_type in py dtml txt png pt stx form zsql gif jpg css html props xml
do if (ls $CVS_PATH/$NAME/$directory/*.$file_type > /dev/null 2>&1) do if (ls $CVS_PATH/$NAME/$directory/*.$file_type > /dev/null 2>&1)
then echo install %{name}-%{version}/$directory/*.$file_type $FULL_RPM_BUILD_ROOT/%{name}/$directory | sed -e "s/\/\//\//g" >> /tmp/build-rpm-install.tmp then echo install %{name}-%{version}/$directory/*.$file_type $FULL_RPM_BUILD_ROOT/%{name}/$directory | sed -e "s/\/\//\//g" >> /tmp/build-rpm-install.tmp
fi fi
...@@ -72,9 +72,10 @@ then ...@@ -72,9 +72,10 @@ then
tail -n `expr $L_TOTAL - $L_CHANGELOG + 1` $NAME.spec >> /tmp/build-rpm-spec.tmp tail -n `expr $L_TOTAL - $L_CHANGELOG + 1` $NAME.spec >> /tmp/build-rpm-spec.tmp
# now we can replace the spec file # now we can replace the spec file
rm -f $RPM_PATH/SPECS/$NAME.spec
cp -f /tmp/build-rpm-spec.tmp $RPM_PATH/SPECS/$NAME.spec cp -f /tmp/build-rpm-spec.tmp $RPM_PATH/SPECS/$NAME.spec
fi done
exit 0 exit 0
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment