Makefile: Fix the 'make install' target

This fixes the 'make install' target to work on a typical RHEL or
Fedora system. We now by default install to a prefix of /usr instead
of /usr/local

The prefix is overridable like so:

     $ make install PREFIX=/opt/
This commit is contained in:
Stef Walter 2018-09-16 09:49:51 +02:00 committed by Brian C. Lane
parent 48f7ad780d
commit 5891879ae4
1 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,7 @@
PYTHON ?= /usr/bin/python3
DESTDIR ?= /
PREFIX ?= /usr
mandir ?= $(PREFIX)/share/man
PKGNAME = lorax
VERSION = $(shell awk '/Version:/ { print $$2 }' $(PKGNAME).spec)
@ -19,7 +21,7 @@ all: src/pylorax/version.py src/composer/version.py
$(PYTHON) setup.py build
install: all
$(PYTHON) setup.py install --root=$(DESTDIR)
$(PYTHON) setup.py install --root=$(DESTDIR) --prefix=$(PREFIX)
mkdir -p $(DESTDIR)/$(mandir)/man1
install -m 644 docs/man/lorax.1 $(DESTDIR)/$(mandir)/man1
install -m 644 docs/man/livemedia-creator.1 $(DESTDIR)/$(mandir)/man1