1 |
#!/bin/sh |
#!/bin/sh |
2 |
|
|
3 |
# This script attempts to build .deb, .rpm and .tar.gz packages from |
# This script attempts to build .rpm packages from |
4 |
# the bubblemon. |
# the bubblemon. |
5 |
|
|
6 |
# FIXME: This script is extremely non-portable and is only guaranteed |
# Is totaly unportable. |
|
# to work at Johan's place. Portability enhancements are greatly |
|
|
# appreciated, send them to d92-jwa@nada.kth.se. |
|
|
|
|
|
# FIXME: This script will erase files in your RPM_SOURCES directory, |
|
|
# in your BUBBLEMON_ROOT directory and in your RPMS directory. For |
|
|
# this script to ever get any good it should probably be rewritten in |
|
|
# some real scripting language. |
|
|
|
|
|
# FIXME: If you don't have write permissions in your RPM_SOURCES |
|
|
# directory, in your BUBBLEMON_ROOT directory or in your RPMS |
|
|
# directory, I don't know what happens. |
|
7 |
|
|
8 |
BUBBLEMON_ROOT=/home/rael/bubbletest |
CURRENT_VERSION=bubblemon-2.0.0.tar.gz |
9 |
RPM_SOURCES=/usr/src/redhat/SOURCES |
RPM_SOURCES=/usr/src/redhat/SOURCES |
10 |
RPM_SRPMS=/usr/src/redhat/SRPMS |
RPM_SRPMS=/usr/src/redhat/SRPMS |
11 |
|
|
12 |
# See to that we are in the root bubblemon directory |
if [ ! -f $RPM_SOURCES/$CURRENT_VERSION ] ; then |
13 |
if [ `pwd` != $BUBBLEMON_ROOT ] ; then |
cat <<EOF |
14 |
cat <<EOF |
This script ($0) needs that the tar.gz exists in the $RPM_SOURCES directory to work. |
15 |
This script ($0) works only when started from the directory in the |
Please fix this problem and try again. |
|
\$BUBBLEMON_ROOT variable (currently $BUBBLEMON_ROOT). |
|
|
|
|
|
The \$BUBBLEMON_ROOT variable can be configured at the top of this |
|
|
script. It must *not* end with a slash (/). |
|
16 |
EOF |
EOF |
|
|
|
17 |
exit 1 |
exit 1 |
18 |
fi |
fi |
19 |
|
|
33 |
exit 1 |
exit 1 |
34 |
fi |
fi |
35 |
|
|
36 |
# Build a source package |
rpm -bs bubblemon.spec |
|
make -j2 dist |
|
|
if [ $? != 0 ] ; then |
|
|
echo Error: Source package building failed > /dev/stderr |
|
|
exit 1 |
|
|
fi |
|
|
|
|
|
# Build an RPM |
|
|
rm -f bubblemon-*.tar.gz |
|
|
make -j2 dist |
|
|
if [ $? != 0 ] ; then |
|
|
echo Error: Source package building failed > /dev/stderr |
|
|
exit 1 |
|
|
fi |
|
|
ln -s $BUBBLEMON_ROOT/bubblemon-*.tar.gz $RPM_SOURCES |
|
|
rpm -bs packaging/bubblemon.spec |
|
37 |
if [ $? != 0 ] ; then |
if [ $? != 0 ] ; then |
38 |
echo Error: RPM package building failed > /dev/stderr |
echo Error: RPM package building failed > /dev/stderr |
|
rm -f bubblemon-*.tar.gz $RPM_SOURCES/bubblemon-*.tar.gz |
|
39 |
exit 1 |
exit 1 |
40 |
fi |
fi |
41 |
|
|