From 614b0fd1c425ad5ce6cc6030b4a5d549f4235b62 Mon Sep 17 00:00:00 2001 From: David Sullins Date: Mon, 30 Dec 2013 10:41:09 +0100 Subject: system/etckeeper: Added (version control for /etc). Signed-off-by: Matteo Bernardini --- system/etckeeper/README | 13 ++++++ system/etckeeper/doinst.sh | 14 ++++++ system/etckeeper/etckeeper.SlackBuild | 82 +++++++++++++++++++++++++++++++++++ system/etckeeper/etckeeper.info | 10 +++++ system/etckeeper/slack-desc | 19 ++++++++ 5 files changed, 138 insertions(+) create mode 100644 system/etckeeper/README create mode 100644 system/etckeeper/doinst.sh create mode 100644 system/etckeeper/etckeeper.SlackBuild create mode 100644 system/etckeeper/etckeeper.info create mode 100644 system/etckeeper/slack-desc (limited to 'system/etckeeper') diff --git a/system/etckeeper/README b/system/etckeeper/README new file mode 100644 index 0000000000..c41e73f6d3 --- /dev/null +++ b/system/etckeeper/README @@ -0,0 +1,13 @@ +Etckeeper is a collection of tools to let /etc be stored in a git, +mercurial, darcs, or bzr repository. It tracks file metadata that +revison control systems do not normally support, but that is +important for /etc, such as the permissions of /etc/shadow. It's +quite modular and configurable, while also being simple to use if +you understand the basics of working with revision control. + +Etckeeper will use git by default although you can change that in +/etc/etckeeper/etckeeper.conf, assuming you have other version control +tools installed. After installing etckeeper the first time you will +need to run "etckeeper init" once to initialize the repository. + +bzr and darcs are optional dependencies. diff --git a/system/etckeeper/doinst.sh b/system/etckeeper/doinst.sh new file mode 100644 index 0000000000..1b2ea4b4ad --- /dev/null +++ b/system/etckeeper/doinst.sh @@ -0,0 +1,14 @@ +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/etckeeper/etckeeper.conf.new diff --git a/system/etckeeper/etckeeper.SlackBuild b/system/etckeeper/etckeeper.SlackBuild new file mode 100644 index 0000000000..b2d762d1bd --- /dev/null +++ b/system/etckeeper/etckeeper.SlackBuild @@ -0,0 +1,82 @@ +#!/bin/sh + +# Slackware build script for etckeeper + +# Copyright (c) 2013, David Sullins +# 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=etckeeper +VERSION=${VERSION:-1.10} +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} + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +# By default etckeeper is configured for an apt/dpkg based system. Change +# that so it won't pollute /etc with files we don't need on Slackware. +sed -i 's/apt$//g;s/dpkg$//g' ./etckeeper.conf + +make install DESTDIR=$PKG + +mv $PKG/etc/etckeeper/etckeeper.conf $PKG/etc/etckeeper/etckeeper.conf.new + +mv $PKG/usr/share/man $PKG/usr/man +rmdir $PKG/usr/share +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 + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a \ + GPL INSTALL README TODO \ + $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/etckeeper/etckeeper.info b/system/etckeeper/etckeeper.info new file mode 100644 index 0000000000..52375890ad --- /dev/null +++ b/system/etckeeper/etckeeper.info @@ -0,0 +1,10 @@ +PRGNAM="etckeeper" +VERSION="1.10" +HOMEPAGE="http://joeyh.name/code/etckeeper/" +DOWNLOAD="https://github.com/joeyh/etckeeper/archive/1.10/etckeeper-1.10.tar.gz" +MD5SUM="a89a6d4afb92d0a5a64b60f693fe64f9" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="David Sullins" +EMAIL="david.sullins@gmail.com" diff --git a/system/etckeeper/slack-desc b/system/etckeeper/slack-desc new file mode 100644 index 0000000000..0a7ea93db8 --- /dev/null +++ b/system/etckeeper/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------------------------------------------------------| +etckeeper: etckeeper (version control for /etc) +etckeeper: +etckeeper: etckeeper is a collection of tools to let /etc be stored in a git, +etckeeper: mercurial, darcs, or bzr repository. It tracks file metadata that +etckeeper: revison control systems do not normally support, but that is +etckeeper: important for /etc, such as the permissions of /etc/shadow. It's +etckeeper: quite modular and configurable, while also being simple to use if +etckeeper: you understand the basics of working with revision control. +etckeeper: +etckeeper: +etckeeper: homepage: http://joeyh.name/code/etckeeper -- cgit v1.2.3