only install to /etc if PREFIX is /usr or /usr/local
authorchocolateboy <chocolate@cpan.org>
Fri, 10 May 2013 21:47:37 +0000 (22:47 +0100)
committerchocolateboy <chocolate@cpan.org>
Fri, 10 May 2013 22:05:58 +0000 (23:05 +0100)
Makefile

index 84ea70d2c477a361bac374b58f6cecda3427e7bb..e00f5e6503525d631e36b9f83de0be5716d2d786 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -9,9 +9,19 @@ cleanall: clean
 PREFIX=/usr/local
 BINDIR=$(PREFIX)/bin
 MANDIR=$(PREFIX)/man
-SYSCONFDIR=/etc
 PYTHON=/usr/bin/env python
 
+# set SYSCONFDIR to /etc if PREFIX=/usr or PREFIX=/usr/local
+ifeq ($(PREFIX),/usr)
+    SYSCONFDIR=/etc
+else
+    ifeq ($(PREFIX),/usr/local)
+        SYSCONFDIR=/etc
+    else
+        SYSCONFDIR=$(PREFIX)/etc
+    endif
+endif
+
 install: youtube-dl youtube-dl.1 youtube-dl.bash-completion
        install -d $(DESTDIR)$(BINDIR)
        install -m 755 youtube-dl $(DESTDIR)$(BINDIR)