diff --git a/Makefile b/Makefile index c06c9ab..4571eef 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,7 @@ ZAF_EXPORT_OPTS=$(foreach o,$(ZAF_OPTIONS),$(shell echo $(o)|cut -d '=' -f 1)) DEBIAN_DIR=tmp/deb DEBIAN_CTRL=$(DEBIAN_DIR)/DEBIAN DEBIAN_PKG=$(shell . lib/zaf.lib.sh; echo out/zaf-$$ZAF_VERSION.deb) +ARCH_DIR=archlinux ifeq ($(ZAF_DEBUG),) ZAF_DEBUG=0 endif @@ -24,9 +25,14 @@ help: @echo IPLUGINS will be downloaded and installed after package is installed. Can be name or url accessible after package installation. @echo -deb: $(DEBIAN_PKG) +deb: + $(DEBIAN_PKG) -$(DEBIAN_PKG): deb-clean deb-init deb-deps deb-control deb-scripts deb-cp deb-package +arch: + $(ARCH_PKG) + +$(DEBIAN_PKG): deb-clean deb-init deb-deps deb-control deb-scripts deb-cp deb-package +$(ARCH_PKG): arch-clean arch-build clean: @rm -rf tmp/* out/* @@ -88,4 +94,9 @@ deb-package: @echo PLUGINS in postinst: $(IPLUGINS) @echo - +arch-clean: + @cd $(ARCH_DIR) + git clean -ffdx + +arch-build: + @cd $(ARCH_DIR) && makepkg -f diff --git a/archlinux/PKGBUILD b/archlinux/PKGBUILD new file mode 100644 index 0000000..6bb331d --- /dev/null +++ b/archlinux/PKGBUILD @@ -0,0 +1,38 @@ +pkgname="zaf-git" +pkgver=${PKGVER:-autogenerated} +pkgrel=${PKGREL:-1} +pkgdesc="zabbix agent framework - a cli tool for zabbix" +arch=("i686" "x86_64") +license=("GPL") +depends=( + "lsb-release" + "git" +) +backup=( + "etc/zaf.conf" +) +source=( + "zaf-git::git://github.com/limosek/zaf#branch=master" +) +md5sums=("SKIP") + +pkgver() { + cd "$srcdir/$pkgname" + local date=$(git log -1 --format="%cd" --date=short | sed s/-//g) + local count=$(git rev-list --count HEAD) + local commit=$(git rev-parse --short HEAD) + echo "$date.${count}_$commit" +} + +build() { + cd "$srcdir/$pkgname" + + : +} + +package() { + cd "$srcdir/$pkgname" + + INSTALL_PREFIX="$pkgdir" \ + ./install.sh auto +}