##// END OF EJS Templates
buildrpm: build full RPM package including sources
Gilles Moris -
r9813:2059795b default
parent child Browse files
Show More
@@ -34,10 +34,8 b' fi'
34 34 rpmdir="$PWD/rpmbuild"
35 35
36 36 rm -rf $rpmdir
37 mkdir -p $rpmdir/RPMS
38 $HG clone -u . . $rpmdir/BUILD
37 mkdir -p $rpmdir/SOURCES $rpmdir/SPECS $rpmdir/RPMS $rpmdir/SRPMS $rpmdir/BUILD
39 38
40 tmpspec=/tmp/`basename "$specfile"`.$$ # FIXME: Insecure /tmp handling
41 39 # make setup.py build the version string
42 40 python setup.py build_py -c -d .
43 41 hgversion=`$HG version | sed -ne 's/.*(version \(.*\))$/\1/p'`
@@ -52,13 +50,14 b' else'
52 50 release='0'
53 51 fi
54 52
53 $HG archive -t tgz $rpmdir/SOURCES/mercurial-$version.tar.gz
54 rpmspec=$rpmdir/SPECS/mercurial-$version.spec
55
55 56 sed -e "s,^Version:.*,Version: $version," \
56 57 -e "s,^Release:.*,Release: $release," \
57 -e "s,^%prep.*,\n\0," \
58 -e 's,^%setup.*,,' \
59 $specfile > $tmpspec
58 $specfile > $rpmspec
60 59
61 cat <<EOF >> $tmpspec
60 cat <<EOF >> $rpmspec
62 61 %changelog
63 62 * `LANG=en_US date +'%a %b %d %Y'` `$HG showconfig ui.username` $version-$release
64 63 - Automatically built via $0
@@ -69,12 +68,11 b' EOF'
69 68 .hgtags \
70 69 | sed -e 's/^\(\* [MTWFS][a-z][a-z]\), \([0-3][0-9]\) \([A-Z][a-z][a-z]\) /\1 \3 \2 /' \
71 70 -e '/^\* [MTWFS][a-z][a-z] /{s/ [012][0-9]:[0-9][0-9]:[0-9][0-9] [+-][0-9]\{4\}//}' \
72 >> $tmpspec
71 >> $rpmspec
73 72
74 rpmbuild --define "_topdir $rpmdir" -bb $tmpspec --clean
73 rpmbuild --define "_topdir $rpmdir" -ba $rpmspec --clean
75 74 if [ $? = 0 ]; then
76 mv $rpmdir/RPMS/*/* $rpmdir && rm -r $rpmdir/RPMS
77 75 echo
78 76 echo "Packages are in $rpmdir:"
79 ls -l $rpmdir/*.rpm
77 ls -l $rpmdir/*RPMS/*
80 78 fi
General Comments 0
You need to be logged in to leave comments. Login now