diff options
author | Henrik Riomar <henrik.riomar@gmail.com> | 2019-12-16 08:28:08 +0100 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2019-12-16 15:33:18 +0000 |
commit | 1f407f2c90b66d1e0884c89bf64ebb7fc296a4da (patch) | |
tree | 72c14e39db276fa8f108931ca4705ee02e03c4bc /main/etckeeper | |
parent | 0dcdc04443d1ff9cf8876130b9cc6e8ac1102a04 (diff) | |
download | aports-1f407f2c90b66d1e0884c89bf64ebb7fc296a4da.tar.bz2 aports-1f407f2c90b66d1e0884c89bf64ebb7fc296a4da.tar.xz |
main/etckeeper: move from community
Diffstat (limited to 'main/etckeeper')
-rw-r--r-- | main/etckeeper/APKBUILD | 45 | ||||
-rw-r--r-- | main/etckeeper/apk-commit_hook | 22 | ||||
-rw-r--r-- | main/etckeeper/etckeeper.post-install | 10 | ||||
-rw-r--r-- | main/etckeeper/etckeeper.pre-deinstall | 6 |
4 files changed, 83 insertions, 0 deletions
diff --git a/main/etckeeper/APKBUILD b/main/etckeeper/APKBUILD new file mode 100644 index 0000000000..ba1ce6a68c --- /dev/null +++ b/main/etckeeper/APKBUILD @@ -0,0 +1,45 @@ +# Contributor: Henrik Riomar <henrik.riomar@gmail.com> +# Maintainer: Henrik Riomar <henrik.riomar@gmail.com> + +pkgname=etckeeper +pkgver=1.18.12 +pkgrel=1 +pkgdesc="Store /etc in git." +url="http://etckeeper.branchable.com" +arch="noarch" +license="GPL-2.0-or-later" +checkdepends="bats fakeroot" +depends="findutils git" +subpackages="$pkgname-doc" +options="!checkroot" +install="$pkgname.post-install $pkgname.pre-deinstall" +source="$pkgname-$pkgver.tar.gz::https://git.joeyh.name/index.cgi/etckeeper.git/snapshot/etckeeper-$pkgver.tar.gz + apk-commit_hook + " + +prepare() { + default_prepare + + sed -i 's|^PYTHON=python$|PYTHON=/bin/false|' Makefile + sed -i 's/_PACKAGE_MANAGER=.*/_PACKAGE_MANAGER=apk/' etckeeper.conf +} + +check() { + make test +} + +package() { + make install DESTDIR="$pkgdir" + rm -rf "$pkgdir"/lib/systemd + rmdir "$pkgdir"/lib/ + rm -rf "$pkgdir"/etc/apt + + install -m755 -D "$builddir"/debian/cron.daily \ + "$pkgdir"/etc/periodic/daily/"$pkgname" + + install -m755 -D "$srcdir"/apk-commit_hook \ + "$pkgdir"/etc/apk/commit_hooks.d/"$pkgname" +} + +sha512sums="7fb75d89bbf69d5ef29fc93f34f8368f0d93adb6f89a96be4769be4a58faff793682f5a5fc6f6f2bf51bc5a151a28b61319396a4298cbf0aa75ff3c1bbb660d7 etckeeper-1.18.12.tar.gz +d0ff88615359e8b03da5f9162a7bae3f32c06891a8899096025283d77e950dd72280c6c19b8eb8a4cde08742c6ca715cd32c37c16e8bbf2d030e9fd16a1fc940 apk-commit_hook" diff --git a/main/etckeeper/apk-commit_hook b/main/etckeeper/apk-commit_hook new file mode 100644 index 0000000000..a662c81a81 --- /dev/null +++ b/main/etckeeper/apk-commit_hook @@ -0,0 +1,22 @@ +#!/bin/sh + + +[ -x /usr/bin/etckeeper ] || exit +[ -x /usr/bin/git ] || exit +[ -x /usr/bin/find ] || exit + +AVOID_SPECIAL_FILE_WARNING=1 +export AVOID_SPECIAL_FILE_WARNING + +case "$1" in + pre-commit) + etckeeper pre-install + ;; + post-commit) + etckeeper post-install + ;; + + *) + echo "$0: Un-handled action: $1" + ;; +esac diff --git a/main/etckeeper/etckeeper.post-install b/main/etckeeper/etckeeper.post-install new file mode 100644 index 0000000000..5bb094cb22 --- /dev/null +++ b/main/etckeeper/etckeeper.post-install @@ -0,0 +1,10 @@ +#!/bin/sh + +[ -e /etc/.git ] && exit 0 + +if etckeeper init; then + etckeeper commit "initial commit" + # we are in trigger context so the apk database + # contains info before the change takes effect + /etc/etckeeper/pre-install.d/10packagelist +fi diff --git a/main/etckeeper/etckeeper.pre-deinstall b/main/etckeeper/etckeeper.pre-deinstall new file mode 100644 index 0000000000..9170848b38 --- /dev/null +++ b/main/etckeeper/etckeeper.pre-deinstall @@ -0,0 +1,6 @@ +#!/bin/sh + +etckeeper uninit + +rm -f /var/cache/etckeeper/packagelist.fmt +rm -f /var/cache/etckeeper/packagelist.pre-install |