aboutsummaryrefslogtreecommitdiff
path: root/dev
diff options
context:
space:
mode:
Diffstat (limited to 'dev')
-rw-r--r--dev/ruby/facter/Manifest23
-rwxr-xr-xdev/ruby/facter/facter.SlackBuild88
2 files changed, 102 insertions, 9 deletions
diff --git a/dev/ruby/facter/Manifest b/dev/ruby/facter/Manifest
new file mode 100644
index 00000000..c5939f12
--- /dev/null
+++ b/dev/ruby/facter/Manifest
@@ -0,0 +1,23 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA256
+
+DIST facter-1.5.6.tar.gz 66356 MD5 f2eda650cadfdaf549fab1a436c0db4d RMD160 c0dbe660aae09758290230b6264d2ee18a072fef SHA1 a48d7e6e86199db16a647343e0dc05e143f00db4 SHA256 54caf94e3d429a39c29632919e7926636685682c69113585673136701dfc2b4c SHA512 df301f3eec6e5d4ec734e007fa99fcda29ad9724978aab25b7ac145e13df3d84763033504618c95b037741087c4cd13760dbfbdb2e22337f1a3fd9217a071e0a
+MKBUILD facter.mkbuild 3130 MD5 81b2a3172f95b5625e6a8acabd72b3c0 RMD160 3af9b9fd048521ce6131614878b9e0c97ea225ed SHA1 78747b68d1c29210ec1ee0d7d3c7a92779efa9a4 SHA256 1496c29f7290aa2cc97bcbac3c6aab830e90d4b73edc168164a3b9a7d57ec7e9 SHA512 11c7b6afffb74556ee9e59187423760039765e68ca720413cdbd106aab35c3da195ae14937d45aceaf0fbba49edb37b0b093927cad1a14ec104baac845e720e7
+SLACKBUILD facter.SlackBuild 6908 MD5 f12ef6c3f1478acaebed10f432490b82 RMD160 81d49a13b5431d6c00547fe16d40e9c670e1e687 SHA1 feba34cd2c368d3f9f00c528f5ae3ed692def48b SHA256 b82f0b2fab6d90b42f785d4fe5655561ac6ef1fd1396cb5f05b2a75ec3b0ba6d SHA512 28f0d71284820c4465caea17ad3743e32aa64d9843987af149efbc7e5d2c0c9342c76f8e3edd9f210ebf914aa0e191c3d3a898f5a41a5c47c3492b29c8586536
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.9 (GNU/Linux)
+
+iQIcBAEBCAAGBQJKR6STAAoJEEHL93ESzgeiB9kQAKbIf6onfw0e5Tkw3bgcPhM1
+5/2DygxD7hhuBGrR5QJLDki5xZpJPvHm3xM2OVklyU+PY30K4EiXnbiWzuxmXeSN
+99JtmbeFsSSYaszOdp/Z9xp69vDNNqpzXxmhvOTlaQX+W4Rtpirfu3Y8Nbm4e2oR
+5s7Vg7VwrMNcnDAURvGUWzE1E1HP+Cg2eTmDuUDLns7652XloqjlIqOOki9p6J0S
+2nBYDkYxs6INkZr178Qt+hN2iv5xR/rbD3CzDsA5mCJN6Nu+B66uuM+frKf4HxJg
+P8fJRmDj8okCz8NY1YN7BH+Q9blbMwJAPyR5eZa0pOzEX7FzIlEg71zXjKmJDbyQ
+ugyD9VsRFmo2iWSPo+G2qsh3hukb/YvV4AGo3EHPdjzDiAMlHS/MhEySUITGWKxz
+Rq+JGbCScHIdtFU+HqvcAI2I+KJ3U4NZENGG6rI9oCpTbdjO/D1skD+PQ9uevDQe
+X8pvePIt40Jh8ktTZuJlLT9/9cAkALuvrx8T/XG410MPt6iAq719LgHrGWfvqskc
+Tf7eKHaZt3YHni4x3acCFI+mmiby5vc8WLfd9bksaswqBRfZxsC/kq/cVBBafI40
+KxMVRDSmf7WC0u9DaDSilUSAbWKhSKFLxd4qjsJp1AH901ZozwjJsyZNRqOJ/LKh
+TQRUp4p+koJt1TOhc6Se
+=YjX/
+-----END PGP SIGNATURE-----
diff --git a/dev/ruby/facter/facter.SlackBuild b/dev/ruby/facter/facter.SlackBuild
index fef7627b..edf7fb09 100755
--- a/dev/ruby/facter/facter.SlackBuild
+++ b/dev/ruby/facter/facter.SlackBuild
@@ -16,7 +16,8 @@
#
# slackbuild for facter, by Silvio Rhatto
# requires:
-# tested: facter-1.3
+# tested: facter-1.5.6
+# model: generic.mkSlackBuild $Rev: 805 $
#
# Look for slackbuildrc
@@ -31,13 +32,14 @@ CWD="$(pwd)"
SRC_NAME="facter"
PKG_NAME="facter"
ARCH=${ARCH:=i486}
-SRC_VERSION=${VERSION:=1.3}
+SRC_VERSION=${VERSION:=1.5.6}
PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')"
BUILD=${BUILD:=1rha}
SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME
TMP=${TMP:=/tmp}
PKG=${PKG:=$TMP/package-$PKG_NAME}
REPOS=${REPOS:=$TMP}
+SLACKBUILD_PATH=${SLACKBUILD_PATH:="dev/ruby/facter"}
PREFIX=${PREFIX:=/usr}
PKG_WORK="$TMP/$SRC_NAME"
CONF_OPTIONS=${CONF_OPTIONS:=""}
@@ -47,9 +49,9 @@ NUMJOBS=${NUMJOBS:=""}
LIBDIR="$PREFIX/lib"
if [ "$ARCH" = "i386" ]; then
- SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
+ SLKCFLAGS="-O2 -march=i386 -mtune=i686"
elif [ "$ARCH" = "i486" ]; then
- SLKCFLAGS="-O2 -march=i486 -mcpu=i686"
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686"
elif [ "$ARCH" = "s390" ]; then
@@ -65,6 +67,7 @@ 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
+ERROR_MANIFEST=43;
# Clean up any leftovers of previous builds
rm -rf "$PKG_WORK" 2> /dev/null
@@ -77,13 +80,79 @@ mkdir -p "$REPOS" || exit $ERROR_MKDIR
mkdir -p "$PKG_WORK" || exit $ERROR_MKDIR
# Dowload source if necessary
-SRC="$SRC_NAME"_"$VERSION.tgz"
-URL="http://freshmeat.net/redir/facter/61771/url_tgz/$SRC"
+SRC="$SRC_NAME-$VERSION.tar.gz"
+URL="http://reductivelabs.com/downloads/facter/$SRC"
-if [ ! -s "$SRC_DIR/$SRC" ] || ! gzip -t "$SRC_DIR/$SRC" 2> /dev/null; then
+if [ ! -s "$SRC_DIR/$SRC" ] || ! gunzip -t "$SRC_DIR/$SRC" 2> /dev/null; then
wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET
fi
+# Check Manifest file
+if [ -e "$CWD/Manifest" ]; then
+
+ # Manifest signature checking
+ if grep -q -- "-----BEGIN PGP SIGNED MESSAGE-----" $CWD/Manifest; then
+ echo "Checking Manifest signature..."
+ gpg --verify $CWD/Manifest
+ if [ "$?" != "0" ]; then
+ exit $ERROR_MANIFEST
+ fi
+ fi
+
+ MANIFEST_LINES="`grep -E -v "^(MKBUILD|SLACKBUILD)" $CWD/Manifest | wc -l`"
+
+ for ((MANIFEST_COUNT=1; MANIFEST_COUNT <= $MANIFEST_LINES; MANIFEST_COUNT++)); do
+
+ MANIFEST_LINE="`grep -E -v "^(MKBUILD|SLACKBUILD)" $CWD/Manifest | head -n $MANIFEST_COUNT | tail -n 1`"
+ MANIFEST_FILE="`echo $MANIFEST_LINE | awk '{ print $2 }'`"
+ MANIFEST_FILE_TYPE="`echo $MANIFEST_LINE | awk '{ print $1 }'`"
+
+ if [ -e "$SRC_DIR/$MANIFEST_FILE" ]; then
+ MANIFEST_FILE="$SRC_DIR/$MANIFEST_FILE"
+ else
+ MANIFEST_FILE="`find $CWD -name $MANIFEST_FILE`"
+ fi
+
+ if [ ! -e "$MANIFEST_FILE" ] || [ -d "$MANIFEST_FILE" ]; then
+ continue
+ fi
+
+ echo "Checking Manifest for $MANIFEST_FILE_TYPE $MANIFEST_FILE integrity..."
+
+ SIZE_SRC="`wc -c $MANIFEST_FILE | awk '{ print $1 }'`"
+ SIZE_MANIFEST="`echo $MANIFEST_LINE | awk '{ print $3 }'`"
+
+ # Check source code size
+ if [ "$SIZE_SRC" != "$SIZE_MANIFEST" ]; then
+ echo "SIZE Manifest: $SIZE_MANIFEST; SIZE $SRC: $SIZE_SRC"
+ exit $ERROR_MANIFEST
+ else
+ echo "Size match."
+ fi
+
+ # Check source code integrity
+ for ALGO in md5 rmd160 sha1 sha256 sha512; do
+ if [ $ALGO = "rmd160" ]; then
+ ALGO_SRC="`openssl rmd160 $MANIFEST_FILE | awk '{ print $2 }'`"
+ else
+ ALGO_SRC="`"$ALGO"sum $MANIFEST_FILE | awk '{ print $1 }'`"
+ fi
+ ALGO="`echo $ALGO | tr '[:lower:]' '[:upper:]'`"
+ ALGO_MANIFEST=$(echo $MANIFEST_LINE | sed "s/.* $ALGO //" | awk '{ print $1 }')
+ if [ "$ALGO_SRC" != "$ALGO_MANIFEST" ]; then
+ echo "$ALGO Manifest: $ALGO_MANIFEST; $ALGO $SRC: $ALGO_SRC"
+ exit $ERROR_MANIFEST
+ else
+ echo "$ALGO match."
+ fi
+ done
+
+ done
+
+else
+ exit $ERROR_MANIFEST
+fi
+
# Untar
cd "$PKG_WORK"
tar --no-same-owner --no-same-permissions -xvf "$SRC_DIR/$SRC" || exit $ERROR_TAR
@@ -136,9 +205,10 @@ EODESC
# Build the package
cd "$PKG"
-makepkg -l y -c n "$REPOS/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG
+mkdir -p $REPOS/$SLACKBUILD_PATH
+makepkg -l y -c n "$REPOS/$SLACKBUILD_PATH/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG
# Delete source and build directories if requested
-if [ "$CLEANUP" == "yes" ]; then
+if [ "$CLEANUP" == "yes" ] || [ "$1" = "--cleanup" ]; then
rm -rf "$PKG_WORK" "$PKG"
fi