summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gilbert <floppym@gentoo.org>2014-03-16 13:44:34 -0400
committerMike Gilbert <floppym@gentoo.org>2014-03-16 14:00:02 -0400
commite8bf352d60c5ea83d09a294fe217c905b176d5a2 (patch)
tree09b7116298f8e64913345ee7acff72a09ed45f19
parentIncorporate prefix support. (diff)
downloadpython-updater-e8bf352d60c5ea83d09a294fe217c905b176d5a2.tar.gz
python-updater-e8bf352d60c5ea83d09a294fe217c905b176d5a2.tar.bz2
python-updater-e8bf352d60c5ea83d09a294fe217c905b176d5a2.zip
Add an install target to the Makefile
-rw-r--r--Makefile27
-rw-r--r--[-rwxr-xr-x]python-updater.in (renamed from python-updater)0
2 files changed, 20 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 30d33b8..a723c79 100644
--- a/Makefile
+++ b/Makefile
@@ -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)
diff --git a/python-updater b/python-updater.in
index 68c6ead..68c6ead 100755..100644
--- a/python-updater
+++ b/python-updater.in