Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/gentoo-bashcomp:master commit in: /
Date: Fri, 02 Mar 2018 18:07:02
Message-Id: 1409519938.ce8ecda4ece83c04d481acacbed97a61e989cb64.mgorny@gentoo
1 commit: ce8ecda4ece83c04d481acacbed97a61e989cb64
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sun Aug 31 20:30:03 2014 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sun Aug 31 21:18:58 2014 +0000
6 URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=ce8ecda4
7
8 Makefile: introduce a new 'install' rule.
9
10 That handles proper install paths and substitutions.
11
12 Makefile | 31 +++++++++++++++++++++++++++++++
13 1 file changed, 31 insertions(+)
14
15 diff --git a/Makefile b/Makefile
16 index da4702b..f167c7b 100644
17 --- a/Makefile
18 +++ b/Makefile
19 @@ -5,9 +5,40 @@ distapp = gentoo-bashcomp
20 distver := $(shell date -u +%Y%m%d)
21 distpkg := $(distapp)-$(distver)
22
23 +DESTDIR =
24 +EPREFIX =
25 +
26 +# prefer paths from pkg-config, fallback to sane defaults
27 +completionsdir ?= $(or \
28 + $(shell pkg-config --variable=completionsdir bash-completion 2>/dev/null), \
29 + ${EPREFIX}/usr/share/bash-completion/completions)
30 +helpersdir ?= $(or \
31 + $(shell pkg-config --variable=helpersdir bash-completion 2>/dev/null), \
32 + ${EPREFIX}/usr/share/bash-completion/helpers)
33 +compatdir ?= $(or \
34 + $(shell pkg-config --variable=compatdir bash-completion 2>/dev/null), \
35 + ${EPREFIX}/etc/bash_completion.d)
36 +
37 +completions := $(wildcard completions/*)
38 +helpers := $(wildcard helpers/*)
39 +compats := $(wildcard compat/*)
40 +
41 +POSTINST_SED = sed -i -e "s|@GENTOO_PORTAGE_EPREFIX@|${EPREFIX}|g" -e "s|@helpersdir@|$(helpersdir)|"
42 +
43 all:
44 @echo Nothing to compile.
45
46 +install:
47 + install -d "$(DESTDIR)$(completionsdir)"
48 + install -m0644 $(completions) "$(DESTDIR)$(completionsdir)"
49 + $(POSTINST_SED) $(addprefix "$(DESTDIR)$(completionsdir)"/,$(notdir $(completions)))
50 + install -d "$(DESTDIR)$(helpersdir)"
51 + install -m0644 $(helpers) "$(DESTDIR)$(helpersdir)"
52 + $(POSTINST_SED) $(addprefix "$(DESTDIR)$(helpersdir)"/,$(notdir $(helpers)))
53 + install -d "$(DESTDIR)$(compatdir)"
54 + install -m0644 $(compats) "$(DESTDIR)$(compatdir)"
55 + $(POSTINST_SED) $(addprefix "$(DESTDIR)$(compatdir)"/,$(notdir $(compats)))
56 +
57 tag:
58 git pull
59 git tag -a $(distpkg) -m "tag $(distpkg)"