summaryrefslogtreecommitdiff
path: root/bin/build-rpm-package
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2014-10-11 11:24:21 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2014-10-11 11:25:37 +0200
commitf7895e3ef476561d859b43fe65025c1318594341 (patch)
tree9c416b0a37a169ff1f5fef9fdb4ac7c43e3e1a24 /bin/build-rpm-package
parent22bcff7f8301a35f3231bc08a38c19358b15cc3b (diff)
downloadbuildscripts-f7895e3ef476561d859b43fe65025c1318594341.tar.gz
buildscripts-f7895e3ef476561d859b43fe65025c1318594341.tar.bz2
buildscripts-f7895e3ef476561d859b43fe65025c1318594341.zip
first approach to build opensuse RPMs
Diffstat (limited to 'bin/build-rpm-package')
-rwxr-xr-xbin/build-rpm-package35
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