forked from vixie/cron
-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_rpm
executable file
·49 lines (49 loc) · 1.01 KB
/
create_rpm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/sh
if [ -n $PWD ] ; then
d=$(basename $PWD)
else
d=$(basename `pwd`)
fi
if [ ! -f conf-version ] ; then
echo "conf-version: No such file or directory" 1>&2
exit 1
fi
version=$(cat conf-version)
/bin/rm -rf $HOME/stage/$d-$version
mkdir -p $HOME/stage/$d-$version
cp -rp . $HOME/stage/$d-$version
cd $HOME/stage/$d-$version
if [ $? -ne 0 ] ; then
exit 1
fi
make svcron.spec
make clean
make distclean
if test -f $HOME/.rpmmacros
then
topdir=`grep ^%_topdir $HOME/.rpmmacros | awk '{print $2}'`
if test -n "$topdir"
then
rpmbuild=$topdir
else
rpmbuild=$HOME/rpmbuild
fi
else
rpmbuild=$HOME/rpmbuild
fi
/bin/rm -rf autom4te.cache
cd ..
tar \
--exclude="svcron-$version/.git" \
--exclude="svcron-$version/RCS" \
--exclude="svcron-$version/debian" \
--exclude="svcron-$version/crontabs" \
-cf - svcron-$version | gzip -c > $rpmbuild/SOURCES/svcron-$version.tar.gz
cd svcron-$version
rpmbuild -bb svcron
if test $# -eq 1
then
rpmbuild -bb --clean --target $1 svcron.spec
else
rpmbuild -bb --clean svcron.spec
fi