summaryrefslogtreecommitdiff
path: root/config-etckeeper.PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'config-etckeeper.PKGBUILD')
-rw-r--r--config-etckeeper.PKGBUILD49
1 files changed, 27 insertions, 22 deletions
diff --git a/config-etckeeper.PKGBUILD b/config-etckeeper.PKGBUILD
index 0bf09a5..1cbd779 100644
--- a/config-etckeeper.PKGBUILD
+++ b/config-etckeeper.PKGBUILD
@@ -1,32 +1,36 @@
-pkgver=1
-pkgrel=1
-arch=(any)
+. ${BUILDFILE%/*}/common.sh
+pkgver=20160712.2
-pkgname=config-etckeeper
depends=(etckeeper pristine-etc-keeper)
package() {
cd "$pkgdir"
-install -dm755 etc/systemd/system/multi-user.target.wants
-# etckeeper is configured to use git (the default) to keep track of
-# changes in /etc. The systemd unit etckeeper.timer is enabled, which
-# makes a commit (if necessary) daily. It will also run before and
-# after pacman via libalpm hooks.
-ln -s /usr/lib/systemd/system/etckeeper.timer etc/systemd/system/multi-user.target.wants/etckeeper.timer
+# [https://www.parabola.nu/packages/community/any/etckeeper/
+# etckeeper] is configured to use git (the default) to keep track of
+# changes in `/etc`. The systemd unit etckeeper.timer is enabled,
+# which makes a commit (if necessary) daily. It will also run before
+# and after pacman via libalpm hooks.
+add-unit etc/systemd/system/multi-user.target.wants/etckeeper.timer
# In addition to etckeeper keeping track of the current configuration,
-# lukeshu's pristine-etc-keeper maintains a branch of what /etc would
-# be like if we never made any changes from the default files. The
-# clean version of etc is available as the clean remote's master
+# lukeshu's
+# [https://www.parabola.nu/packages/pcr/any/pristine-etc-keeper-git/
+# pristine-etc-keeper] maintains a branch of what `/etc` would be like
+# if we never made any changes from the default files. The clean
+# version of etc is available as the clean remote's master
# branch. Doing a git diff clean/master master should be helpful in
# investigating how things have been configured.
-ln -s /usr/lib/systemd/system/pristine-etc-keeper.timer etc/systemd/system/multi-user.target.wants/pristine-etc-keeper.timer
+add-unit etc/systemd/system/multi-user.target.wants/pristine-etc-keeper.timer
-# Add a stub to customize /etc/.gitignrore a bit
-install -Dm755 /dev/stdin etc/etckeeper/update-ignore.d/02custom <<_EOF_
+# The etckeeper update-ignore hook is customized to ignore a couple
+# more files in `/etc` (and avoid ignoring `/etc/mtab`). We ignore
+# `resolv.conf` because it is managed by
+# [https://www.parabola.nu/packages/core/any/openresolv/
+# openresolv/resolvconf].
+add-file -m755 etc/etckeeper/update-ignore.d/02custom <<_EOF_
#!/bin/bash
-sed -i '/^# end section managed by etckeeper$/,$d' .gitignore
+sed -i '/^# end section managed by etckeeper\$/,\$d' .gitignore
cat >> .gitignore <<EOF
# end section managed by etckeeper
!/mtab
@@ -38,23 +42,24 @@ cat >> .gitignore <<EOF
EOF
_EOF_
-# Add some other .gitignore files scattered around
-install -Dm644 /dev/stdin etc/ca-certificates/.gitignore <<EOF
+# For files in subdirectories of `/etc`, we use separate `.gitignore`
+# files in each directory:
+add-file etc/ca-certificates/.gitignore <<EOF
/trust-source/blacklist/
/trust-source/anchors/
/extracted/
EOF
-install -Dm644 /dev/stdin etc/ssl/.gitignore <<EOF
+add-file etc/ssl/.gitignore <<EOF
/certs/*.0
/certs/*.1
/certs/*.pem
/certs/java/cacerts
/.ssh/
EOF
-install -Dm644 /dev/stdin etc/udev/.gitignore <<EOF
+add-file etc/udev/.gitignore <<EOF
/hwdb.bin
EOF
-install -Dm644 /dev/stdin etc/pacman.d/.gitignore <<EOF
+add-file etc/pacman.d/.gitignore <<EOF
/gnupg/
EOF