From: tachylatus Date: Thu, 30 Jan 2014 11:31:29 +0000 (+0100) Subject: Support DESTDIR + improvements for easy packaging X-Git-Tag: 1.0~147^2 X-Git-Url: https://git.donarmstrong.com/?p=deb_pkgs%2Fautorandr.git;a=commitdiff_plain;h=6a04c1b9134bc5f2be74f7c753e3c0469e9d02de Support DESTDIR + improvements for easy packaging --- diff --git a/Makefile b/Makefile index a22a058..f1d2725 100644 --- a/Makefile +++ b/Makefile @@ -4,11 +4,16 @@ all: INSTALL_PATH=/usr/local/bin install: - install auto-disper ${INSTALL_PATH} - install -m 755 autorandr ${INSTALL_PATH} - install -m 644 bash_completion/autorandr /etc/bash_completion.d/ + install -D auto-disper ${DESTDIR}${INSTALL_PATH}/auto-disper + install -D -m 755 autorandr ${DESTDIR}${INSTALL_PATH}/autorandr + install -D -m 644 bash_completion/autorandr ${DESTDIR}/etc/bash_completion.d/autorandr hotplug: - install -m 755 pm-utils/40autorandr /etc/pm/sleep.d/ - install -m 644 udev/40-monitor-hotplug.rules /etc/udev/rules.d/ + install -D -m 755 pm-utils/40autorandr ${DESTDIR}/etc/pm/sleep.d/40autorandr + install -D -m 644 udev/40-monitor-hotplug.rules ${DESTDIR}/etc/udev/rules.d/40-monitor-hotplug.rules +ifeq (${USER},root) udevadm control --reload-rules +else + @echo "Please run this command as root:" + @echo " udevadm control --reload-rules" +endif