
diff : PKGBUILD.vanilla PKGBUILD.patched
	! diff $^ > nginx-pam.diff

apply :
	rm nginx-pam -rf
	mkdir -p nginx-pam
	curl -o nginx-pam/PKGBUILD https://git.archlinux.org/svntogit/packages.git/plain/trunk/PKGBUILD?h=packages/nginx
	curl -o nginx-pam/logrotate https://git.archlinux.org/svntogit/packages.git/plain/trunk/logrotate?h=packages/nginx
	curl -o nginx-pam/nginx.install https://git.archlinux.org/svntogit/packages.git/plain/trunk/nginx.install?h=packages/nginx
	curl -o nginx-pam/service https://git.archlinux.org/svntogit/packages.git/plain/trunk/service?h=packages/nginx
	patch nginx-pam/PKGBUILD nginx-pam.diff

build : apply
	cd nginx-pam && makepkg -sr

%.pkg.tar.xz : build

install : $(wildcard nginx-pam/nginx-pam*.pkg.tar.xz)
	pacman $(PACFLAGS) -U $<
