From 9938ce0de63ae8ea780daed3d6551832cb48c96b Mon Sep 17 00:00:00 2001 From: B Stack Date: Fri, 20 Mar 2020 15:27:14 -0400 Subject: add lm trayicon, and fix #1 Add program, its menu entry, and xdg autostart entry (disabled) Fix #1: cli executes valid command but still shows help message --- src/Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index 96607d2..010b71e 100644 --- a/src/Makefile +++ b/src/Makefile @@ -18,7 +18,7 @@ # Dependencies: APPNAME = logout-manager -APPVERSION = 0.0.1 +APPVERSION = 0.0.2 SRCDIR = $(CURDIR) prefix = /usr SYSCONFDIR = $(DESTDIR)/etc @@ -32,6 +32,7 @@ APPDIR = $(SHAREDIR)/$(APPNAME) APPSDIR = $(SHAREDIR)/applications BASHCDIR = $(SHAREDIR)/bash-completion/completions SUDOERSDIR = $(SYSCONFDIR)/sudoers.d +XDGAUTODIR = $(SYSCONFDIR)/xdg/autostart awkbin :=$(shell which awk) cpbin :=$(shell which cp) @@ -67,7 +68,7 @@ install: @${echobin} Installing files to ${DESTDIR} ${installbin} -d ${SYSCONFDIR} ${DEFAULTDIR} ${BINDIR} \ ${APPSDIR} ${APPDIR} ${DOCDIR} ${BASHCDIR} ${SUDOERSDIR} \ - ${LIBEXECDIR}/${APPNAME} + ${LIBEXECDIR}/${APPNAME} ${XDGAUTODIR} ${cpbin} -pr ${SRCDIR}/etc/*.* ${SYSCONFDIR} ${cpbin} -pr ${SRCDIR}/etc/sysconfig/* ${DEFAULTDIR} ${cpbin} -pr ${SRCDIR}/usr/bin/* ${BINDIR} @@ -77,6 +78,7 @@ install: ${installbin} -m 0644 -t ${BASHCDIR} ${SRCDIR}/usr/share/bash-completion/completions/* ${installbin} -m 0640 -t ${SUDOERSDIR} ${SRCDIR}/etc/sudoers.d/* ${installbin} -m 0755 -t ${LIBEXECDIR}/${APPNAME} ${SRCDIR}/usr/libexec/${APPNAME}/* + ${installbin} -m 0644 -t ${XDGAUTODIR} ${SRCDIR}/etc/xdg/autostart/* # symlink, when alternatives is not being used ${lnbin} -s logout-manager-gtk.py ${BINDIR}/logout-manager -- cgit From 81aec2b35e2f61319080fabf9cd3c43113eadbae Mon Sep 17 00:00:00 2001 From: B Stack Date: Thu, 2 Apr 2020 08:58:32 -0400 Subject: add man pages and drop .py endings --- src/Makefile | 44 ++++++++++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 14 deletions(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index 010b71e..009da93 100644 --- a/src/Makefile +++ b/src/Makefile @@ -16,9 +16,11 @@ # Document: # Includes a nice way to dynamically generate dependencies as self-reported by all the files. # Dependencies: +# exclude-raw: go-md2man +# exclude-devuan: go-md2man APPNAME = logout-manager -APPVERSION = 0.0.2 +APPVERSION = 0.0.3 SRCDIR = $(CURDIR) prefix = /usr SYSCONFDIR = $(DESTDIR)/etc @@ -27,10 +29,11 @@ DEFAULTDIR = $(DESTDIR)/etc/sysconfig BINDIR = $(DESTDIR)$(prefix)/bin SHAREDIR = $(DESTDIR)$(prefix)/share LIBEXECDIR = $(DESTDIR)$(prefix)/libexec -DOCDIR = $(SHAREDIR)/doc/$(APPNAME) APPDIR = $(SHAREDIR)/$(APPNAME) APPSDIR = $(SHAREDIR)/applications BASHCDIR = $(SHAREDIR)/bash-completion/completions +DOCDIR = $(SHAREDIR)/doc/$(APPNAME) +MANDIR = $(SHAREDIR)/man SUDOERSDIR = $(SYSCONFDIR)/sudoers.d XDGAUTODIR = $(SYSCONFDIR)/xdg/autostart @@ -39,8 +42,10 @@ cpbin :=$(shell which cp) echobin :=$(shell which echo) findbin :=$(shell which find) grepbin :=$(shell which grep) +gzipbin :=$(shell which gzip) installbin :=$(shell which install) lnbin :=$(shell which ln) +md2manbin :=$(shell which go-md2man) rmbin :=$(shell which rm) sedbin :=$(shell which sed) sortbin :=$(shell which sort) @@ -48,23 +53,28 @@ truebin :=$(shell which true) uniqbin :=$(shell which uniq) xargsbin :=$(shell which xargs) +SEPARATOR ?=, + all: - ${echobin} "No compilation in this package." + @${echobin} "No compilation in this package." -.PHONY: clean install uninstall list deplist deplist_opts +.PHONY: clean install uninstall list deplist deplist_opts install_files install_man list: @$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | ${awkbin} -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | ${sortbin} | ${grepbin} -E -v -e '^[^[:alnum:]]' -e '^$@$$' deplist: @if test -z "$(DISTRO)" ; then ${echobin} "Please run \`make deplist\` with DISTRO= one of: `make deplist_opts 2>&1 1>/dev/null | ${xargsbin}`. Aborted." ; exit 1 ; fi - @${grepbin} -h --exclude='Makefile' --exclude-dir='doc' -A5 -riIE dependencies $(SRCDIR) | ${awkbin} -v 'distro=$(DISTRO)' 'tolower($$0) ~ distro {$$1="";$$2="";print}' | ${awkbin} 'BEGIN{cmd="${xargsbin} -n1"} $$0 !~ /\(/{print $$0 | cmd ; close(cmd);} $$0 ~ /\(/{print;}' | ${sortbin} | ${uniqbin} | ${sedbin} -r -e 's/$$/$(SEPARATOR)/' | ${xargsbin} + @# deplist 2020-03-24 input must be comma separated + @${grepbin} -h --exclude-dir='doc' -riIE '\&2 - @${echobin} "devuan" 1>&2 + @# deplist_opts 2020-03-24 find all available dependency domains + @${grepbin} -h -o -riIE '\&2 -install: +install: install_files install_man + +install_files: @${echobin} Installing files to ${DESTDIR} ${installbin} -d ${SYSCONFDIR} ${DEFAULTDIR} ${BINDIR} \ ${APPSDIR} ${APPDIR} ${DOCDIR} ${BASHCDIR} ${SUDOERSDIR} \ @@ -80,17 +90,23 @@ install: ${installbin} -m 0755 -t ${LIBEXECDIR}/${APPNAME} ${SRCDIR}/usr/libexec/${APPNAME}/* ${installbin} -m 0644 -t ${XDGAUTODIR} ${SRCDIR}/etc/xdg/autostart/* # symlink, when alternatives is not being used - ${lnbin} -s logout-manager-gtk.py ${BINDIR}/logout-manager + ${lnbin} -s logout-manager-gtk ${BINDIR}/logout-manager || : + +install_man: +ifeq ($(md2manbin),) + @${echobin} Cannot install man pages, because go-md2man is not found. + @false +endif + ${installbin} -d ${MANDIR}/man1 ${MANDIR}/man5 ${MANDIR}/man7 + @#${md2manbin} < ${SRCDIR}/usr/share/man/man6/${APPNAME}.6.md | ${gzipbin} > ${MANDIR}/man6/${APPNAME}.6.gz + for tm in $$( ${findbin} ${SRCDIR}/usr/share/man ! -type d -name '*[0-9].md' -printf '%P\n' ) ; do ${md2manbin} < ${SRCDIR}/usr/share/man/$${tm} > ${MANDIR}/$${tm%%.md}.gz ; done uninstall: @${echobin} SRCDIR=${SRCDIR} - ${rmbin} -f $$( ${findbin} ${SRCDIR} -mindepth 1 ! -type d -printf '%p\n' | ${sedbin} -r -e "s:^${SRCDIR}:${DESTDIR}:" ) ${DEFAULTDIR}/${APPNAME} ${BINDIR}/logout-manager - - # absolute minimum directories to remove - #${rmbin} -rf ${APPDIR} ${SYSCONFDIR}/${APPNAME} ${DOCDIR} + ${rmbin} -f $$( ${findbin} ${SRCDIR} -mindepth 1 ! -type d ! -name 'Makefile' -printf '%p\n' | ${sedbin} -r -e "s:^${SRCDIR}:${DESTDIR}:" -e '/man[0-9]\/.*[0-9]\.md$$/{s:\.md$$:.gz:}' ) ${DEFAULTDIR}/${APPNAME} ${BINDIR}/logout-manager # remove all installed directories that are now blank. rmdir ${DEFAULTDIR} 2>/dev/null ; for word in $$( ${findbin} ${SRCDIR} -mindepth 1 -type d -printf '%p\n' | ${sedbin} -r -e "s:^${SRCDIR}:${DESTDIR}:" | ${awkbin} '{ print length, $$0 }' | sort -rn | ${awkbin} '{print $$2}' ) ; do ${findbin} $${word} -mindepth 1 1>/dev/null 2>&1 | read 1>/dev/null 2>&1 || { rmdir "$${word}" 2>/dev/null || ${truebin} ; } ; done clean: - -${echobin} "target $@ not implemented yet! Gotta say unh." + -@${echobin} "target $@ not implemented yet! Gotta say unh." -- cgit From d55c9d99b1268b16c019ca89ba516b2c5f93232f Mon Sep 17 00:00:00 2001 From: B Stack Date: Thu, 2 Apr 2020 13:48:50 -0400 Subject: actually apply those fixes --- src/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index 009da93..28b65c8 100644 --- a/src/Makefile +++ b/src/Makefile @@ -98,8 +98,7 @@ ifeq ($(md2manbin),) @false endif ${installbin} -d ${MANDIR}/man1 ${MANDIR}/man5 ${MANDIR}/man7 - @#${md2manbin} < ${SRCDIR}/usr/share/man/man6/${APPNAME}.6.md | ${gzipbin} > ${MANDIR}/man6/${APPNAME}.6.gz - for tm in $$( ${findbin} ${SRCDIR}/usr/share/man ! -type d -name '*[0-9].md' -printf '%P\n' ) ; do ${md2manbin} < ${SRCDIR}/usr/share/man/$${tm} > ${MANDIR}/$${tm%%.md}.gz ; done + for tm in $$( ${findbin} ${SRCDIR}/usr/share/man ! -type d -name '*[0-9].md' -printf '%P\n' ) ; do ${md2manbin} < ${SRCDIR}/usr/share/man/$${tm} | ${gzipbin} > ${MANDIR}/$${tm%%.md}.gz ; done uninstall: @${echobin} SRCDIR=${SRCDIR} -- cgit From 85fee7e775d21361681bf0413d729f872ec1d710 Mon Sep 17 00:00:00 2001 From: B Stack Date: Fri, 3 Apr 2020 10:15:16 -0400 Subject: bump version to 0.0.4 --- src/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index 28b65c8..6407823 100644 --- a/src/Makefile +++ b/src/Makefile @@ -20,7 +20,7 @@ # exclude-devuan: go-md2man APPNAME = logout-manager -APPVERSION = 0.0.3 +APPVERSION = 0.0.4 SRCDIR = $(CURDIR) prefix = /usr SYSCONFDIR = $(DESTDIR)/etc -- cgit