Fix makefile to properly use a user-provided prefix
This commit is contained in:
25
Makefile
25
Makefile
@@ -2,6 +2,9 @@ VERSION:=$(shell if [ -d .git ]; then bash -c 'gitversion.sh | grep "^MAJOR=" |
|
|||||||
RELEASE:=$(shell if [ -d .git ]; then bash -c 'gitversion.sh | grep "^BUILD=" | cut -d = -f 2'; else source version.sh && echo $$BUILD ; fi)
|
RELEASE:=$(shell if [ -d .git ]; then bash -c 'gitversion.sh | grep "^BUILD=" | cut -d = -f 2'; else source version.sh && echo $$BUILD ; fi)
|
||||||
DISTFILE=./dist/shunit-$(VERSION)-$(RELEASE).tar.gz
|
DISTFILE=./dist/shunit-$(VERSION)-$(RELEASE).tar.gz
|
||||||
SPECFILE=shunit.spec
|
SPECFILE=shunit.spec
|
||||||
|
ifndef PREFIX
|
||||||
|
PREFIX=/usr
|
||||||
|
endif
|
||||||
ifndef RHEL_VERSION
|
ifndef RHEL_VERSION
|
||||||
RHEL_VERSION=5
|
RHEL_VERSION=5
|
||||||
endif
|
endif
|
||||||
@@ -62,18 +65,18 @@ $(RHEL_DISTFILE): $(DISTFILE)
|
|||||||
mock --verbose -r epel-$(RHEL_VERSION)-noarch ./dist/$(SRPM) --resultdir ./dist/ --define "version $(VERSION)" --define "release $(RHEL_RELEASE)"
|
mock --verbose -r epel-$(RHEL_VERSION)-noarch ./dist/$(SRPM) --resultdir ./dist/ --define "version $(VERSION)" --define "release $(RHEL_RELEASE)"
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
rm -f $(PREFIX)/usr/lib/junit.sh
|
rm -f $(PREFIX)/lib/junit.sh
|
||||||
rm -f $(PREFIX)/usr/lib/tunit.sh
|
rm -f $(PREFIX)/lib/tunit.sh
|
||||||
rm -f $(PREFIX)/usr/bin/shunit.sh
|
rm -f $(PREFIX)/bin/shunit.sh
|
||||||
|
|
||||||
install:
|
install:
|
||||||
mkdir -p $(PREFIX)/usr/bin
|
mkdir -p $(PREFIX)/bin
|
||||||
mkdir -p $(PREFIX)/usr/lib
|
mkdir -p $(PREFIX)/lib
|
||||||
install ./bin/shunit.sh $(PREFIX)/usr/bin/shunit.sh
|
install ./bin/shunit.sh $(PREFIX)/bin/shunit.sh
|
||||||
install ./lib/junit.sh $(PREFIX)/usr/lib/junit.sh
|
install ./lib/junit.sh $(PREFIX)/lib/junit.sh
|
||||||
install ./lib/tunit.sh $(PREFIX)/usr/lib/tunit.sh
|
install ./lib/tunit.sh $(PREFIX)/lib/tunit.sh
|
||||||
|
|
||||||
MANIFEST:
|
MANIFEST:
|
||||||
echo /usr/bin/shunit.sh > MANIFEST
|
echo $(PREFIX)/bin/shunit.sh > MANIFEST
|
||||||
echo /usr/lib/junit.sh >> MANIFEST
|
echo $(PREFIX)/lib/junit.sh >> MANIFEST
|
||||||
echo /usr/lib/tunit.sh >> MANIFEST
|
echo $(PREFIX)/lib/tunit.sh >> MANIFEST
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ shunit is a bash script for running tests scripts that are written with the shun
|
|||||||
|
|
||||||
make install
|
make install
|
||||||
|
|
||||||
... If you want to install it somewhere other than / (not recommended), you can use:
|
... If you want to install it somewhere other than /usr (not recommended), you can use:
|
||||||
|
|
||||||
make PREFIX=/some/other/path install
|
PREFIX=/some/other/path make install
|
||||||
|
|
||||||
... and it will install to /some/other/path/usr/...
|
... and it will install to /some/other/path/usr/...
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user