diff options
author | Mike Gilbert <floppym@gentoo.org> | 2014-03-16 13:44:34 -0400 |
---|---|---|
committer | Mike Gilbert <floppym@gentoo.org> | 2014-03-16 14:00:02 -0400 |
commit | e8bf352d60c5ea83d09a294fe217c905b176d5a2 (patch) | |
tree | 09b7116298f8e64913345ee7acff72a09ed45f19 /Makefile | |
parent | Incorporate prefix support. (diff) | |
download | python-updater-e8bf352d60c5ea83d09a294fe217c905b176d5a2.tar.gz python-updater-e8bf352d60c5ea83d09a294fe217c905b176d5a2.tar.bz2 python-updater-e8bf352d60c5ea83d09a294fe217c905b176d5a2.zip |
Add an install target to the Makefile
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 27 |
1 files changed, 20 insertions, 7 deletions
@@ -1,21 +1,34 @@ # Makefile for python-updater MAN_INCLUDE=man.include VERSION=$(shell ./python-updater -V) -FILES=AUTHORS python-updater python-updater.1 +FILES=AUTHORS Makefile $(MAN_INCLUDE) python-updater.in python-updater.1 PKGDIR=python-updater-$(VERSION) TARBALL=$(PKGDIR).tar.bz2 +INSTALL ?= install +sbindir = $(EPREFIX)/usr/sbin +mandir = $(EPREFIX)/usr/share/man -all: python-updater.1 tarball +all: python-updater python-updater.1 -python-updater.1: python-updater $(MAN_INCLUDE) +python-updater: python-updater.in + sed -e "s:@GENTOO_PORTAGE_EPREFIX@:$(EPREFIX):g" $^ > $@ + chmod +x $@ + +python-updater.1: $(MAN_INCLUDE) help2man -L C -Ni $(MAN_INCLUDE) ./python-updater -o $@ sed -i -e 's/ in the manpage//' \ -e 's/\*[[:space:]]\([[:alpha:]]*\).*/\1 /' $@ -.PHONY: all clean tarball upload -clean: - rm -fr python-updater.1 *.bz2 $(PKGDIR) || true -tarball: $(FILES) +install: python-updater python-updater.1 + $(INSTALL) -d $(DESTDIR)$(sbindir) + $(INSTALL) -m0755 python-updater $(DESTDIR)$(sbindir) + $(INSTALL) -d $(DESTDIR)$(mandir)/man1 + $(INSTALL) -m0644 python-updater.1 $(DESTDIR)$(mandir)/man1 + +.PHONY: all clean tarball upload install +clean: python-updater + rm -fr python-updater python-updater.1 *.bz2 $(PKGDIR) || true +tarball: $(FILES) python-updater mkdir -p $(PKGDIR) cp $(FILES) $(PKGDIR) tar -cjf $(TARBALL) $(PKGDIR) |