aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xapp/admin/hddtemp/hddtemp.SlackBuild291
-rwxr-xr-xsys/apps/simplepkg/simplepkg.SlackBuild209
2 files changed, 328 insertions, 172 deletions
diff --git a/app/admin/hddtemp/hddtemp.SlackBuild b/app/admin/hddtemp/hddtemp.SlackBuild
index b0e82e4c..a9b61f7f 100755
--- a/app/admin/hddtemp/hddtemp.SlackBuild
+++ b/app/admin/hddtemp/hddtemp.SlackBuild
@@ -1,144 +1,184 @@
#!/bin/bash
#
-# hddtemp.SlackBuild is free software; you can redistribute it and/or modify it under the
-# terms of the GNU General Public License as published by the Free Software
-# Foundation; either version 2 of the License, or any later version.
+# hddtemp.SlackBuild is free software; you can redistribute
+# it and/or modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of the License,
+# or any later version.
#
-# hddtemp.SlackBuild is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
-# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+# hddtemp.SlackBuild is distributed in the hope that it will
+# be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+# Public License for more details.
#
-# You should have received a copy of the GNU General Public License along with
-# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-# Place - Suite 330, Boston, MA 02111-1307, USA
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
#
# slackbuild for hddtemp, by Rudson R. Alves
-# requires: none
-# tested: hddtemp-0.3-beta12
-
-CWD=`pwd`
+# requires:
+# tested: hddtemp-0.3-beta15
+#
-# ---- Inicializa variáveis com o slackbuild ------------
-if [ -e ~/.slackbuildrc ]; then
+# Look for slackbuildrc
+if [ -f ~/.slackbuildrc ]; then
source ~/.slackbuildrc
-elif [ -e /etc/slackbuildrc ]; then
+elif [ -f /etc/slackbuildrc ]; then
source /etc/slackbuildrc
fi
-# -------- Variáveis de controle de versão --------------
-# Nome da fonte para a qual o slackbuild foi construído e
-# o seu md5sum
-SRC_ORIG="hddtemp-0.3-beta15.tar.bz2"
-MD5_ORIG="8b829339e1ae9df701684ec239021bb8"
-PACKAGE_ORIG=`echo $SRC_ORIG | sed -r 's/(.*)-(.*)-(.*)\.(.*\..*)/\1/'`
-VERSION_ORIG=`echo $SRC_ORIG | sed -r 's/(.*)-(.*)-(.*)\.(.*\..*)/\2/'`
- REVISION=`echo $SRC_ORIG | sed -r 's/(.*)-(.*)-(.*)\.(.*\..*)/\3/'`
- EXTENSION=`echo $SRC_ORIG | sed -r 's/(.*)-(.*)-(.*)\.(.*\..*)/\4/'`
-
-# ------- Códigos de erro para o 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; ERROR_VCS=41
-
-# --------- Inicializa variáveis de entrada -------------
-PACKAGE=$PACKAGE_ORIG
+# Set variables
+CWD="$(pwd)"
+SRC_NAME="hddtemp"
+PKG_NAME="hddtemp"
ARCH=${ARCH:=i486}
-SRC_DIR=${SRC:=$CWD}
-VERSION=${VERSION:=$VERSION_ORIG}
-SRC=$PACKAGE-$VERSION-$REVISION.$EXTENSION
-BUILD=${BUILD:=1rud}
+SRC_VERSION=${VERSION:=0.3-beta15}
+PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')"
+BUILD=${BUILD:=1srv}
+SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME
TMP=${TMP:=/tmp}
+PKG=${PKG:=$TMP/package-$PKG_NAME}
REPOS=${REPOS:=$TMP}
PREFIX=${PREFIX:=/usr}
-OPTCONF=${OPTCONF:=""}
-MD5=${MD5:=$MD5_ORIG}
-URL=${URL:="http://www.guzu.net/files/$SRC"}
-
-# ---------------- Download fontes ----------------------
-# Fonte a ser compilada, com o path
-SOURCE=$SRC_DIR/$PACKAGE/$SRC
-# Verifica existência do pacote em $SRC em $SRC_DIR
-if [ ! -e $SOURCE ]; then
- wget "$URL" -P "$SRC_DIR/$PACKAGE" || exit $ERROR_WGET
-fi
+PKG_WORK="$TMP/$SRC_NAME"
+CONF_OPTIONS=${CONF_OPTIONS:=""}
+NUMJOBS=${NUMJOBS:="-j4"}
-# ------------------ Checa md5sum -----------------------
-if [ "$SRC_ORIG" = "$SRC" -o "$MD5" != "$MD5_ORIG" -a "$MD5" != "no" ]; then
- SUM=`md5sum $SOURCE | awk '{print $1}'`
- [ "$SUM" != "$MD5" ] && exit $ERROR_MD5
-fi
+# Set system libraries' path and optmization flags based on $ARCH
+LIBDIR="$PREFIX/lib"
-# ----------------- ARCH e LIBDIR -----------------------
-# Libdir, para arch x86_64
-LIBDIR=$PREFIX/lib
-# Seleciona flags para o compilador
if [ "$ARCH" = "i386" ]; then
- SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
+ SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
elif [ "$ARCH" = "i486" ]; then
- SLKCFLAGS="-O2 -march=i486 -mcpu=i686"
+ SLKCFLAGS="-O2 -march=i486 -mcpu=i686"
elif [ "$ARCH" = "i686" ]; then
- SLKCFLAGS="-O2 -march=i686"
+ SLKCFLAGS="-O2 -march=i686"
elif [ "$ARCH" = "s390" ]; then
- SLKCFLAGS="-O2"
+ SLKCFLAGS="-O2"
elif [ "$ARCH" = "x86_64" ]; then
- SLKCFLAGS="-O2"
- LIBDIR="$PREFIX/lib64"
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIR="$PREFIX/lib64"
+ LDFLAGS="-L/lib64 -L/usr/lib64"
+fi
+
+# Set error codes (used by 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; ERROR_VCS=41; ERROR_MKDIR=42
+
+# Clean up any leftovers of previous builds
+rm -rf "$PKG_WORK" 2> /dev/null
+rm -rf "$PKG" 2> /dev/null
+
+# Create directories if necessary
+mkdir -p "$SRC_DIR" || exit $ERROR_MKDIR
+mkdir -p "$PKG" || exit $ERROR_MKDIR
+mkdir -p "$REPOS" || exit $ERROR_MKDIR
+mkdir -p "$PKG_WORK" || exit $ERROR_MKDIR
+
+# Dowload source if necessary
+SRC="$SRC_NAME-$VERSION.tar.bz2"
+URL="http://download.savannah.gnu.org/releases/hddtemp/$SRC"
+
+if [ ! -s "$SRC_DIR/$SRC" ] || ! bunzip2 -t "$SRC_DIR/$SRC" 2> /dev/null; then
+ wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET
fi
-# -------------- Desempacota fontes ---------------------
-# Desempacota fontes em PKG_SRC=$TMP/$PACKAGE-source
-PKG_SRC=$TMP/$PACKAGE-source
-rm -rf $PKG_SRC 2>/dev/null
-mkdir -p $PKG_SRC
-# Desempacota $SOURCE em $TMP/$PACKAGE-source
-tar xvf $SOURCE -C $PKG_SRC || exit $ERROR_TAR
-
-# Pega o nome do diretório das fontes independente de sua
-# estrutura (package-version...)
-PKG_DIR="$PKG_SRC/$( ls $PKG_SRC/ )"
-cd $PKG_DIR
-
-# -------------- Configura programa ---------------------
-# Configura programa
-CFLAGS="$SLKCFLAGS" ./configure --prefix=$PREFIX --libdir=$LIBDIR $OPTCONF || exit $ERROR_CONF
-
-# ---------------- Compila programa ---------------------
-make -j3 || exit $ERROR_MAKE
-
-# ------------- Diretório Temporário --------------------
-# Cria diretório temporário para construção do pacote
-PKG=$TMP/$PACKAGE
-rm -rf $PKG
-mkdir -p $PKG
-
-# --------------- Instala programa ----------------------
-# Instala programa em diretório temporário
-make install DESTDIR=$PKG || exit $ERROR_INSTALL
-
-# Get the last hddtemp.db file
-cd $PKG
-mkdir -p usr/share/misc
-cd usr/share/misc/
-wget http://www.guzu.net/linux/hddtemp.db
-
-# ----------------- Stripa código -----------------------
-cd $PKG
-find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
-find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
-
-# ---------------- Cria slack-desc ----------------------
-mkdir $PKG/install
-cat << EOF > install/slack-desc
+# Import minimized signing key from
+if echo [[SIGNING KEY URL]] | grep -q -v "SIGNING KEY URL"; then
+ lynx -dump [[SIGNING KEY URL]] | gpg --import || exit $ERROR_GPG
+elif echo [[SIGNING KEY ID]] | grep -q -v "SIGNING KEY ID"; then
+ gpg --recv-keys [[SIGNING KEY ID]] || exit $ERROR_GPG
+else
+ gpg --import << EOKEY || exit $ERROR_GPG
+[[SIGNING KEY]]
+EOKEY
+fi
+
+# Download source's signature if necessary and check it
+if echo http://download.savannah.gnu.org/releases/hddtemp | grep -q -v "SIGNING URL"; then
+ SIGNATURE="`basename http://download.savannah.gnu.org/releases/hddtemp`"
+ if [ ! -s "$SRC_DIR/$SIGNATURE" ]; then
+ wget "http://download.savannah.gnu.org/releases/hddtemp" -O "$SRC_DIR/$SIGNATURE" || exit $ERROR_WGET
+ fi
+else
+ if [ -s "$SRC_DIR/$SRC.sig" ]; then
+ SIGNATURE="$SRC.sig"
+ elif [ -s "$SRC_DIR/$SRC.asc" ]; then
+ SIGNATURE="$SRC.asc"
+ else
+ echo Trying to get signature file from $URL.sig...
+ if wget "$URL.sig" -O "$SRC_DIR/$SRC.sig"; then
+ SIGNATURE="$SRC.sig"
+ else
+ rm $SRC_DIR/$SRC.sig
+ echo Trying to get signature file from $URL.asc...
+ if wget "$URL.asc" -O "$SRC_DIR/$SRC.asc"; then
+ SIGNATURE="$SRC.asc"
+ else
+ rm $SRC_DIR/$SRC.asc
+ echo "Error getting source's signature file"
+ exit $ERROR_GPG
+ fi
+ fi
+ fi
+fi
+
+echo Checking $SRC_DIR/$SRC with gpg using $SRC_DIR/$SIGNATURE...
+gpg --verify "$SRC_DIR/$SIGNATURE" "$SRC_DIR/$SRC" || exit $ERROR_GPG
+echo Success.
+
+# Untar
+cd "$PKG_WORK"
+tar --no-same-owner --no-same-permissions -xvf "$SRC_DIR/$SRC" || exit $ERROR_TAR
+PKG_SRC="$PWD/`ls -l | awk '/^d/ { print $NF }'`"
+cd "$PKG_SRC"
+
+# Configure
+CFLAGS="$SLKCFLAGS" \
+ CXXFLAGS="$SLKCFLAGS" \
+ ./configure \
+ --prefix="$PREFIX" --libdir="$LIBDIR" $CONF_OPTIONS || exit $ERROR_CONF
+
+# Compile
+make $NUMJOBS || exit $ERROR_MAKE
+
+# Install
+make install DESTDIR="$PKG" || exit $ERROR_INSTALL
+
+# Get new hddtemp.db
+mkdir -p $PKG/usr/share/misc
+wget http://download.savannah.gnu.org/releases/hddtemp/hddtemp.db -P $PKG/usr/share/misc/
+
+# Strip binaries
+( cd "$PKG"
+ find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | \
+ xargs strip --strip-unneeded 2> /dev/null
+ find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | \
+ xargs strip --strip-unneeded 2> /dev/null
+)
+
+# Install documentation
+DOCS="ABOUT-NLS AUTHORS COPYING ChangeLog GPL-2 INSTALL LICENSE NEWS README TODO"
+mkdir -p "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION" || exit $ERROR_MKDIR
+for doc in $DOCS; do
+ if [ -f "$doc" ]; then
+ cp -a $doc "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION"
+ fi
+done
+
+# Add package description (slack-desc)
+mkdir -p "$PKG/install" || exit $ERROR_MKDIR
+cat << EODESC > "$PKG/install/slack-desc"
# HOW TO EDIT THIS FILE:
-# The "handy ruler" below makes it easier to edit a package description. Line
-# up the first '|' above the ':' following the base package name, and the '|' on
-# the right side marks the last column you can put a character in. You must make
-# exactly 11 lines for the formatting to be correct. It's also customary to
-# leave one space after the ':'.
-
- |----handy-ruler------------------------------------------------------|
-hddtemp: hddtemp.SlackBuild by Rudson R. Alves
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in. You must
+# make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':'.
+
+ |-----handy-ruler------------------------------------------------------|
+hddtemp: hddtemp by Slack.Sarava
hddtemp:
hddtemp: hddtemp is a small utility that gives you the temperature of your
hddtemp: hard drive by reading S.M.A.R.T. informations (for drives that
@@ -148,18 +188,13 @@ hddtemp:
hddtemp: The temperature information seems to be vendor specific (i.e. not
hddtemp: standardized). So hddtemp comes with a file (hddtemp.db) that contains
hddtemp: informations about drives that were reported to work with hddtemp.
-EOF
-
-# ----------------- Documentações -----------------------
-# Criar diretório de documentação
-PKG_DOC=$PKG/usr/doc/$PACKAGE-$VERSION
-mkdir -p $PKG_DOC
-cp $PKG_DIR/{ABOUT-NLS,AUTHORS,COPYING,ChangeLog,GPL-2,INSTALL,LICENSE,NEWS,README,TODO} $PKG_DOC
+EODESC
-# --------------- Constroi o pacote ---------------------
-makepkg -c y -l y $REPOS/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz || exit $ERROR_MKPKG
+# Build the package
+cd "$PKG"
+makepkg -l y -c n "$REPOS/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG
-# ----------- Remove arquivos temporários ---------------
-if [ "$CLEANUP" = "yes" ]; then
- rm -rf $PKG $PKG_SRC
+# Delete source and build directories if requested
+if [ "$CLEANUP" == "yes" ]; then
+ rm -rf "$PKG_WORK" "$PKG"
fi
diff --git a/sys/apps/simplepkg/simplepkg.SlackBuild b/sys/apps/simplepkg/simplepkg.SlackBuild
index e58191e5..3da651ed 100755
--- a/sys/apps/simplepkg/simplepkg.SlackBuild
+++ b/sys/apps/simplepkg/simplepkg.SlackBuild
@@ -1,73 +1,194 @@
#!/bin/bash
#
-# simplepkg.SlackBuild is free software; you can redistribute it and/or modify it under the
-# terms of the GNU General Public License as published by the Free Software
-# Foundation; either version 2 of the License, or any later version.
+# simplepkg.SlackBuild is free software; you can redistribute
+# it and/or modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of the License,
+# or any later version.
#
-# simplepkg.SlackBuild is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
-# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+# simplepkg.SlackBuild is distributed in the hope that it will
+# be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+# Public License for more details.
#
-# You should have received a copy of the GNU General Public License along with
-# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-# Place - Suite 330, Boston, MA 02111-1307, USA
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
#
-# slackbuild script for simplepkg
-# by rhatto at riseup.net
+# slackbuild for simplepkg, by Rudson R. Alves
+# requires:
+# tested: simplepkg-svn_version
#
-if [ -s "slack-required" ]; then
- echo Recomended and required packages for building simplepkg are:
- cat slack-required | sed -e 's/^/\t/'
- if [ "$INTERACT" != "no" ]; then
- echo If you dont have those installed, press Ctrl-C. Otherwise, hit ENTER.
- read crap
-# else
-# echo Sleeping 3 seconds...
-# sleep 3
- fi
-fi
-
-CWD="`pwd`"
-
+# Look for slackbuildrc
if [ -f ~/.slackbuildrc ]; then
source ~/.slackbuildrc
elif [ -f /etc/slackbuildrc ]; then
source /etc/slackbuildrc
fi
-# default settings
-PACKAGE="simplepkg"
+# Set variables
+CWD="$(pwd)"
+SRC_NAME="simplepkg"
+PKG_NAME="simplepkg"
ARCH="noarch"
-VERSION=${VERSION:=0.5.1}
-BUILD=${BUILD:=1rha}
-SRC_DIR=${SRC:=$CWD}
+SRC_VERSION=${VERSION:=svn_version}
+PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')"
+BUILD=${BUILD:=1srv}
+SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME
TMP=${TMP:=/tmp}
+PKG=${PKG:=$TMP/package-$PKG_NAME}
REPOS=${REPOS:=$TMP}
+PREFIX=${PREFIX:=/usr}
+PKG_WORK="$TMP/$SRC_NAME"
+CONF_OPTIONS=${CONF_OPTIONS:=""}
+NUMJOBS=${NUMJOBS:=""}
+
+# Set system libraries' path and optmization flags based on $ARCH
+LIBDIR="$PREFIX/lib"
+
+if [ "$ARCH" = "i386" ]; then
+ SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
+elif [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mcpu=i686"
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686"
+elif [ "$ARCH" = "s390" ]; then
+ SLKCFLAGS="-O2"
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIR="$PREFIX/lib64"
+ LDFLAGS="-L/lib64 -L/usr/lib64"
+fi
-# ------- error codes for createpkg --------------
+# Set error codes (used by 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; ERROR_VCS=41;
+ERROR_PATCH=40; ERROR_VCS=41; ERROR_MKDIR=42
+
+# Clean up any leftovers of previous builds
+rm -rf "$PKG_WORK" 2> /dev/null
+rm -rf "$PKG" 2> /dev/null
+
+# Create directories if necessary
+mkdir -p "$SRC_DIR" || exit $ERROR_MKDIR
+mkdir -p "$PKG" || exit $ERROR_MKDIR
+mkdir -p "$REPOS" || exit $ERROR_MKDIR
+mkdir -p "$PKG_WORK" || exit $ERROR_MKDIR
+
+# Get svn source code
+[ "`find "$SRC_DIR/" -name .svn`" != "" ] && SVN_ACTION="update" || SVN_ACTION="checkout"
+cd "$SRC_DIR"
+svn $SVN_ACTION svn://slack.sarava.org/simplepkg/trunk $PKG_SRC || exit $ERROR_VCS
+SND_DIR="`ls -l | awk '/^d/ { print $NF }'`"
+cd $SND_DIR
+PKG_VERSION="`svn info | awk '/Last Changed Rev:/ { print $4 }'`_svn"
+
+# Copy svn source
+cd "$PKG_WORK"
+cp -a $SRC_DIR/* .
+PKG_SRC="$PWD/$SND_DIR"
+cd "$PKG_SRC"
+
+# Build
+mkdir -p $PKG/install
+cp doinst.sh $PKG/install
+
+BIN_DIR=$PKG/usr/bin
+SBIN_DIR=$PKG/usr/sbin
+ETC_DIR=$PKG/etc
+LIB_DIR=$PKG/usr/libexec/$PKG_NAME
+DOC_DIR=$PKG/usr/doc/$PKG_NAME-$VERSION
-TMP="$TMP/$PACKAGE"
-rm -rf $TMP
-mkdir -p $TMP
-cd $TMP
+mkdir -p $BIN_DIR
+mkdir -p $SBIN_DIR
+mkdir -p $ETC_DIR
+mkdir -p $LIB_LIST
+mkdir -p $DOC_DIR
+mkdir -p $PKG/install
-svn checkout svn://slack.sarava.org/simplepkg/tags/$VERSION simplepkg-$VERSION || exit $ERROR_VCS
-cd $PACKAGE-$VERSION
+# Install lists
+BIN_LIST="simplaret repos lspkg mkbuild mkpatch"
+SBIN_LIST="mkjail templatepkg jail-update jail-commit metapkg rebuildpkg createpkg exec-slackbuild simpletrack"
+LIB_LIST="common.sh"
+DOC_LIST="CHANGELOG README.pt_BR TODO simplaret-pt_BR.tex COPYING README.simplaret mkbuild-pt_BR.tex simplepkg-en.tex README README.simplaret.pt_BR simplaret-en.tex simplepkg-pt_BR.tex"
-if [ -f "$CWD/$PACKAGE-$VERSION.diff" ]; then
- patch -p1 < $CWD/$PACKAGE-$VERSION.diff || exit $ERROR_PATCH
+# Install binaries
+for binary in $BIN_LIST; do
+ if [ -f "src/$binary" ]; then
+ cp src/$binary $BIN_DIR/
+ chmod +x $BIN_DIR/$binary
+ fi
+done
+
+for binary in $SBIN_LIST; do
+ if [ -f "src/$binary" ]; then
+ cp src/$binary $SBIN_DIR/
+ chmod +x $SBIN_DIR/$binary
+ fi
+done
+
+# Install libs
+for lib in $LIB_LIST; do
+ [ -f "lib/$lib" ] && cp lib/$lib $LIB_DIR/
+done
+
+mkdir -p $PKG/etc/$PKG_NAME/{defaults/mkbuild,templates}
+rsync -av --exclude=.svn templates/* $PKG/etc/$PKG_NAME/defaults/templates/
+chmod +x $PKG/etc/$PKG_NAME/defaults/templates/vserver/vserver.s/*.sh
+chmod +x $PKG/etc/$PKG_NAME/defaults/templates/vserver-legacy/vserver-legacy.s/*.sh
+cp conf/simplepkg.conf.new $PKG/etc/$PKG_NAME/
+cp conf/repos.conf.new $PKG/etc/$PKG_NAME/
+cp mkbuild/* $PKG/etc/$PKG_NAME/defaults/mkbuild/
+
+# Install jails
+if [ -f "$PKG/usr/sbin/jail-upgrade" ]; then
+ ( cd $PKG/usr/sbin && ln -s jail-upgrade vserver-upgrade )
fi
-./simplepkg.SlackBuild || exit $ERROR_MAKE
+# Install documentation
+for file in $DOC_LIST; do
+ cp doc/$file $DOC_DIR/
+done
-mv $PACKAGE-$VERSION-$ARCH-$BUILD.tgz $REPOS/
+# Install Script
+cp install/slack-desc $PKG/install
+cp install/doinst.sh $PKG/install
+cd $PKG
+
+# Change permission
+chown -R root.root *
+
+# Add package description (slack-desc)
+mkdir -p "$PKG/install" || exit $ERROR_MKDIR
+cat << EODESC > "$PKG/install/slack-desc"
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in. You must
+# make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':'.
+
+ |-----handy-ruler----------------------------------------------------|
+simplepkg: simplepkg (slackware management system)
+simplepkg:
+simplepkg: simplepkg is a very small set of scripts intended to help slackware
+simplepkg: users and developers, like the createpkg packaging tool, simplaret
+simplepkg: package retrieval, mkjail chroot installer and templatepkg template
+simplepkg: management system.
+simplepkg:
+simplepkg:
+simplepkg:
+simplepkg:
+simplepkg:
+EODESC
+
+# Build the package
+cd "$PKG"
+makepkg -l y -c n "$REPOS/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG
+
+# Delete source and build directories if requested
if [ "$CLEANUP" == "yes" ]; then
- rm -rf $TMP
+ rm -rf "$PKG_WORK" "$PKG"
fi
-