diff options
Diffstat (limited to 'net')
-rwxr-xr-x | net/mail/mhonarc/MHonArc.build | 25 | ||||
-rwxr-xr-x | net/mail/sympa/sympa.SlackBuild | 26 |
2 files changed, 24 insertions, 27 deletions
diff --git a/net/mail/mhonarc/MHonArc.build b/net/mail/mhonarc/MHonArc.build index 0e9f9466..9c2fd7d9 100755 --- a/net/mail/mhonarc/MHonArc.build +++ b/net/mail/mhonarc/MHonArc.build @@ -2,9 +2,6 @@ # # build script for MHonArc # by rhatto at riseup.net by rhatto | gpl -# build it with slacktrack, example: -# -# slacktrack -jefkzp "MHonArc-2.6.15-noarch-1rha.tgz" "./MHonArc.build" # CWD="`pwd`" @@ -27,6 +24,12 @@ BUILD=${BUILD:=1rha} SRC_DIR=${SRC:=$CWD} PREFIX="/usr/local" +# ------- error codes for createpkg -------------- +ERROR_WGET=31; ERROR_MAKE=32; ERROR_INSTALL=33 +ERROR_MD5=34; ERROR_CONF=35; ERROR_HELP=36 +ERROR_TAR=37; ERROR_MKPKG=38; ERROR_GPG=39 +ERROR_PATCH=40 + RTOOL="wget" PACKAGE_EXT="gz" SRC="$PACKAGE-$VERSION.tar.$PACKAGE_EXT" @@ -74,17 +77,11 @@ fi if [ "$RTOOL" == "wget" ] && [ ! -f "$SRC_DIR/$SRC" ]; then rm -f $SRC_DIR/$SRC $SRC_DIR/$SRC.sig - wget "$URL" -O "$SRC_DIR/$SRC" - wget "$URL.sig" -O "$SRC_DIR/$SRC.sig" + wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET + wget "$URL.sig" -O "$SRC_DIR/$SRC.sig" || exit $ERROR_WGET fi -gpg --verify $SRC_DIR/$SRC.asc $SRC_DIR/$SRC || echo WARNING: Could not check signature or WRONG signature found. - -if [ "$PACKAGE_EXT" == "bz2" ]; then - tarflag="j" -else - tarflag="z" -fi +gpg --verify $SRC_DIR/$SRC.asc $SRC_DIR/$SRC || exit $ERROR_GPG TMP="$TMP/$PACKAGE" @@ -94,10 +91,10 @@ fi cd $TMP -tar xvf$tarflag $SRC_DIR/$SRC +tar xvf $SRC_DIR/$SRC || exit $ERROR_TAR cd $PACKAGE-$VERSION -perl install.me -batch +perl install.me -batch || exit $ERROR_INSTALL mkdir -p /usr/doc/$PACKAGE diff --git a/net/mail/sympa/sympa.SlackBuild b/net/mail/sympa/sympa.SlackBuild index 340937d1..4e13fd5c 100755 --- a/net/mail/sympa/sympa.SlackBuild +++ b/net/mail/sympa/sympa.SlackBuild @@ -33,6 +33,12 @@ SRC_DIR=${SRC:=$CWD} TMP=${TMP:=/tmp} REPOS=${REPOS:=$TMP} +# ------- error codes for createpkg -------------- +ERROR_WGET=31; ERROR_MAKE=32; ERROR_INSTALL=33 +ERROR_MD5=34; ERROR_CONF=35; ERROR_HELP=36 +ERROR_TAR=37; ERROR_MKPKG=38; ERROR_GPG=39 +ERROR_PATCH=40 + if ! grep -qe "^$PACKAGE:" /etc/passwd || ! grep -qe "^$PACKAGE:" /etc/group; then echo "WARNING: user and/or group $PACKAGE does not exist" echo "Create it manually with \"groupadd $PACKAGE ; useradd $PACKAGE -g $PACKAGE\" and run this script again." @@ -50,17 +56,11 @@ PACKAGE_EXT="gz" SRC="$PACKAGE-$VERSION.tar.$PACKAGE_EXT" URL="http://www.sympa.org/distribution/$SRC" -if [ "$PACKAGE_EXT" == "bz2" ]; then - tarflag="j" -else - tarflag="z" -fi - SRC_DIR="$SRC_DIR/$PACKAGE" mkdir -p $SRC_DIR if [ "$RTOOL" == "wget" ] && [ ! -f "$SRC_DIR/$SRC" ]; then - wget "$URL" -O "$SRC_DIR/$SRC" + wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET fi TMP="$TMP/$PACKAGE" @@ -68,12 +68,12 @@ rm -rf $TMP mkdir -p $TMP cd $TMP -tar xvf$tarflag $SRC_DIR/$SRC +tar xvf $SRC_DIR/$SRC || exit $ERROR_TAR cd $PACKAGE-$VERSION ./configure --with-initdir=/etc/rc.d/ --prefix=/usr/local/sympa --with-confdir=/usr/local/sympa/conf \ - --with-etcdir=/usr/local/sympa/etc -make || exit 32 -make DESTDIR=$TMP/package-$PACKAGE install | tee $TMP/package-$PACKAGE/install.log + --with-etcdir=/usr/local/sympa/etc || exit $ERROR_CONF +make || exit $ERROR_MAKE +make DESTDIR=$TMP/package-$PACKAGE install | tee $TMP/package-$PACKAGE/install.log || exit $ERROR_INSTALL CWD="`pwd`" @@ -131,9 +131,9 @@ echo '( chroot . /usr/bin/chown -R sympa.sympa /usr/local/sympa /var/mail/sympa echo '( touch /var/log/sympa)' >> install/doinst.sh # echo '( chmod +s /usr/local/sympa/bin/queue )' >> install/doinst.sh -makepkg -c y -l y $REPOS/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz +makepkg -c y -l y $REPOS/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz || exit $ERROR_MKPKG -echo "Package creation complete. PLEASE check if everything was ok." +echo "Package creation complete. PLEASE check if everything is fine." echo "Log files at $TMP/package-$PACKAGE/install.log" if [ "$CLEANUP" == "yes" ]; then |