Browse Source

Add Arch Linux build script

master
Pekka Helenius 4 years ago
parent
commit
a5cb037eb4
2 changed files with 46 additions and 0 deletions
  1. +32
    -0
      arch_linux/PKGBUILD
  2. +14
    -0
      arch_linux/wanip-checker.install

+ 32
- 0
arch_linux/PKGBUILD View File

@ -0,0 +1,32 @@
# Maintainer: Pekka Helenius <fincer89 [at] hotmail [dot] com>
pkgname=wanip-checker
pkgver=22.9e5e6ed
pkgrel=1
pkgdesc='WAN IPv4 checker & email notifier for servers behind dynamic IP/DHCP'
arch=('any')
url="https://github.com/Fincer/${pkgname}"
license=('GPLv3')
depends=('systemd' 'ssmtp' 'curl' 'bash' 'awk')
makedepends=('git')
options=(!emptydirs)
install=${pkgname}.install
source=("git+${url}.git")
sha256sums=('SKIP')
pkgver() {
cd $pkgname
if [[ $(git describe) ]]; then
git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
else
echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
fi
}
package() {
cd $pkgname
install -Dt ${pkgdir}/usr/lib/systemd/system/ -m0644 wanchecker.{service,timer}
install -Dt ${pkgdir}/etc/ssmtp/ -m0750 ssmtp_conf-sample/wanchecker.sh
install -Dt ${pkgdir}/etc/ssmtp/ -m0640 ssmtp_conf-sample/wanchecker.conf
}

+ 14
- 0
arch_linux/wanip-checker.install View File

@ -0,0 +1,14 @@
post_install() {
echo "Configure files /etc/ssmtp/revaliases, /etc/ssmtp/ssmtp.conf and /etc/ssmtp/wanchecker.conf
after which run:
systemctl enable wanchecker.timer
systemctl start wanchecker.timer
See example SSMTP configuration files on https://github.com/Fincer/wanip-checker
"
chown root.mail /etc/ssmtp/wanchecker.{sh,conf}
}
post_upgrade() {
post_install
}

Loading…
Cancel
Save