Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial commit of RPM build script #48

Merged
merged 1 commit into from
Sep 13, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Initial commit of rpm build script
  • Loading branch information
tofu-rocketry committed Sep 13, 2017
commit de55dbe37ea7d6ba405b344c9553314a5d1afd10
36 changes: 36 additions & 0 deletions scripts/ssm-build-rpm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

# Execute the following as root to install build tools and create a build user:
# yum install fedora-packager
# useradd -m rpmb
# usermod -a -G mock rpmb

# Then swtich to the rpmb user (su - rpmb) and run this file, altering version.

rpmdev-setuptree

RPMDIR=/home/rpmb/rpmbuild
VERSION=2.1.7-1
SSMDIR=apel-ssm-$VERSION

# Remove old sources and RPMS
rm -f $RPMDIR/SPECS/*
rm -f $RPMDIR/SOURCES/*
rm -f $RPMDIR/SRPMS/*
rm -f $RPMDIR/RPMS/noarch/*

wget --no-check-certificate https://github.com/apel/ssm/archive/$VERSION.tar.gz -O $VERSION

tar xzvf $VERSION
rm $VERSION

mv ssm-$VERSION $SSMDIR

tar czvf $SSMDIR.tar.gz $SSMDIR
cp $SSMDIR.tar.gz $RPMDIR/SOURCES
cp $SSMDIR/apel-ssm.spec $RPMDIR/SPECS

rpmbuild -ba $RPMDIR/SPECS/apel-ssm.spec

# Clean up (note there are both leading and trailing asterisks)
rm -rf *ssm-$VERSION*