Skip to content

Instantly share code, notes, and snippets.

@kintoandar
Last active August 29, 2015 14:14
Show Gist options
  • Save kintoandar/f94924696516d492369c to your computer and use it in GitHub Desktop.
Save kintoandar/f94924696516d492369c to your computer and use it in GitHub Desktop.
#!/bin/bash
# Simple script to automate the build of RPMs
DIR='rpmbuild'
SPECFILE='*.spec'
echo "==> Cleaning $DIR"
rm -Rf ./$DIR
echo "==> Generating $DIR"
mkdir -p ./$DIR/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
echo "==> Placing files on the right path"
cp $SPECFILE ./$DIR/SPECS
cp -f * ./$DIR/SOURCES
echo "==> Downloading sources"
spectool -g $SPECFILE -C $DIR/SOURCES
echo "==> Building"
rpmbuild --clean -ba --define "_topdir $(pwd)/$DIR" ./$DIR/SPECS/$SPECFILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment