2011-03-03 08:40:58 +00:00
|
|
|
sit_fail() {
|
2011-03-03 13:07:56 +00:00
|
|
|
msg="Fail: $1"
|
|
|
|
echo "$msg"
|
|
|
|
exit 1
|
2011-03-03 08:40:58 +00:00
|
|
|
}
|
|
|
|
sit_info() {
|
2011-03-03 13:07:56 +00:00
|
|
|
msg=$1
|
2011-03-03 08:40:58 +00:00
|
|
|
echo $msg
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
sit_countdown() {
|
|
|
|
local tt=$1
|
2011-03-04 15:53:49 +00:00
|
|
|
for i in $(seq $tt -1 1); do
|
2011-03-03 08:40:58 +00:00
|
|
|
echo -n "$i "
|
|
|
|
sleep 1
|
|
|
|
done
|
|
|
|
echo
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
unpack() {
|
|
|
|
if [ ! -e ${SRC_POOL}/${A} ] ; then
|
|
|
|
sit_fail "${SRC_POOL}/${A} doesn't exist"
|
|
|
|
fi
|
|
|
|
case "${A##*.}" in
|
|
|
|
bz2)
|
2011-09-20 16:25:10 +00:00
|
|
|
tar xjf ${SRC_POOL}/${A} || sit_fail
|
2011-03-03 08:40:58 +00:00
|
|
|
;;
|
|
|
|
gz|tgz)
|
2011-09-20 16:25:10 +00:00
|
|
|
tar xzf ${SRC_POOL}/${A} || sit_fail
|
2011-03-03 08:40:58 +00:00
|
|
|
;;
|
|
|
|
xz)
|
2011-09-20 16:25:10 +00:00
|
|
|
tar xJf ${SRC_POOL}/${A} || sit_fail
|
2011-03-03 08:40:58 +00:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
sit_fail "Archive format not recogized"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
src_unpack() {
|
|
|
|
unpack
|
|
|
|
}
|
|
|
|
sit_unpack() {
|
|
|
|
sit_info "Unpacking sources ..."
|
|
|
|
cd ${WORKDIR}
|
2011-03-03 13:07:56 +00:00
|
|
|
src_unpack
|
2011-03-03 08:40:58 +00:00
|
|
|
}
|
|
|
|
|
2011-03-23 14:17:32 +00:00
|
|
|
|
|
|
|
src_prepare() {
|
|
|
|
/bin/true
|
|
|
|
}
|
|
|
|
sit_prepare() {
|
|
|
|
sit_info "Preparing sources"
|
|
|
|
cd ${SRCDIR}
|
|
|
|
src_prepare || sit_fail "Preparing sources failed"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-03-03 08:40:58 +00:00
|
|
|
src_configure() {
|
|
|
|
${SRCDIR}/configure --prefix=$PREFIX $CONFIGURE_OPTS
|
2011-03-23 11:27:26 +00:00
|
|
|
if [ ! -z $LOGDIR ] ; then
|
|
|
|
cp config.log $LOGDIR
|
|
|
|
fi
|
2011-03-03 08:40:58 +00:00
|
|
|
}
|
|
|
|
sit_configure() {
|
|
|
|
sit_info "Configuring sources ..."
|
|
|
|
cd ${BUILDDIR}
|
|
|
|
src_configure || sit_fail "Configure failed"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
src_build() {
|
|
|
|
make $MAKEOPTS
|
|
|
|
}
|
|
|
|
sit_build() {
|
|
|
|
sit_info "Building sources ..."
|
|
|
|
cd ${BUILDDIR}
|
|
|
|
src_build || sit_fail "Build failed"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
src_pretest() {
|
|
|
|
/bin/true
|
|
|
|
}
|
|
|
|
sit_pretest() {
|
|
|
|
sit_info "Running pre installation tests ..."
|
|
|
|
cd ${BUILDDIR}
|
|
|
|
src_pretest || sit_fail "Pre installation tests failed"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
src_posttest() {
|
|
|
|
/bin/true
|
|
|
|
}
|
|
|
|
sit_posttest() {
|
|
|
|
sit_info "Running post installation tests ..."
|
|
|
|
cd ${BUILDDIR}
|
|
|
|
src_posttest || sit_fail "Post installation tests failed"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
src_install() {
|
|
|
|
make install
|
|
|
|
}
|
|
|
|
sit_install() {
|
|
|
|
sit_info "Installing package ..."
|
|
|
|
cd ${BUILDDIR}
|
|
|
|
src_install || sit_fail "Install failed"
|
|
|
|
}
|
|
|
|
|
|
|
|
sit_copy_logs() {
|
|
|
|
cd $LOGDIR
|
|
|
|
bzip2 *.log
|
|
|
|
cp $LOGDIR/*.bz2 $PREFIX
|
|
|
|
}
|
|
|
|
|
|
|
|
src_setperms() {
|
|
|
|
chmod -R g+rwX $PREFIX
|
|
|
|
chmod -R o+rX $PREFIX
|
|
|
|
}
|
|
|
|
sit_setperms() {
|
|
|
|
sit_info "Setting proper permissions"
|
|
|
|
src_setperms || sit_fail "Could not set permissions"
|
|
|
|
}
|
|
|
|
|
2011-08-19 09:18:16 +00:00
|
|
|
sit_sitinfo() {
|
|
|
|
local SIT_VERSION="unknown"
|
|
|
|
if [ "$(svnversion $SIT_PATH)" != "exported" ] ; then
|
|
|
|
sit_info "SVN"
|
|
|
|
SIT_VERSION="svn-r$(svnversion $SIT_PATH)"
|
|
|
|
elif [ git svn find-rev r1 ] ; then
|
|
|
|
sit_info "GIT"
|
|
|
|
SIT_VERSION="$(cd $SIT_PATH; git svn find-rev HEAD) (git svn)";
|
|
|
|
else
|
|
|
|
SIT_VERSION="unknown"
|
|
|
|
fi
|
|
|
|
echo "Invocation: $(ps --pid $$ -o cmd | tail -n 1)"
|
|
|
|
echo "Started: $(date)"
|
|
|
|
echo "Version: $SIT_VERSION"
|
|
|
|
echo "Environment:"
|
|
|
|
echo "------------------------------------------------------------------------------"
|
|
|
|
env
|
|
|
|
echo "------------------------------------------------------------------------------"
|
|
|
|
}
|