# Tue Oct 12 10:46:03 EDT 2010 # # Created by: Vincent Batts, vbatts@hashbangbash.com # # Make help http://hashbangbash.com/~vbatts/Books/make/ # TMP := /tmp/pam_hackings TAG := pam sourcedir := source packages := \ cracklib \ pam \ shadow \ polkit \ at \ libcgroup \ ConsoleKit \ proftpd \ popa3d \ netatalk \ openssh \ openvpn \ vsftpd \ samba \ ppp \ hplip \ sudo \ screen \ xscreensaver \ xlockmore \ cups #kdebase-workspace \ find_files = $(shell find $(sourcedir)/*/$(1)/ -type f) $(foreach pkg,$(packages),$(eval files_$(pkg) := $(call find_files,$(pkg)))) .PHONY: all all: install-all build-all: $(addprefix .,$(addsuffix .build,$(packages))) install-all: $(addprefix .,$(addsuffix .install,$(packages))) .%.install: .%.build $(eval pkg_name=$(subst .,,$(subst install,,$@))) $(eval choice=$(shell ls -t $(TMP)/$(pkg_name)*.t?z | head -1)) sudo /sbin/upgradepkg --reinstall --install-new \ $(choice) && \ touch $(PWD)/$@ .%.build: $(files_$(subst .,,$(subst build,,$@))) $(eval pkg_name=$(subst .,,$(subst build,,$@))) $(eval build=$(shell grep ^BUILD $(sourcedir)/*/$(pkg_name)/$(pkg_name).SlackBuild | sed 's/^.*\([[:digit:]]\).*$$/\1_$(TAG)/g')) cd $(sourcedir)/*/$(pkg_name) && \ sudo TMP=$(TMP) \ BUILD=$(build) \ sh $(pkg_name).SlackBuild && \ touch $(PWD)/$@ .%.clean: $(eval pkg_name=$(subst .,,$(subst clean,,$@))) rm -rf $(PWD)/.$(pkg_name).build $(PWD)/.$(pkg_name).install help: @echo @echo This Makefile has a synthetic setup, so the targets are not static @echo @echo the avaiable synthetic install targets are @echo $(addprefix .,$(addsuffix .install,$(packages))) @echo @echo the avaiable synthetic build targets are @echo $(addprefix .,$(addsuffix .build,$(packages))) @echo @echo the avaiable synthetic clean targets are @echo $(addprefix .,$(addsuffix .clean,$(packages))) @echo @echo touch: touch $(addprefix $(PWD)/.,$(addsuffix .build,$(packages))) touch $(addprefix $(PWD)/.,$(addsuffix .install,$(packages))) clean: rm -rf $(PWD)/.*.build $(PWD)/.*.install find . -name '*~' | xargs rm -f dist-clean: clean sudo rm -rf $(TMP)/package-*