# Rules to fetch, build and install external source packages. # # TODO: # - rules for pre-req dependencies # - rules to build and maintain patches # - rules to run tests before installing # - build and run in chroot # arc ?= $(notdir $(url)) configure_cmd ?= ./configure build_cmd ?= make install_cmd ?= sudo make install uninstall_cmd ?= sudo make uninstall ifdef git_url fetch_cmd = git clone --depth=1 $(git_url) extract_cmd = : dir ?= $(notdir $(git_url)) else fetch_cmd = curl -L $(url) -o $(arc) extract_cmd = gunzip < $(arc) | tar xf - dir ?= $(basename $(basename $(arc))) endif clean: rm -rf .install .build .configure .extract .fetch $(dir) debug: @echo arc = $(arc) @echo dir = $(dir) uninstall: .install cd $(dir) && $(uninstall_cmd) rm .install install: .install build: .build configure: .configure extract: .extract fetch: .fetch .install: .build cd $(dir) && $(install_cmd) @touch $@ .build: .configure cd $(dir) && $(build_cmd) @touch $@ .configure: .extract cd $(dir) && $(configure_cmd) $(configure_flags) @touch $@ .extract: .fetch $(extract_cmd) @touch $@ .fetch: $(fetch_cmd) @touch $@