Skip to content

Commit 40433bf

Browse files
committed
add install target
1 parent 9555f41 commit 40433bf

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

Makefile

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ ifeq ($(OS),Windows_NT)
33
else
44
PATHSEP = :
55
endif
6-
export GIT_EXEC_PATH := $(CURDIR)$(PATHSEP)$(shell git --exec-path)
6+
ORIG_EXEC_PATH := $(shell git --exec-path)
7+
export GIT_EXEC_PATH := $(CURDIR)$(PATHSEP)$(ORIG_EXEC_PATH)
78
export MANPATH := $(CURDIR)$(PATHSEP)$(MANPATH)
89
VERBOSE :=
910
TESTREPO := $(CURDIR)
@@ -15,7 +16,7 @@ REPO := incrypt::$(CURDIR)/crypt
1516
all: man
1617

1718
ifndef NODOC
18-
man: man1/git-incrypt.1
19+
man: man1/git-incrypt.1.gz
1920
testman: man
2021
PAGER= git incrypt --help
2122
else
@@ -30,6 +31,9 @@ man1/%.xml: %.adoc asciidoc.conf
3031
mkdir -p man1
3132
asciidoc -f $(word 2, $^) -b docbook -d manpage -o $@ $<
3233

34+
%.gz: %
35+
gzip $<
36+
3337
test: testman
3438
rm -rf crypt tst
3539
mkdir crypt
@@ -51,5 +55,17 @@ test: testman
5155
pylint git-incrypt
5256
pycodestyle git-incrypt
5357

58+
PKGNAME := git-incrypt
59+
LICENSEDIR := /usr/share/licenses
60+
DOCDIR := /usr/share/doc
61+
MANDIR := /usr/share/man
62+
63+
install: man
64+
install -D -m 755 -t $(DESTDIR)$(ORIG_EXEC_PATH) git-incrypt
65+
ln -s git-incrypt $(DESTDIR)$(ORIG_EXEC_PATH)/git-remote-incrypt
66+
install -D -m 644 -t $(DESTDIR)$(LICENSEDIR)/$(PKGNAME) COPYING
67+
install -D -m 644 -t $(DESTDIR)$(DOCDIR)/$(PKGNAME) FORMAT.md README.md
68+
install -D -m 644 -t $(DESTDIR)$(MANDIR)/man1 man1/git-incrypt.1.gz
69+
5470
clean:
5571
rm -rf man1 crypt tst

0 commit comments

Comments
 (0)