diff options
Diffstat (limited to 'bin/build-rpm-package')
-rwxr-xr-x | bin/build-rpm-package | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/bin/build-rpm-package b/bin/build-rpm-package index c1efa60..d7e1cc7 100755 --- a/bin/build-rpm-package +++ b/bin/build-rpm-package @@ -37,6 +37,8 @@ REPOS_SERVER="packages.mydomain.org" PACKAGES_WITHOUT_OTHERMIRROR="keyring" GNUPGHOME=$HOME/.gnupg +OPENSUSE_DOWNLOAD_URL="http://download.opensuse.org/distribution/#VERSION#/repo/oss/suse/" + test -z $1 && { echo "usage: $(basename $0) [<subpath>/]<git-project> {main,main/<codename>,nightly,nightly/<codename>} [<git-checkout>]"; exit -1; } PREFIX=$(echo `basename $0` | cut -d"-" -f1) @@ -226,17 +228,30 @@ build_packages() { if [ "x$SKIP_ARCH" != "xx86_64" ] || [ "$IS_NOARCH" = "yes" ]; then rm -f $PKGDIST/$l_DIST/$l_CODENAME/x86_64/build.log - while [ -d ~mock/${l_DIST}-${l_CODENAME}-x86_64 ]; do - echo "Waiting for some other build to finish..." - sleep 30 - done - if mock -r ${l_DIST}-${l_CODENAME}-x86_64 --result $PKGDIST/$l_DIST/$l_CODENAME/x86_64 $PKGDIST/$l_DIST/$l_CODENAME/$l_ARCH/rpmbuild/SRPMS/$PROJECT-$UPSTREAM_VERSION-$PKG_SRCRELEASE.$IS_RELEASE.git$DATE.$GITREV.$COMPONENT.src.rpm; then - rpmsign-unattended -D "%_gpg_name debian@x2go.org" --addsign $PKGDIST/$l_DIST/$l_CODENAME/x86_64/*.rpm - cat $PKGDIST/$l_DIST/$l_CODENAME/x86_64/build.log + if [ "x$PKGDIST" = "xopensuse"]; then + mkdir -p "/var/cache/obs-build/$PKGDIST/$l_DIST/$l_CODENAME/x86_64/" + OPENSUSE_DOWNLOAD_URL=$(echo "$OPENSUSE_DOWNLOAD_URL" | sed 's/#VERSION#/$l_DIST/') + if obs-build --repo "$OPENSUSE_DOWNLOAD_URL" \ + --root "/var/cache/obs-build/$PKGDIST/$l_DIST/$l_CODENAME/x86_64/" \ + $PKGDIST/$l_DIST/$l_CODENAME/$l_ARCH/rpmbuild/SRPMS/$PROJECT-$UPSTREAM_VERSION-$PKG_SRCRELEASE.$IS_RELEASE.git$DATE.$GITREV.$COMPONENT.src.rpm; then + rpmsign-unattended -D "%_gpg_name debian@x2go.org" --addsign $PKGDIST/$l_DIST/$l_CODENAME/x86_64/*.rpm + else + rm -Rf "$TEMP_DIR" + exit -1 + fi else - cat $PKGDIST/$l_DIST/$l_CODENAME/x86_64/build.log - rm -Rf "$TEMP_DIR" - exit -1 + while [ -d ~mock/${l_DIST}-${l_CODENAME}-x86_64 ]; do + echo "Waiting for some other build to finish..." + sleep 30 + done + if mock -r ${l_DIST}-${l_CODENAME}-x86_64 --result $PKGDIST/$l_DIST/$l_CODENAME/x86_64 $PKGDIST/$l_DIST/$l_CODENAME/$l_ARCH/rpmbuild/SRPMS/$PROJECT-$UPSTREAM_VERSION-$PKG_SRCRELEASE.$IS_RELEASE.git$DATE.$GITREV.$COMPONENT.src.rpm; then + rpmsign-unattended -D "%_gpg_name debian@x2go.org" --addsign $PKGDIST/$l_DIST/$l_CODENAME/x86_64/*.rpm + cat $PKGDIST/$l_DIST/$l_CODENAME/x86_64/build.log + else + cat $PKGDIST/$l_DIST/$l_CODENAME/x86_64/build.log + rm -Rf "$TEMP_DIR" + exit -1 + fi fi fi if [ "x$SKIP_ARCH" != "xi386" ] && [ "$IS_NOARCH" != "yes" ]; then |