Legacy build scripts, not maintained nor used anymore
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.5 KiB

13 years ago
#!/bin/bash
PACKAGE=$(basename $(pwd))
VERSION=$(rpm -q --qf "%{version}" --specfile $PACKAGE.spec)
ME=$(whoami)
BRANCH=$(git branch | grep '*' | cut -d' ' -f2)
13 years ago
DIST=$1
if [ -z $DIST ]; then
DIST="el5"
fi
TMPDIR=$(mktemp -d)
mkdir -p $TMPDIR/$PACKAGE-$VERSION/
# Tag GIT using the version in the spec file
git tag $VERSION 2>&1 > /dev/null
# Create needed dirs on the build box
13 years ago
ssh -l $ME build.firewall-services.com mkdir -p rpmbuild/{RPMS,SRPMS,SPECS,SOURCES}
# Generate a tgz archive from the repo
git archive --format=tar --prefix=$PACKAGE-$VERSION/ $BRANCH | tar xf - -C $TMPDIR
# Generate ChangeLog
git log --format=%H | git log --pretty --stdin --no-walk > $TMPDIR/$PACKAGE-$VERSION/CHANGELOG.git
#tar cz -C $TMPDIR $PACKAGE-$VERSION | ssh -l $ME build.firewall-services.com "cat > rpmbuild/SOURCES/$PACKAGE-$VERSION.tar.gz"
tar czf $TMPDIR/$PACKAGE-$VERSION.tar.gz -C $TMPDIR $PACKAGE-$VERSION
scp -C $TMPDIR/$PACKAGE-$VERSION.tar.gz $ME@build.firewall-services.com:rpmbuild/SOURCES/$PACKAGE-$VERSION.tar.gz
# Upload the spec file
13 years ago
scp $PACKAGE.spec $ME@build.firewall-services.com:rpmbuild/SPECS/
# And build
13 years ago
ssh -l $ME build.firewall-services.com rpmbuild -bs --nodeps rpmbuild/SPECS/$PACKAGE.spec
13 years ago
ssh -l $ME build.firewall-services.com buildrpm rpmbuild/SRPMS/$PACKAGE-$VERSION-*.src.rpm $DIST
13 years ago
ssh -l $ME build.firewall-services.com rm -f rpmbuild/SPECS/$PACKAGE.spec rpmbuild/SOURCES/$PACKAGE-$VERSION.tar.gz rpmbuild/SRPMS/$PACKAGE-$VERSION*.src.rpm
rm -rf $TMPDIR