From 6cf5e91bfd98ebee80b8bc31f459b549a5b96f32 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Fri, 29 Nov 2013 16:49:37 +0100 Subject: build packages with special version scheme --- bin/build-rpm-package | 9 +++++---- 1 file 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 } -- cgit v1.2.3