From 23a78b45b388f1c17b314c5ab71905fbfdaeb414 Mon Sep 17 00:00:00 2001 From: asdf Date: Mon, 4 Nov 2019 14:05:59 +1100 Subject: [PATCH 1/2] Amended Makefile to include additional variables as per #66 --- Makefile | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 5786f8b..8c88dc3 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,17 @@ BINARY := bombadillo PREFIX := /usr/local -MANPREFIX := ${PREFIX}/share/man +EXEC_PREFIX := ${PREFIX} +BINDIR := ${EXEC_PREFIX}/bin +DATAROOTDIR := ${PREFIX}/share +MANDIR := ${DATAROOTDIR}/share/man +MAN1DIR := ${MANDIR}/man1 # Use a dateformat rather than -I flag since OSX # does not support -I. It also doesn't support # %:z - so settle for %z. BUILD_TIME := ${shell date "+%Y-%m-%dT%H:%M%z"} -# If VERSION is empty or not deffined use the contents of the VERSION file +# If VERSION is empty or not defined use the contents of the VERSION file VERSION := ${shell git describe --tags 2> /dev/null} ifndef VERSION VERSION := ${shell cat ./VERSION} @@ -25,13 +29,13 @@ install: install-bin install-man clean .PHONY: install-man install-man: bombadillo.1 gzip -k ./bombadillo.1 - install -d ${DESTDIR}${MANPREFIX}/man1 - install -m 0644 ./bombadillo.1.gz ${DESTDIR}${MANPREFIX}/man1 + install -d ${DESTDIR}${MAN1DIR} + install -m 0644 ./bombadillo.1.gz ${DESTDIR}${MAN1DIR} .PHONY: install-bin install-bin: build - install -d ${DESTDIR}${PREFIX}/bin - install -m 0755 ./${BINARY} ${DESTDIR}${PREFIX}/bin/${BINARY} + install -d ${DESTDIR}${BINDIR} + install -m 0755 ./${BINARY} ${DESTDIR}${BINDIR} .PHONY: clean clean: @@ -40,6 +44,6 @@ clean: .PHONY: uninstall uninstall: clean - rm -f ${DESTDIR}${MANPREFIX}/man1/bombadillo.1.gz - rm -f ${DESTDIR}${PREFIX}/bin/${BINARY} + rm -f ${DESTDIR}${MAN1DIR}/bombadillo.1.gz + rm -f ${DESTDIR}${BINDIR}/${BINARY} From 8e9f2f614f6cdcd054fe7cf2e1c32e6a22f5de98 Mon Sep 17 00:00:00 2001 From: asdf Date: Tue, 5 Nov 2019 13:32:08 +1100 Subject: [PATCH 2/2] Amended README, corrected error in Makefile --- Makefile | 3 +-- README.md | 21 +++++++++------------ 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 8c88dc3..db881aa 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ PREFIX := /usr/local EXEC_PREFIX := ${PREFIX} BINDIR := ${EXEC_PREFIX}/bin DATAROOTDIR := ${PREFIX}/share -MANDIR := ${DATAROOTDIR}/share/man +MANDIR := ${DATAROOTDIR}/man MAN1DIR := ${MANDIR}/man1 # Use a dateformat rather than -I flag since OSX @@ -46,4 +46,3 @@ clean: uninstall: clean rm -f ${DESTDIR}${MAN1DIR}/bombadillo.1.gz rm -f ${DESTDIR}${BINDIR}/${BINARY} - diff --git a/README.md b/README.md index 854b608..72cd746 100644 --- a/README.md +++ b/README.md @@ -70,31 +70,28 @@ The installation location can be overridden at compile time, which can be very u ```shell git clone https://tildegit.org/sloum/bombadillo.git cd bombadillo -sudo make DESTDIR=/some/directory install +sudo make install PREFIX=/some/directory ``` There are two things to know about when using the above format: -1. The above would install Bombadillo to `/some/directory/usr/local/bin`, _not_ to `/some/directory`. So you will want to make sure your `$PATH` is set accordingly. -2. Using the above will install the man page to `/some/directory/usr/local/share/man`, rather than its usual location. You will want to update your `manpath` accordingly. +1. The above would install Bombadillo to `/some/directory/bin`, _not_ to `/some/directory`. So you will want to make sure your `$PATH` is set accordingly. +2. Using the above will install the man page to `/some/directory/share/man/man1`, rather than its usual location. You will want to update your `manpath` accordingly. + +There are other overrides available - please review the [Makefile](Makefile) for more information. #### Uninstall -If you used the makefile to install Bombadillo then uninstalling is very simple. From the Bombadillo source folder run: +If you used the Makefile to install Bombadillo then uninstalling is very simple. From the Bombadillo source folder run: ```shell sudo make uninstall ``` -If you used a custom `DESTDIR` value during install, you will need to supply it when uninstalling: +If you used a custom `PREFIX` value during install, you will need to supply it when uninstalling: + ```shell -sudo make DESTDIR=/some/directory uninstall +sudo make uninstall PREFIX=/some/directory ``` -make PREFIX=~ install -``` - -You can then add `~/bin` to your PATH environment variable, and `~/share/man` to your manpath. - -The `PREFIX` option can be used to install Bombadillo to any location different to `/usr/local`. Uninstall will clean up any build files, remove the installed binary, and remove the man page from the system. If will _not_ remove any directories created as a part of the installation, nor will it remove any Bombadillo user configuration files.