-
Notifications
You must be signed in to change notification settings - Fork 14
/
build_rpms
executable file
·24 lines (18 loc) · 784 Bytes
/
build_rpms
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env bash
#this must be run from the root directory of the repo
#this assumes you're setup to build rpms in ~/rpmbuild/ (the default in CentOS 6)
#make this match the spec!!!
version=0.0.2
trap "rm -fr '/tmp/$USER/slurmmon-$version'" EXIT
mkdir -p "/tmp/$USER/slurmmon-$version"
rsync -av \
--exclude /slurmmon*.tar.bz2 \
--exclude /RPMS/ \
--exclude /.git/ \
--exclude /lib/python/site-packages/slurmmon/*.pyc \
./ "/tmp/$USER/slurmmon-$version/"
tar --owner root --group root --numeric-owner -cjvf slurmmon-"$version".tar.bz2 -C /tmp/"$USER" slurmmon-"$version"
/bin/cp -af slurmmon-"$version".tar.bz2 ~/rpmbuild/SOURCES/
rpmbuild -ba --target=noarch slurmmon.spec
/bin/cp -af ~/rpmbuild/RPMS/noarch/slurmmon* RPMS/
/bin/cp -af ~/rpmbuild/SRPMS/slurmmon* RPMS/