summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Hills2016-08-15 18:43:34 -0400
committerAndrew Hills2016-08-15 18:46:35 -0400
commit112f4ae0d90137031d993f96eb27233b24950f0d (patch)
tree5c10249f2c6cf09ec3212cc7ee6434ca4a9d0c2a
downloadaur-112f4ae0d90137031d993f96eb27233b24950f0d.tar.gz
hosts-gen 0.9
-rw-r--r--.SRCINFO18
-rw-r--r--.gitignore4
-rw-r--r--PKGBUILD37
-rw-r--r--hosts-gen-0.9-doc.patch13
-rw-r--r--hosts-gen-0.9-usr-bin.patch29
-rw-r--r--hosts-gen.install12
6 files changed, 113 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..abeb79a761bb
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,18 @@
+pkgbase = hosts-gen
+ pkgdesc = A little framework to generate /etc/hosts from /etc/hosts.d
+ pkgver = 0.9
+ pkgrel = 1
+ url = http://git.r-36.net/hosts-gen/
+ install = hosts-gen.install
+ arch = any
+ license = GPL3
+ depends = coreutils
+ source = http://git.r-36.net/hosts-gen/snapshot/hosts-gen-d3015d319d378390139455731b974569fbc2cd40.tar.bz2
+ source = hosts-gen-0.9-usr-bin.patch
+ source = hosts-gen-0.9-doc.patch
+ md5sums = 534edf642f15df0a073a716967724065
+ md5sums = d05c8b504ace226881e800cbad95ac9b
+ md5sums = bb63beb2068c3aac04caefaa2ee926b6
+
+pkgname = hosts-gen
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..b6a75d1799c4
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+/hosts-gen-*.tar.bz2
+/hosts-gen-*.pkg.tar.xz
+/pkg
+/src
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..ab54a0e56b46
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,37 @@
+# Maintainer: Andrew Hills <ahills@ednos.net>
+pkgname=hosts-gen
+pkgver=0.9
+# No actual releases provided; find the right commit and download a snapshot from cgit
+_pkgcommit=d3015d319d378390139455731b974569fbc2cd40
+pkgrel=1
+epoch=
+pkgdesc="A little framework to generate /etc/hosts from /etc/hosts.d"
+arch=('any')
+url="http://git.r-36.net/$pkgname/"
+license=('GPL3')
+groups=()
+depends=('coreutils')
+backup=()
+options=()
+install="$pkgname.install"
+source=("http://git.r-36.net/$pkgname/snapshot/$pkgname-$_pkgcommit.tar.bz2"
+ "$pkgname-$pkgver-usr-bin.patch"
+ "$pkgname-$pkgver-doc.patch")
+md5sums=('534edf642f15df0a073a716967724065'
+ 'd05c8b504ace226881e800cbad95ac9b'
+ 'bb63beb2068c3aac04caefaa2ee926b6')
+validpgpkeys=()
+
+prepare() {
+ cd "$pkgname-$_pkgcommit"
+ for patchname in usr-bin doc; do
+ patch -p1 < "$srcdir/$pkgname-$pkgver-$patchname.patch"
+ done
+}
+
+package() {
+ cd "$pkgname-$_pkgcommit"
+ make DESTDIR="$pkgdir/" install
+ # Generate this from /etc/hosts on install
+ rm "$pkgdir/etc/hosts.d/01-hosts.local"
+}
diff --git a/hosts-gen-0.9-doc.patch b/hosts-gen-0.9-doc.patch
new file mode 100644
index 000000000000..c8e031497585
--- /dev/null
+++ b/hosts-gen-0.9-doc.patch
@@ -0,0 +1,13 @@
+diff -ru a/Makefile b/Makefile
+--- a/Makefile 2016-08-15 18:24:37.171635704 -0400
++++ b/Makefile 2016-08-15 18:39:30.995016021 -0400
+@@ -21,6 +21,9 @@
+ @echo installing ${DESTDIR}${PREFIX}/etc/hosts.d
+ @mkdir -p ${DESTDIR}${PREFIX}/etc/hosts.d
+ @cp -R etc/hosts.d/* ${DESTDIR}${PREFIX}/etc/hosts.d
++ @echo installing ${DESTDIR}${PREFIX}/usr/share/doc/hosts-gen/README and LICENSE
++ @mkdir -p ${DESTDIR}${PREFIX}/usr/share/doc/hosts-gen
++ @cp README LICENSE ${DESTDIR}${PREFIX}/usr/share/doc/hosts-gen
+ # @echo installing manual page to ${DESTDIR}${MANPREFIX}/man1
+ # @mkdir -p ${DESTDIR}${MANPREFIX}/man1
+ # @sed "s/VERSION/${VERSION}/g" < st.1 > ${DESTDIR}${MANPREFIX}/man1/st.1
diff --git a/hosts-gen-0.9-usr-bin.patch b/hosts-gen-0.9-usr-bin.patch
new file mode 100644
index 000000000000..e509ca558fc0
--- /dev/null
+++ b/hosts-gen-0.9-usr-bin.patch
@@ -0,0 +1,29 @@
+diff -ru a/Makefile b/Makefile
+--- a/Makefile 2015-04-15 03:45:46.000000000 -0400
++++ b/Makefile 2016-08-15 18:22:16.551628313 -0400
+@@ -14,10 +14,10 @@
+ @rm -rf hosts-gen-${VERSION}
+
+ install: all
+- @echo installing script to ${DESTDIR}${PREFIX}/bin
+- @mkdir -p ${DESTDIR}${PREFIX}/bin
+- @cp -f bin/hosts-gen ${DESTDIR}${PREFIX}/bin
+- @chmod 755 ${DESTDIR}${PREFIX}/bin/hosts-gen
++ @echo installing script to ${DESTDIR}${PREFIX}/usr/bin
++ @mkdir -p ${DESTDIR}${PREFIX}/usr/bin
++ @cp -f bin/hosts-gen ${DESTDIR}${PREFIX}/usr/bin
++ @chmod 755 ${DESTDIR}${PREFIX}/usr/bin/hosts-gen
+ @echo installing ${DESTDIR}${PREFIX}/etc/hosts.d
+ @mkdir -p ${DESTDIR}${PREFIX}/etc/hosts.d
+ @cp -R etc/hosts.d/* ${DESTDIR}${PREFIX}/etc/hosts.d
+@@ -27,8 +27,8 @@
+ # @chmod 644 ${DESTDIR}${MANPREFIX}/man1/st.1
+
+ uninstall:
+- @echo removing script from ${DESTDIR}${PREFIX}/bin
+- @rm -f ${DESTDIR}${PREFIX}/bin/hosts-gen
++ @echo removing script from ${DESTDIR}${PREFIX}/usr/bin
++ @rm -f ${DESTDIR}${PREFIX}/usr/bin/hosts-gen
+ @echo you need to manually remove the ${DESTDIR}${PREFIX}/etc/hosts.d directory
+
+ .PHONY: all dist install uninstall
diff --git a/hosts-gen.install b/hosts-gen.install
new file mode 100644
index 000000000000..3c5b3ce12b82
--- /dev/null
+++ b/hosts-gen.install
@@ -0,0 +1,12 @@
+post_install() {
+ echo 'Copying existing hosts file to 01-hosts.local'
+ cp -v etc/hosts etc/hosts.d/01-hosts.local
+ echo
+ echo 'Changes to /etc/hosts will be lost when hosts-gen is run. Put new'
+ echo 'entries in files in /etc/hosts.d.'
+}
+
+pre_remove() {
+ echo 'Restoring 01-hosts.local to hosts file'
+ cp -v etc/hosts.d/01-hosts.local etc/hosts
+}