From da32602943b11426f9602ba49f1d0ce05d5ebbca Mon Sep 17 00:00:00 2001 From: Person1873 <87143469+Person1873@users.noreply.github.com> Date: Tue, 31 Oct 2023 17:39:38 +1100 Subject: [PATCH 1/2] bugfix: checkinstall fails & dwm-msg not removed on uninstall this patch modifies the makefile to use the "install" command which behaves like cp,chmod,chown,mkdir all rolled into one. this simplifies the makefile & also makes it compatible with "checkinstall" on debian systems. --- Makefile | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index bc984d74..f6e4cb4f 100644 --- a/Makefile +++ b/Makefile @@ -47,25 +47,27 @@ dist: clean install: all mkdir -p ${DESTDIR}${PREFIX}/bin - cp -f dwm ${DESTDIR}${PREFIX}/bin + install -C -m 0755 dwm ${DESTDIR}${PREFIX}/bin/ ifdef YAJLLIBS - cp -f dwm-msg ${DESTDIR}${PREFIX}/bin + install -C -m 0755 dwm-msg ${DESTDIR}${PREFIX}/bin/ endif #cp -f patch/dwmc ${DESTDIR}${PREFIX}/bin - chmod 755 ${DESTDIR}${PREFIX}/bin/dwm + #chmod 755 ${DESTDIR}${PREFIX}/bin/dwm ifdef YAJLLIBS - chmod 755 ${DESTDIR}${PREFIX}/bin/dwm-msg + #chmod 755 ${DESTDIR}${PREFIX}/bin/dwm-msg endif - mkdir -p ${DESTDIR}${MANPREFIX}/man1 + #mkdir -p ${DESTDIR}${MANPREFIX}/man1 + install -C -m 0755 dwm.1 -D ${DESTDIR}${MANPREFIX}/man1/dwm.1 sed "s/VERSION/${VERSION}/g" < dwm.1 > ${DESTDIR}${MANPREFIX}/man1/dwm.1 - chmod 644 ${DESTDIR}${MANPREFIX}/man1/dwm.1 mkdir -p ${DESTDIR}${PREFIX}/share/xsessions - test -f ${DESTDIR}${PREFIX}/share/xsessions/dwm.desktop || cp -n dwm.desktop ${DESTDIR}${PREFIX}/share/xsessions - chmod 644 ${DESTDIR}${PREFIX}/share/xsessions/dwm.desktop + install -C -m 0644 dwm.desktop ${DESTDIR}${PREFIX}/share/xsessions uninstall: rm -f ${DESTDIR}${PREFIX}/bin/dwm\ ${DESTDIR}${MANPREFIX}/man1/dwm.1\ ${DESTDIR}${PREFIX}/share/xsessions/dwm.desktop +ifdef YAJLLIBS + rm -f ${DESTDIR}${PREFIX}/bin/dwm-msg +endif .PHONY: all clean dist install uninstall From a06cd0f263508f5349b8c676e4aa386fd2f5e5f1 Mon Sep 17 00:00:00 2001 From: Person1873 <87143469+Person1873@users.noreply.github.com> Date: Tue, 31 Oct 2023 18:02:39 +1100 Subject: [PATCH 2/2] Update Makefile make checkinstall run more reliably --- Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index f6e4cb4f..9c2dcb90 100644 --- a/Makefile +++ b/Makefile @@ -46,10 +46,10 @@ dist: clean rm -rf dwm-${VERSION} install: all - mkdir -p ${DESTDIR}${PREFIX}/bin - install -C -m 0755 dwm ${DESTDIR}${PREFIX}/bin/ + #mkdir -p ${DESTDIR}${PREFIX}/bin + install -C -D -m 0755 dwm ${DESTDIR}${PREFIX}/bin/dwm ifdef YAJLLIBS - install -C -m 0755 dwm-msg ${DESTDIR}${PREFIX}/bin/ + install -C -D -m 0755 dwm-msg ${DESTDIR}${PREFIX}/bin/dwm-msg endif #cp -f patch/dwmc ${DESTDIR}${PREFIX}/bin #chmod 755 ${DESTDIR}${PREFIX}/bin/dwm @@ -59,8 +59,8 @@ endif #mkdir -p ${DESTDIR}${MANPREFIX}/man1 install -C -m 0755 dwm.1 -D ${DESTDIR}${MANPREFIX}/man1/dwm.1 sed "s/VERSION/${VERSION}/g" < dwm.1 > ${DESTDIR}${MANPREFIX}/man1/dwm.1 - mkdir -p ${DESTDIR}${PREFIX}/share/xsessions - install -C -m 0644 dwm.desktop ${DESTDIR}${PREFIX}/share/xsessions + #mkdir -p ${DESTDIR}${PREFIX}/share/xsessions + install -C -D -m 0644 dwm.desktop ${DESTDIR}${PREFIX}/share/xsessions/dwm.desktop uninstall: rm -f ${DESTDIR}${PREFIX}/bin/dwm\