summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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