aboutsummaryrefslogtreecommitdiffstats
path: root/build_rpm
blob: aa4c794782a8b606340ad84f4f9f3ab02c9649af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/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"
rpm -ba --clean --rmsource "$RPM/SPECS/perl-URPM.spec"