From 5738240ee829684815bdb9e6a9028d3465140b48 Mon Sep 17 00:00:00 2001
From: chocolateboy <chocolate@cpan.org>
Date: Fri, 10 May 2013 22:47:37 +0100
Subject: [PATCH] only install to /etc if PREFIX is /usr or /usr/local

---
 Makefile | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 84ea70d2c..e00f5e650 100644
--- 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)