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