diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2013-11-29 16:49:37 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2013-11-29 16:49:37 +0100 |
commit | 6cf5e91bfd98ebee80b8bc31f459b549a5b96f32 (patch) | |
tree | 48ebcdb63513e00370508b9e9ae471c3f01fd4fb /bin | |
parent | 6f2fd62cf4e9c0d62a01b6196f51872164c78855 (diff) | |
download | buildscripts-6cf5e91bfd98ebee80b8bc31f459b549a5b96f32.tar.gz buildscripts-6cf5e91bfd98ebee80b8bc31f459b549a5b96f32.tar.bz2 buildscripts-6cf5e91bfd98ebee80b8bc31f459b549a5b96f32.zip |
build packages with special version scheme
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/build-rpm-package | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/bin/build-rpm-package b/bin/build-rpm-package index 751217e..82b8e0a 100755 --- a/bin/build-rpm-package +++ b/bin/build-rpm-package @@ -168,14 +168,15 @@ build_packages() { cd "$PROJECT_DIR" git clone --local "$PROJECT_DIR" "$TEMP_DIR/$PROJECT/" cd $TEMP_DIR + GITREV=$(cd $PROJECT && gitrevno && cd - 1>/dev/null) rm -Rf "$PROJECT/.git" - cp $PROJECT/$PROJECT.spec . + mv $PROJECT/$PROJECT.spec . UPSTREAM_VERSION=$(cat $PROJECT.spec | egrep "^Version:.*" | awk '{ print $2 }') PKG_RELEASE=$(cat $PROJECT.spec | egrep "^Release:.*" | awk '{ print $2 }') PKG_SRCRELEASE=$(echo $PKG_RELEASE | sed -e 's/%{?dist}//') - GITREV=$(cd $PROJECT && gitrevno && cd - 1>/dev/null) + sed -i $PROJECT.spec -e "s/%{?dist}/~git$DATE.$GITREV.$COMPONENT%{?dist}/" mv $TEMP_DIR/$PROJECT $TEMP_DIR/$PROJECT-$UPSTREAM_VERSION tar -czf ~/rpmbuild/SOURCES/$PROJECT-$UPSTREAM_VERSION.tar.gz $PROJECT-$UPSTREAM_VERSION @@ -226,10 +227,10 @@ build_packages() { #fi [ "x$SKIP_ARCH" != "xx86_64" ] && { - mock -r ${l_DIST}-${l_CODENAME}-x86_64 --result $PKGDIST/$l_DIST/$l_CODENAME/x86_64 ~/rpmbuild/SRPMS/$PROJECT-$UPSTREAM_VERSION-$PKG_SRCRELEASE.src.rpm + mock -r ${l_DIST}-${l_CODENAME}-x86_64 --result $PKGDIST/$l_DIST/$l_CODENAME/x86_64 ~/rpmbuild/SRPMS/$PROJECT-$UPSTREAM_VERSION-$PKG_SRCRELEASE~git$DATE.$GITREV.$COMPONENT.src.rpm } [ "x$SKIP_ARCH" != "xi386" ] && { - mock -r ${l_DIST}-${l_CODENAME}-i386 --result $PKGDIST/$l_DIST/$l_CODENAME/i386 ~/rpmbuild/SRPMS/$PROJECT-$UPSTREAM_VERSION-$PKG_SRCRELEASE.src.rpm + mock -r ${l_DIST}-${l_CODENAME}-i386 --result $PKGDIST/$l_DIST/$l_CODENAME/i386 ~/rpmbuild/SRPMS/$PROJECT-$UPSTREAM_VERSION-$PKG_SRCRELEASE~git$DATE.$GITREV.$COMPONENT.src.rpm } done } |