aboutsummaryrefslogtreecommitdiff
path: root/patches/smartmontools
diff options
context:
space:
mode:
authorrhatto <rhatto@370017ae-e619-0410-ac65-c121f96126d4>2006-10-19 19:31:21 +0000
committerrhatto <rhatto@370017ae-e619-0410-ac65-c121f96126d4>2006-10-19 19:31:21 +0000
commit3b42ea2913d5aa8077aba9fe1761b824398f9804 (patch)
tree64bcbbc6876e27f863df0ef9e9346e22b8291294 /patches/smartmontools
parent8faf3506c7ee2a4a2f210d11d41ba91d9bd27eea (diff)
downloadslackbuilds-3b42ea2913d5aa8077aba9fe1761b824398f9804.tar.gz
slackbuilds-3b42ea2913d5aa8077aba9fe1761b824398f9804.tar.bz2
fixing permissions, part 1
git-svn-id: svn+slack://slack.fluxo.info/var/svn/slackbuilds@455 370017ae-e619-0410-ac65-c121f96126d4
Diffstat (limited to 'patches/smartmontools')
-rwxr-xr-xpatches/smartmontools/smartmontools.SlackBuild96
1 files changed, 96 insertions, 0 deletions
diff --git a/patches/smartmontools/smartmontools.SlackBuild b/patches/smartmontools/smartmontools.SlackBuild
new file mode 100755
index 00000000..f37c880c
--- /dev/null
+++ b/patches/smartmontools/smartmontools.SlackBuild
@@ -0,0 +1,96 @@
+#!/bin/bash
+#
+# got it from ftp://ftp.slackware.com/pub/slackware/slackware-current/source/a/smartmontools/smartmontools.SlackBuild
+# small changes by rhatto
+#
+
+CWD="`pwd`"
+
+if [ -f "/etc/slackbuildrc" ]; then
+ source /etc/slackbuildrc
+fi
+
+if [ -f "~/.slackbuildrc" ]; then
+ source ~/.slackbuildrc
+fi
+
+PACKAGE="smartmontools"
+VERSION=${VERSION:=5.36}
+ARCH=${ARCH:=i486}
+BUILD=${BUILD:=1rha}
+TMP=${TMP:=/tmp}
+SRC_DIR=${SRC:=$CWD}
+REPOS=${REPOS:=$TMP}
+
+if [ "$ARCH" == "x86_64" ]; then
+ LIBDIR=/usr/lib64
+else
+ LIBDIR=/usr/lib
+fi
+
+RTOOL="wget"
+PACKAGE_EXT="gz"
+SRC="$PACKAGE-$VERSION.tar.$PACKAGE_EXT"
+URL="http://easynews.dl.sourceforge.net/sourceforge/smartmontools/$SRC"
+
+if [ "$PACKAGE_EXT" == "bz2" ]; then
+ tarflag="j"
+else
+ tarflag="z"
+fi
+
+TMP="$TMP/$PACKAGE"
+PKG=$TMP/package-$PACKAGE
+SRC_DIR="$SRC_DIR/$PACKAGE"
+mkdir -p $TMP $SRC_DIR
+
+# TODO: signature checking
+if [ "$RTOOL" == "wget" ] && [ ! -f "$SRC_DIR/$SRC" ]; then
+ rm -f $SRC_DIR/$SRC.asc
+ wget "$URL" -O "$SRC_DIR/$SRC"
+ wget "$URL.asc" -O "$SRC_DIR/$SRC.asc"
+fi
+
+if [ ! -d $TMP ]; then
+ mkdir -p $TMP # location to build the source
+fi
+
+rm -rf $PKG
+mkdir -p $PKG
+
+cd $TMP
+rm -rf smartmontools-$VERSION
+tar xvf$tarflag $SRC_DIR/$SRC
+cd smartmontools-$VERSION
+chown -R root:root .
+./configure \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ $ARCH-slackware-linux
+make || exit 32
+make install DESTDIR=$PKG
+# Not used on Slackware:
+rm -rf $PKG/etc/rc.d
+mv $PKG/etc/smartd.conf $PKG/etc/smartd.conf.new
+gzip -9 $PKG/usr/man/man?/*.?
+mv $PKG/usr/share/doc $PKG/usr
+rmdir $PKG/usr/share
+rm -f $PKG/usr/doc/smartmontools-$VERSION/CHANGELOG \
+ $PKG/usr/doc/smartmontools-$VERSION/smartd.conf
+( 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
+)
+mkdir -p $PKG/install
+zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+# Build the package:
+cd $PKG
+makepkg -l y -c n $REPOS/smartmontools-$VERSION-$ARCH-$BUILD.tgz
+
+# Clean up the extra stuff:
+if [ "$CLEANUP" == "yes" ]; then
+ rm -rf $TMP
+fi
+