Add RPM .spec file

Tested on RHEL6.1 (with epel repository for dependencies).

make_release checks that that the version string in the .spec file is in
sync with the rest of the project and reminds the user to bump the
release string if necessary and to build/upload the RPM package.

Change-Id: I5f454f2a7301d1e0e120cb3c0e13a68d03bca917
This commit is contained in:
Taylor Braun-Jones
2013-02-15 19:09:48 -05:00
parent d2a5195b51
commit 70701745b8
2 changed files with 134 additions and 3 deletions
+22 -3
View File
@@ -51,6 +51,8 @@ VERSION_IN_HEADER=$(grep '#define CERES_VERSION' include/ceres/ceres.h | \
ABI_VERSION_IN_HEADER=$(grep '#define CERES_ABI_VERSION' \
include/ceres/ceres.h | \
sed -e 's/#define CERES_ABI_VERSION //')
VERSION_IN_SPEC=$(grep '^Version:' scripts/ceres-solver.spec | \
sed -e 's/Version: *//')
GIT_COMMIT=$(git log -1 HEAD |grep commit)
if [[ $1 != $VERSION ]] ; then
@@ -78,6 +80,15 @@ if [[ $ABI_VERSION_IN_HEADER != $ABI_VERSION ]] ; then
exit 1
fi
if [[ $VERSION_IN_SPEC != $VERSION ]] ; then
echo "ERROR: Version string from scripts/ceres-solver.spec, which is"
echo " $VERSION_IN_SPEC, does not match the version"
echo " from the toplevel CMakeLists.txt, which is $ABI_VERSION."
echo " You may not be in the toplevel source directory, or the"
echo " versions are out of sync."
exit 1
fi
# Clone the repository and clean out the git extras.
git clone . $TMP
rm -rf "$TMP/.git"
@@ -101,6 +112,14 @@ rm -rf $TMP
rm -rf $DOCS_TMP
# Reminder to upload.
echo
echo "TODO: upload /tmp/ceres-solver-$1.tar.gz"
echo
cat <<EOF
TODO:
- Upload /tmp/ceres-solver-$1.tar.gz
- Update the release string in scripts/ceres-solver.spec if this is a RC
release or the first release after a RC release.
- Build and upload RPM package.
EOF