PageRenderTime 36ms CodeModel.GetById 33ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/contrib/rpm.sh

https://bitbucket.org/tortoisehg/hgtk/
Shell | 20 lines | 15 code | 3 blank | 2 comment | 2 complexity | 05e1f46738da1edcd317fc39c53992cb MD5 | raw file
 1#!/bin/sh
 2
 3mkdir -p rpmbuild/{SOURCES,BUILD,RPMS,SRPMS,SPECS}
 4version=`hg parents --template '{latesttag}+{latesttagdistance}'`
 5if [ `expr "$version" : '.*+0$'` -ne 0 ]; then
 6  # We are on a tagged version
 7  version=`expr "$version" : '\(.*\)+0$'`
 8  release='1'
 9else
10  release=`hg parents --template '{node|short}'`
11fi
12
13hg archive -t tgz rpmbuild/SOURCES/tortoisehg-$version.tar.gz
14sed -e "s,^Version:.*,Version: $version," \
15    -e "s,^Release:.*,Release: $release," \
16    `dirname $0`/tortoisehg.spec > rpmbuild/SPECS/tortoisehg.spec
17
18rpmbuild --define "_topdir `pwd`/rpmbuild" -ba rpmbuild/SPECS/tortoisehg.spec || exit 1
19rm -rf rpmbuild/BUILD/
20ls -l rpmbuild/{RPMS/*,SRPMS}/tortoisehg-*.rpm