summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu Clabaut <mathieu.clabaut@gmail.com>2007-12-21 15:47:30 -0600
committerJoey Hess <joey@kodama.kitenet.net>2008-01-03 19:53:45 -0500
commit9ea07a1d87689df106d4fe1b0e76237aeea32630 (patch)
tree764a6bea8bc3cf9dc191fa89a15dd5aa21da2f37
parent3021117f7b4e17041d96e4906fce90a1ccd0183e (diff)
Makefile cleaning + use of DESTDIR
-rw-r--r--Makefile25
1 files changed, 18 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 17ac854..488b5cc 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,19 @@
+DESTDIR ?=
+prefix = /usr
+bindir = ${prefix}/bin
+etcdir = /etc
+mandir = ${prefix}/man1
+
+INSTALL = install
+INSTALL_EXE = ${INSTALL}
+INSTALL_DATA = ${INSTALL} -m 0644 -D
+
install:
- mkdir -p $(PREFIX)/etc/etckeeper/
- cp -a *.d $(PREFIX)/etc/etckeeper/
- cp etckeeper.conf $(PREFIX)/etc/etckeeper/
- install -D etckeeper $(PREFIX)/usr/bin/etckeeper
- install -m 0644 -D apt.conf $(PREFIX)/etc/apt/apt.conf.d/05etckeeper
- install -m 0644 -D etckeeper.1 $(PREFIX)/usr/share/man/man1/etckeeper.1
- install -m 0644 -D bash_completion $(PREFIX)/etc/bash_completion.d/etckeeper \ No newline at end of file
+ mkdir -p $(DESTDIR)$(etcdir)/etckeeper/
+ $(INSTALL_DATA) etckeeper.conf $(DESTDIR)$(etcdir)/etckeeper/etckeeper.conf
+ cp -a *.d $(DESTDIR)$(etcdir)/etckeeper/
+ chown root.root -R $(DESTDIR)$(etcdir)/etckeeper/
+ $(INSTALL_EXE) etckeeper $(DESTDIR)$(bindir)/etckeeper
+ $(INSTALL_DATA) apt.conf $(DESTDIR)$(etcdir)/apt/apt.conf.d/05etckeeper
+ $(INSTALL_DATA) etckeeper.1 $(DESTDIR)$(mandir)/man1/etckeeper.1
+ $(INSTALL_DATA) bash_completion $(DESTDIR)$(etcdir)/bash_completion.d/etckeeper