diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/admin/puppet/Manifest | 24 | ||||
-rw-r--r-- | app/admin/puppet/puppet.SlackBuild | 214 | ||||
-rw-r--r-- | app/admin/puppet/slack-required | 4 |
3 files changed, 242 insertions, 0 deletions
diff --git a/app/admin/puppet/Manifest b/app/admin/puppet/Manifest new file mode 100644 index 00000000..92326920 --- /dev/null +++ b/app/admin/puppet/Manifest @@ -0,0 +1,24 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA256 + +DIST puppet-0.24.8.tgz 1099188 MD5 288d46dee00acad64d0f3ecc6d8ba6fa RMD160 edb187da9225c9faee9839a5d644b5c9c91f3d5f SHA1 a871aef6f3e8e060f5109bb022967066e32875be SHA256 9e9dcfdd26f96e0b0b4ca9bcfe6f473c679ff082a0cd7226c2058ae652d4fdc8 SHA512 bbcfb92c073cc20f2a74e923f79316e4bf829da26ad8b590563ac1cf9cda6fbc7eb541a2c0c26a527a66ee15a146d557833635a67efdaca3f8eccdf63b4d62a3 +MKBUILD puppet.mkbuild 5102 MD5 67060150a08c3e9726f1f970b18e0eb8 RMD160 5c75a8f38e23a9db64b02e6994415dcb65b18ffd SHA1 21c4370ce7dd38814b4c5f1093823ca5718ae877 SHA256 e02a968dd120f3bb8122f71a0298b26e169dd56452ebcec320d107f8c5880c0b SHA512 38a7cc7f3e43acc0248207a77d31c311b1b49aae30fbd3432bf831b52902cc200bb9cc2a063e9ffe164fa59b4149d78e2c8e63b8a62d57f5ae9f1692f4a5d194 +SLACK-REQUIRED slack-required 77 MD5 c261e8a266810189ab2c444e93e8624f RMD160 4b141917b369e14c46b9662539c8a21b5fd02579 SHA1 22f46430bfeed22a19074ccf899d969fdef49710 SHA256 e9f5a1fc29b38d789dbabf133ae87b4e06c3d8095aa2a911ae848e60a79c9ddf SHA512 1e30c4b29c0556555ec17d312c5d06d9caa17a43de89565a893713f4135cb50e14ba4eb0500bb1f9ca0e030b9c0af121e2d28652d6c8ea590f63f48ca3c8e850 +SLACKBUILD puppet.SlackBuild 6752 MD5 2e3b5a06df2db3935cfd96e9618b35bd RMD160 9449a328f970a30a436a9f96a11b8face1807bc8 SHA1 483c62ca43e29ee580360e9a6c726fb458cd8bea SHA256 23e4a8e5d9d824ea69de56469d3029aa064e0856d2d184079a8e76e3e3ca7ae6 SHA512 14919155761a4ce5c5e0aa7cc5e3495ca0b23de927f4236312dbd81f6de75cb39853921f230a7aba9c9b80cff6dc372951d627838e92cbf5211a8ea4f7d7508a +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.9 (GNU/Linux) + +iQIcBAEBCAAGBQJKR8lHAAoJEEHL93ESzgeiPmIP/2xV+d7NKhlE+zfVmp5Jz+O8 +RRWdqnQqo0gtq7EGCQA5w8srzn1Y8LYu1f7bZeL2OM4Gq1v0RAzZHF5OihX1D9tO +q3XuIsVwsOUqXsq+9v3uR4WIPc5mk+WTx15UkXvc8rLj+dsO/OSBljzYDY+W7loh +ALOMLII+Hy1TWvsZEBv+/j3A+/6WSQ0SbJLEpkmU9dSfVQpkUMD24RWa0vcAeq4g +u/UavIQ6n7/Il9ct3q3zvsJP94M/VV3gKe20dLGJxQLCZJ0tJxhfU7zePPsBi6DV +fuEh58a9PgjyDvFfeEPUFs+WZ9GV26Sz623HjGUftrVdojrh40lLVw3uvVu1kELf +7x/UtGE7U/RHyy7/X4gMD6MPNH5Ss3VQ7UJ1QVFQi6+9hzELV4sZEMl42LBeZtc6 +Ue+2Ezpn4QI4+08FIZc3XixZb9sugIf8dpLFxyZfJKBnUIufwjRVkGPfIzy/bWCT +czWET+4KxQFSNFst6NfH7HZce8Scmdi8uVqEKdEkv6LRSW2o4awxqCKoviQ30T+1 ++K7sjXQzTDj+PymWoSngMUKMyVEiiX1Bq9BTy8/4sDpIS112a9Zj3WZxAGZ3lZB1 +1Q5rxhrtP4JHOFfEdkKx31bcLwyhudDzhjAUkxaAKiw9d0Kxd81rzERAboAOIely +B3r+9QIg+Jvo0wW0/Rx5 +=/CLO +-----END PGP SIGNATURE----- diff --git a/app/admin/puppet/puppet.SlackBuild b/app/admin/puppet/puppet.SlackBuild new file mode 100644 index 00000000..85de6dc9 --- /dev/null +++ b/app/admin/puppet/puppet.SlackBuild @@ -0,0 +1,214 @@ +#!/bin/bash +# +# puppet.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. +# +# puppet.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 +# +# slackbuild for puppet, by Silvio Rhatto +# requires: facter +# tested: puppet-0.24.8 +# model: generic.mkSlackBuild $Rev: 805 $ +# + +# Look for slackbuildrc +if [ -f ~/.slackbuildrc ]; then + source ~/.slackbuildrc +elif [ -f /etc/slackbuildrc ]; then + source /etc/slackbuildrc +fi + +# Set variables +CWD="$(pwd)" +SRC_NAME="puppet" +PKG_NAME="puppet" +ARCH=${ARCH:=i486} +SRC_VERSION=${VERSION:=0.24.8} +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:="app/admin/puppet"} +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 -mtune=i686" +elif [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=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 + +# 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 +ERROR_MANIFEST=43; + +# 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.tgz" +URL="http://reductivelabs.com/downloads/puppet/$SRC" + +if [ ! -s "$SRC_DIR/$SRC" ] || ! gzip -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 +PKG_SRC="$PWD/`ls -l | awk '/^d/ { print $NF }'`" +cd "$PKG_SRC" + +# Build and install package +ruby install.rb --destdir=$PKG || exit $ERROR_INSTALL + +# 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="CHANGELOG COPYING LICENSE README README.rst Rakefile" +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-------------------------------------------------------| +puppet: puppet +puppet: +puppet: The Puppet framework provides a means to describe IT infrastructure +puppet: as policy, execute that policy to build services then audit and +puppet: enforce ongoing changes to the policy. +puppet: +puppet: +puppet: +puppet: +puppet: +puppet: +EODESC + +# Build the package +cd "$PKG" +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" ] || [ "$1" = "--cleanup" ]; then + rm -rf "$PKG_WORK" "$PKG" +fi diff --git a/app/admin/puppet/slack-required b/app/admin/puppet/slack-required new file mode 100644 index 00000000..c8ca4a44 --- /dev/null +++ b/app/admin/puppet/slack-required @@ -0,0 +1,4 @@ +# Dependency list to puppet +# +# dependency [condition] [version]] +facter |