Skip to content

Commit

Permalink
Updated version number to 4.5.0-a1
Browse files Browse the repository at this point in the history
The build script and spec template has been modified to use a new
version number and to support development phase (e.g. a1, b2).
  • Loading branch information
edewata committed Jun 15, 2018
1 parent 46d3098 commit 209670c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
19 changes: 16 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ usage() {

generate_rpm_sources() {

TARBALL="$NAME-$VERSION.tar.gz"
TARBALL="$NAME-$VERSION${_PHASE}.tar.gz"

if [ "$SOURCE_TAG" != "" ] ; then

Expand All @@ -55,7 +55,7 @@ generate_rpm_sources() {
git -C "$SRC_DIR" \
archive \
--format=tar.gz \
--prefix $NAME-$VERSION/ \
--prefix $NAME-$VERSION${_PHASE}/ \
-o "$WORK_DIR/SOURCES/$TARBALL" \
$SOURCE_TAG

Expand All @@ -77,7 +77,7 @@ generate_rpm_sources() {
fi

tar czf "$WORK_DIR/SOURCES/$TARBALL" \
--transform "s,^./,$NAME-$VERSION/," \
--transform "s,^./,$NAME-$VERSION${_PHASE}/," \
--exclude .git \
--exclude bin \
-C "$SRC_DIR" \
Expand Down Expand Up @@ -113,6 +113,9 @@ generate_rpm_spec() {
# hard-code commit ID
commands="${commands}; s/%{?_commit_id}/${_COMMIT_ID}/g"

# hard-code phase
commands="${commands}; s/%{?_phase}/${_PHASE}/g"

# hard-code patch
if [ "$PATCH" != "" ] ; then
commands="${commands}; s/# Patch: jss-VERSION-RELEASE.patch/Patch: $PATCH/g"
Expand Down Expand Up @@ -212,6 +215,16 @@ if [ "$DEBUG" = true ] ; then
echo "RELEASE: $RELEASE"
fi

spec=$(<"$SPEC_TEMPLATE")
regex=$'%global *_phase *([^\n]+)'
if [[ $spec =~ $regex ]] ; then
_PHASE="${BASH_REMATCH[1]}"
fi

if [ "$DEBUG" = true ] ; then
echo "PHASE: ${_PHASE}"
fi

if [ "$WITH_TIMESTAMP" = true ] ; then
TIMESTAMP="`date +"%Y%m%d%H%M%S"`"
_TIMESTAMP=".$TIMESTAMP"
Expand Down
5 changes: 3 additions & 2 deletions jss.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ License: MPLv1.1 or GPLv2+ or LGPLv2+

Version: 4.5.0
Release: 0.1%{?_timestamp}%{?_commit_id}%{?dist}
%global _phase -a1

# To generate the source tarball:
# $ git clone https://github.com/dogtagpki/jss.git
Expand All @@ -17,7 +18,7 @@ Release: 0.1%{?_timestamp}%{?_commit_id}%{?dist}
# --prefix jss-VERSION/ \
# -o jss-VERSION.tar.gz \
# <version tag>
Source: https://github.com/dogtagpki/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz
Source: https://github.com/dogtagpki/%{name}/archive/v%{version}%{?_phase}/%{name}-%{version}%{?_phase}.tar.gz

# To create a patch for all changes since a version tag:
# $ git format-patch \
Expand Down Expand Up @@ -75,7 +76,7 @@ This package contains the API documentation for JSS.
################################################################################
%prep

%autosetup -n %{name}-%{version} -p 1 -S git
%autosetup -n %{name}-%{version}%{?_phase} -p 1 -S git

################################################################################
%build
Expand Down

0 comments on commit 209670c

Please sign in to comment.