Skip to content

Instantly share code, notes, and snippets.

@tlatsas
Created November 29, 2013 12:13
Show Gist options
  • Save tlatsas/7704857 to your computer and use it in GitHub Desktop.
Save tlatsas/7704857 to your computer and use it in GitHub Desktop.
build each package in its own rpmbuild folder
#!/bin/bash
if [[ -z $1 ]]; then
echo "usege: $0 new|link <build>";
exit 1
fi
if [[ -z $2 ]]; then
echo "build name required"
exit 2
fi
if [[ "$1" == "new" ]]
then
echo "Creating rpmbuild tree under: ~/rpmbuild-$2"
mkdir -p ~/rpmbuild-$2/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
ln -nsf ~/rpmbuild-$2 ~/rpmbuild
elif [[ "$1" == "link" ]]
then
echo "Linking rpmbuild tree: ~/rpmbuild-$2"
ln -nsf ~/rpmbuild-$2 ~/rpmbuild
else
echo "unkown command $1"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment