summaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
authorAlex Diaconu <alex.diaconu@gmx.com>2013-07-05 15:25:23 -0500
committerNiels Horn <niels.horn@slackbuilds.org>2013-07-07 09:11:41 -0300
commita9a2f3683a6b007dd29c9780497f23877b13668a (patch)
tree8cd6dd80710dd52596cde2ca48c346e8b4bbe348 /system
parent49f20361ff32be6654915ae77b71fd0ed78e76bd (diff)
downloadslackbuilds-a9a2f3683a6b007dd29c9780497f23877b13668a.tar.gz
system/ansible: Added (a ssh based config management framework)
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
Diffstat (limited to 'system')
-rw-r--r--system/ansible/Makefile.patch55
-rw-r--r--system/ansible/README13
-rw-r--r--system/ansible/ansible.SlackBuild128
-rw-r--r--system/ansible/ansible.info10
-rw-r--r--system/ansible/doinst.sh16
-rw-r--r--system/ansible/slack-desc19
6 files changed, 241 insertions, 0 deletions
diff --git a/system/ansible/Makefile.patch b/system/ansible/Makefile.patch
new file mode 100644
index 0000000000..6afd372f5d
--- /dev/null
+++ b/system/ansible/Makefile.patch
@@ -0,0 +1,55 @@
+--- a/Makefile 2013-07-05 14:59:24.000000000 +0200
++++ b/Makefile 2013-07-05 15:01:21.000000000 +0200
+@@ -21,34 +21,13 @@
+ # This doesn't evaluate until it's called. The -D argument is the
+ # directory of the target file ($@), kinda like `dirname`.
+ MANPAGES := docs/man/man1/ansible.1 docs/man/man1/ansible-playbook.1 docs/man/man1/ansible-pull.1 docs/man/man1/ansible-doc.1
+-ifneq ($(shell which a2x 2>/dev/null),)
+-ASCII2MAN = a2x -D $(dir $@) -d manpage -f manpage $<
+-ASCII2HTMLMAN = a2x -D docs/html/man/ -d manpage -f xhtml
+-else
+-ASCII2MAN = @echo "ERROR: AsciiDoc 'a2x' command is not installed but is required to build $(MANPAGES)" && exit 1
+-endif
+
+-PYTHON=python
++PYTHON=python2
+ SITELIB = $(shell $(PYTHON) -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
+
+ # VERSION file provides one place to update the software version
+ VERSION := $(shell cat VERSION)
+
+-# Get the branch information from git
+-ifneq ($(shell which git),)
+-GIT_DATE := $(shell git log -n 1 --format="%ai")
+-endif
+-
+-ifeq ($(OS), FreeBSD)
+-DATE := $(shell date -j -f "%Y-%m-%d %H:%M:%s" "$(GIT_DATE)" +%Y%m%d%H%M)
+-else
+-ifeq ($(OS), Darwin)
+-DATE := $(shell date -j -f "%Y-%m-%d %H:%M:%S" "$(GIT_DATE)" +%Y%m%d%H%M)
+-else
+-DATE := $(shell date --utc --date="$(GIT_DATE)" +%Y%m%d%H%M)
+-endif
+-endif
+-
+ # RPM build parameters
+ RPMSPECDIR= packaging/rpm
+ RPMSPEC = $(RPMSPECDIR)/ansible.spec
+@@ -74,16 +53,6 @@
+ authors:
+ sh hacking/authors.sh
+
+-# Regenerate %.1.asciidoc if %.1.asciidoc.in has been modified more
+-# recently than %.1.asciidoc.
+-%.1.asciidoc: %.1.asciidoc.in
+- sed "s/%VERSION%/$(VERSION)/" $< > $@
+-
+-# Regenerate %.1 if %.1.asciidoc or VERSION has been modified more
+-# recently than %.1. (Implicitly runs the %.1.asciidoc recipe)
+-%.1: %.1.asciidoc VERSION
+- $(ASCII2MAN)
+-
+ loc:
+ sloccount lib library bin
+
diff --git a/system/ansible/README b/system/ansible/README
new file mode 100644
index 0000000000..3445653f0f
--- /dev/null
+++ b/system/ansible/README
@@ -0,0 +1,13 @@
+Ansible (a ssh based config management framework)
+
+A radically simple, model-driven orchestration solution that automates
+configuration, software deployment, and other IT needs.
+
+It comes as an easy-to-use and powerful alternative to infrastructure
+management tools such as CFEngine, Chef, Puppet, and SaltStack.
+
+*Note* that as the source tarball is hosted by github (nodeload), its filename
+will vary depending on the download method. The filename may be "release1.2"
+when downloaded via wget/curl or it may be "ansible-ansible-v1.2-*.tar.gz"
+when downloaded via a browser. Any other form will not be accounted for, as
+the SlackBuild script is set to handle only those two filename patterns.
diff --git a/system/ansible/ansible.SlackBuild b/system/ansible/ansible.SlackBuild
new file mode 100644
index 0000000000..2fa6d08c91
--- /dev/null
+++ b/system/ansible/ansible.SlackBuild
@@ -0,0 +1,128 @@
+#!/bin/sh
+
+# Slackware build script for ansible
+
+# Copyright 2013 Alex Diaconu <alex.diaconu@gmx.com>
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+PRGNAM=ansible
+VERSION=${VERSION:-1.2}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i486 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$(uname -m) ;;
+ esac
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+set -e # Exit on most errors
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$VERSION
+
+# Minor unpacking deviation from the SlackBuild template
+# due to the source being downloaded from github
+#
+# wget/curl (no redirection) -> release$VERSION
+# browser -> ansible-ansible-v{tag}-{n}-g{sha}.tar.gz
+# -- refer to https://github.com/blog/651-annotated-downloads
+SOURCEFILE=$(find "$CWD" -type f \( -name "release$VERSION" -o \
+ -name "$PKGNAM-$PKGNAM-v$VERSION-*" \) -print | head -1)
+mkdir $PRGNAM-$VERSION
+# The container directory (ansible-ansible-v{tag}...) must be stripped
+tar xvf "$SOURCEFILE" -C $PRGNAM-$VERSION --strip 1
+
+cd $PRGNAM-$VERSION
+sudo chown -R root:root .
+find . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \;
+
+patch -p1 < $CWD/Makefile.patch
+
+make docs
+python setup.py install $SLKFLAGS --root=$PKG
+
+# Copy and compress manpages
+rm -r docs/man/man1/*asciidoc.in
+cp -a docs/man $PKG/usr/man
+find $PKG/usr/man -type f -exec gzip -9 {} \;
+for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
+
+# Remove git remnants
+find $PKG/usr/man -iname '.git*' -delete
+
+# Remove redundant executable perms granted to some modules
+find $PKG/usr/share/ansible -type f -perm /111 -exec chmod -x {} \;
+
+# Fix plugin paths in example config file
+orig_path="/usr/share/ansible_plugins"
+site_packages="$(python2 -c 'from distutils.sysconfig import get_python_lib; print get_python_lib();')/ansible"
+plug_pat='(action|filter|connection|lookup)'
+
+sed -i -r \
+ -e "s:$orig_path/${plug_pat}_plugins:$site_packages/runner/\1_plugins:" \
+ -e "s:$orig_path/callback_plugins:$site_packages/callback_plugins:" \
+ -e "s:$orig_path/vars_plugins:$site_packages/inventory/vars_plugins:" \
+ examples/ansible.cfg
+
+# Populate config dir (/etc/ansible)
+mkdir -p $PKG/etc/ansible
+cp -a examples/ansible.cfg $PKG/etc/ansible/ansible.cfg.new
+cp -a examples/hosts $PKG/etc/ansible/hosts.new
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a \
+ examples COPYING RELEASES.txt *.md \
+ $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
diff --git a/system/ansible/ansible.info b/system/ansible/ansible.info
new file mode 100644
index 0000000000..57deb1a6ed
--- /dev/null
+++ b/system/ansible/ansible.info
@@ -0,0 +1,10 @@
+PRGNAM="ansible"
+VERSION="1.2"
+HOMEPAGE="http://ansible.cc"
+DOWNLOAD="http://github.com/ansible/ansible/tarball/release1.2"
+MD5SUM="91ca6ddc295ed8aa19959273062edaf7"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES="paramiko PyYAML Jinja2"
+MAINTAINER="Alex Diaconu"
+EMAIL="alex.diaconu@gmx.com"
diff --git a/system/ansible/doinst.sh b/system/ansible/doinst.sh
new file mode 100644
index 0000000000..def7b58d1d
--- /dev/null
+++ b/system/ansible/doinst.sh
@@ -0,0 +1,16 @@
+config() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ # If there's no config file by that name, mv it over:
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
+ # toss the redundant copy
+ rm $NEW
+ fi
+ # Otherwise, we leave the .new copy for the admin to consider...
+}
+
+config etc/ansible/ansible.cfg.new
+config etc/ansible/hosts.new
+
diff --git a/system/ansible/slack-desc b/system/ansible/slack-desc
new file mode 100644
index 0000000000..635768b7ff
--- /dev/null
+++ b/system/ansible/slack-desc
@@ -0,0 +1,19 @@
+# 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 ':' except on otherwise blank lines.
+
+ |-----handy-ruler------------------------------------------------------|
+ansible: Ansible (a ssh based config management framework)
+ansible:
+ansible: A radically simple, model-driven orchestration solution that
+ansible: automates configuration, software deployment, and other IT needs.
+ansible:
+ansible: Homepage: http://ansible.cc
+ansible:
+ansible:
+ansible:
+ansible:
+ansible: