blob: 3fc6c05eb8f14ed0928aa010ad7b802242f1d98e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#!/bin/sh
RPM=`rpm --eval '%{_topdir}'`
[ -d "$RPM/SPECS" -a -d "$RPM/SOURCES" ] || exit 1
VERSION=`perl -ne '/VERSION\s+=[^0-9\.]*([0-9\.]+)/ and print "$1\n"' URPM.pm`
perl -pi -e 's/^%define\s+version\s+(\S+)/%define version '$VERSION'/' perl-URPM.spec
echo "building URPM version $VERSION"
rm -f "URPM-$VERSION.tar.gz"
perl Makefile.PL
make dist
[ $? = 0 ] || exit 2
[ -f "URPM-$VERSION.tar.gz" ] || exit 3
cp -f perl-URPM.spec "$RPM/SPECS"
bzme URPM-$VERSION.tar.gz
mv -f URPM-$VERSION.tar.bz2 "$RPM/SOURCES"
if [ -x /usr/bin/rpmbuild ]; then
rpmbuild -ba --clean --rmsource "$RPM/SPECS/perl-URPM.spec"
else
rpm -ba --clean --rmsource "$RPM/SPECS/perl-URPM.spec"
fi
|