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)
|
|
|
|
tar xfjv ${SRC_POOL}/${A} || sit_fail
|
|
|
|
;;
|
|
|
|
gz|tgz)
|
|
|
|
tar xfzv ${SRC_POOL}/${A} || sit_fail
|
|
|
|
;;
|
|
|
|
xz)
|
|
|
|
tar xfJv ${SRC_POOL}/${A} || sit_fail
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
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
|
|
|
}
|
|
|
|
|
|
|
|
src_configure() {
|
|
|
|
${SRCDIR}/configure --prefix=$PREFIX $CONFIGURE_OPTS
|
|
|
|
cp config.log $LOGDIR
|
|
|
|
}
|
|
|
|
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"
|
|
|
|
}
|
|
|
|
|
|
|
|
|