summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorveecue2017-10-22 19:18:30 +0200
committerveecue2017-10-22 19:18:30 +0200
commitb29a249776f19028a3a6b32bcb5bd36765b43897 (patch)
tree8448b9e438e2027512916c8291f45643d18af371
downloadaur-b29a249776f19028a3a6b32bcb5bd36765b43897.tar.gz
init
-rw-r--r--.SRCINFO19
-rw-r--r--PKGBUILD34
-rw-r--r--pacmon-mirrorlist.hook9
-rw-r--r--pacmon.install5
-rw-r--r--pacmon.service12
5 files changed, 79 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..b221e433040
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,19 @@
+pkgbase = pacmon-git
+ pkgdesc = An automated LAN mirror for pacman
+ pkgver = 20171021
+ pkgrel = 1
+ url = https://github.com/veecue/pacmon
+ install = pacmon.install
+ arch = any
+ license = GPL
+ makedepends = git
+ makedepends = go
+ options = !strip
+ options = !emptydirs
+ source = pacmon.service
+ source = pacmon-mirrorlist.hook
+ sha256sums = fb0cdc6bf8a79c518ded1a5c9cc44e2b26f3ea3adee8947c4746d5996c3b75a2
+ sha256sums = 82f0a263cc0ebc08e43043d8dec5118afb56f5bbaef64a2021dc0b43f6671c5a
+
+pkgname = pacmon-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..f2a3e01240b
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,34 @@
+# Maintainer: veecue <veecue@ventos.tk>
+
+pkgname=pacmon-git
+pkgver=20171022
+pkgrel=1
+pkgdesc="An automated LAN mirror for pacman"
+arch=('any')
+url="https://github.com/veecue/pacmon"
+license=('GPL')
+makedepends=('git' 'go')
+options=('!strip' '!emptydirs')
+source=('pacmon.service' 'pacmon-mirrorlist.hook')
+sha256sums=('fb0cdc6bf8a79c518ded1a5c9cc44e2b26f3ea3adee8947c4746d5996c3b75a2' '82f0a263cc0ebc08e43043d8dec5118afb56f5bbaef64a2021dc0b43f6671c5a')
+install=pacmon.install
+_gourl=github.com/veecue/pacmon
+
+build() {
+ GOPATH="$srcdir" go get -fix -v -x $_gourl
+}
+
+check() {
+ GOPATH="$GOPATH:$srcdir" go test -v -x $_gourl
+}
+
+package() {
+ mkdir -p "$pkgdir/usr/bin"
+ install -p -m755 "$srcdir/bin/"* "$pkgdir/usr/bin"
+ mkdir -p "$pkgdir/usr/lib/systemd/system"
+ install -p -m644 "$srcdir/pacmon.service" "$pkgdir/usr/lib/systemd/system"
+ mkdir -p "$pkgdir/usr/share/libalpm/hooks"
+ install -p -m644 "$srcdir/pacmon-mirrorlist.hook" "$pkgdir/usr/share/libalpm/hooks"
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/pacmon-mirrorlist.hook b/pacmon-mirrorlist.hook
new file mode 100644
index 00000000000..97b4329463c
--- /dev/null
+++ b/pacmon-mirrorlist.hook
@@ -0,0 +1,9 @@
+[Trigger]
+Operation = Install
+Operation = Upgrade
+Type = File
+Target = etc/pacman.d/mirrorlist
+
+[Action]
+When = PostTransaction
+Exec = /usr/bin/pacmon mirrorlist
diff --git a/pacmon.install b/pacmon.install
new file mode 100644
index 00000000000..ddc6fe07631
--- /dev/null
+++ b/pacmon.install
@@ -0,0 +1,5 @@
+post_install() {
+ getent passwd pacmon &>/dev/null || useradd -r -s /bin/false pacmon >/dev/null
+ /usr/bin/pacmon mirrorlist
+ true
+}
diff --git a/pacmon.service b/pacmon.service
new file mode 100644
index 00000000000..d9cdae5b330
--- /dev/null
+++ b/pacmon.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=pacmon
+Wants=network-online.target
+After=network-online.target
+
+[Service]
+ExecStart=/usr/bin/pacmon
+User=pacmon
+Restart=always
+
+[Install]
+WantedBy=multi-user.target