forked from imeyer/runit-rpm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·22 lines (17 loc) · 971 Bytes
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
whereami=$(dirname $0)
readonly TOPDIR=`rpm --eval '%{_topdir}'`
if [ ! -f "/etc/rpm/macros.dist" ] && \
[ ! -f "/etc/rpm/macros.disttag" ]; then echo "please install 'buildsys-macros' rpm and try again" ; exit 1 ; fi
if [ ! -f "$(which rpmbuild)" ]; then echo "please install 'rpm-build' rpm and try again" ; exit 1 ; fi
if [ ! -f "$(which spectool)" ]; then echo "please install 'rpmdevtools' rpm and try again" ; exit 1 ; fi
if [ ! -f "$(which rpmdev-setuptree)" ]; then echo "please install 'rpmdevtools' rpm and try again" ; exit 1 ; fi
# creates build tree
/usr/bin/rpmdev-setuptree
cp -f ${whereami}/runit.spec $TOPDIR/SPECS/
cp -f ${whereami}/*.patch $TOPDIR/SOURCES/
cp -f ${whereami}/{1,2,3} $TOPDIR/SOURCES/
cp -f ${whereami}/runit.init $TOPDIR/SOURCES/
cp -f ${whereami}/runsvdir-start.service $TOPDIR/SOURCES/
/usr/bin/spectool -C $TOPDIR/SOURCES/ -g ${whereami}/runit.spec
rpmbuild -bb $TOPDIR/SPECS/runit.spec