1 |
commit: be1016621c919ec293667becd69e6dd2b854a2fc |
2 |
Author: Marek Szuba <marecki <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Jun 13 12:03:51 2021 +0000 |
4 |
Commit: Marek Szuba <marecki <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jun 13 12:08:44 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=be101662 |
7 |
|
8 |
dev-vcs/git-flow: some QA fixes |
9 |
|
10 |
1. Inherit eclasses before declaring any variables, just in case; |
11 |
2. Fix indentation of SRC_URI; |
12 |
3. Put non-executable support scripts in /usr/libexec/git-flow instead |
13 |
of polluting /usr/bin; |
14 |
4. Use PF rather than P as the directory name for docs; |
15 |
5. Change the sed delimiter to ! so that slashes in paths do not have to |
16 |
be escaped; |
17 |
6. Install to ED rather than D so that we (hopefully) support Prefix. |
18 |
|
19 |
Signed-off-by: Marek Szuba <marecki <AT> gentoo.org> |
20 |
|
21 |
.../git-flow/files/git-flow-1.12.3_scriptdir.patch | 72 ++++++++++++++++++++++ |
22 |
dev-vcs/git-flow/git-flow-1.12.3-r1.ebuild | 46 ++++++++++++++ |
23 |
2 files changed, 118 insertions(+) |
24 |
|
25 |
diff --git a/dev-vcs/git-flow/files/git-flow-1.12.3_scriptdir.patch b/dev-vcs/git-flow/files/git-flow-1.12.3_scriptdir.patch |
26 |
new file mode 100644 |
27 |
index 00000000000..34fab234d41 |
28 |
--- /dev/null |
29 |
+++ b/dev-vcs/git-flow/files/git-flow-1.12.3_scriptdir.patch |
30 |
@@ -0,0 +1,72 @@ |
31 |
+Keeps the auxiliary, non-executable script files out of /usr/bin, and |
32 |
+avoids calling uname every time git-flow runs. |
33 |
+ |
34 |
+--- a/git-flow |
35 |
++++ b/git-flow |
36 |
+@@ -41,41 +41,9 @@ |
37 |
+ set -x |
38 |
+ fi |
39 |
+ |
40 |
+-# Setup the GITFLOW_DIR for different operating systems. |
41 |
+-# This is mostly to make sure that we get the correct directory when the |
42 |
+-# git-flow file is a symbolic link |
43 |
+-case $(uname -s) in |
44 |
+-Linux) |
45 |
+- export GITFLOW_DIR=$(dirname "$(readlink -e "$0")") |
46 |
+- ;; |
47 |
+-FreeBSD|OpenBSD|NetBSD) |
48 |
+- export FLAGS_GETOPT_CMD='/usr/local/bin/getopt' |
49 |
+- export GITFLOW_DIR=$(dirname "$(realpath "$0")") |
50 |
+- ;; |
51 |
+-Darwin) |
52 |
+- PRG="$0" |
53 |
+- while [ -h "$PRG" ]; do |
54 |
+- link=$(readlink "$PRG") |
55 |
+- if expr "$link" : '/.*' > /dev/null; then |
56 |
+- PRG="$link" |
57 |
+- else |
58 |
+- PRG="$(dirname "$PRG")/$link" |
59 |
+- fi |
60 |
+- done |
61 |
+- export GITFLOW_DIR=$(dirname "$PRG") |
62 |
+- ;; |
63 |
+-*MINGW*) |
64 |
+- export GITFLOW_DIR=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") |
65 |
+- pwd () { |
66 |
+- builtin pwd -W |
67 |
+- } |
68 |
+- ;; |
69 |
+-*) |
70 |
+- # The sed expression here replaces all backslashes by forward slashes. |
71 |
+- # This helps our Windows users, while not bothering our Unix users.) |
72 |
+- export GITFLOW_DIR=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") |
73 |
+- ;; |
74 |
+-esac |
75 |
++# Setup GITFLOW_DIR |
76 |
++GITFLOW_DIR="@PREFIX@/libexec/git-flow" |
77 |
++export GITFLOW_DIR |
78 |
+ |
79 |
+ # Extra environment settings |
80 |
+ if [ -f ~/.gitflow_export ]; then |
81 |
+--- a/Makefile |
82 |
++++ b/Makefile |
83 |
+@@ -30,6 +30,7 @@ |
84 |
+ |
85 |
+ datarootdir=$(prefix)/share |
86 |
+ docdir=$(datarootdir)/doc/gitflow |
87 |
++scriptdir=$(prefix)/libexec/git-flow |
88 |
+ # files that need mode 755 |
89 |
+ EXEC_FILES=git-flow |
90 |
+ |
91 |
+@@ -55,9 +56,10 @@ |
92 |
+ |
93 |
+ install: |
94 |
+ install -d -m 0755 $(prefix)/bin |
95 |
++ install -d -m 0755 $(scriptdir) |
96 |
+ install -d -m 0755 $(docdir)/hooks |
97 |
+ install -m 0755 $(EXEC_FILES) $(prefix)/bin |
98 |
+- install -m 0644 $(SCRIPT_FILES) $(prefix)/bin |
99 |
++ install -m 0644 $(SCRIPT_FILES) $(scriptdir) |
100 |
+ install -m 0644 $(HOOK_FILES) $(docdir)/hooks |
101 |
+ |
102 |
+ uninstall: |
103 |
|
104 |
diff --git a/dev-vcs/git-flow/git-flow-1.12.3-r1.ebuild b/dev-vcs/git-flow/git-flow-1.12.3-r1.ebuild |
105 |
new file mode 100644 |
106 |
index 00000000000..7bd223ff451 |
107 |
--- /dev/null |
108 |
+++ b/dev-vcs/git-flow/git-flow-1.12.3-r1.ebuild |
109 |
@@ -0,0 +1,46 @@ |
110 |
+# Copyright 1999-2021 Gentoo Authors |
111 |
+# Distributed under the terms of the GNU General Public License v2 |
112 |
+ |
113 |
+EAPI=7 |
114 |
+ |
115 |
+inherit bash-completion-r1 |
116 |
+ |
117 |
+MY_PN="${PN/-/}-avh" |
118 |
+COMP_PN="${PN}-completion" |
119 |
+COMP_PV="0.6.0" |
120 |
+COMP_P="${COMP_PN}-${COMP_PV}" |
121 |
+ |
122 |
+DESCRIPTION="Git extensions to provide high-level repository operations" |
123 |
+HOMEPAGE="https://github.com/petervanderdoes/gitflow-avh" |
124 |
+SRC_URI="https://github.com/petervanderdoes/${MY_PN}/archive/${PV}.tar.gz -> ${P}.tar.gz |
125 |
+ https://github.com/petervanderdoes/${COMP_PN}/archive/${COMP_PV}.tar.gz -> ${COMP_P}.tar.gz" |
126 |
+ |
127 |
+LICENSE="BSD MIT" |
128 |
+SLOT="0" |
129 |
+KEYWORDS="~amd64 ~x86" |
130 |
+ |
131 |
+RDEPEND="dev-vcs/git" |
132 |
+ |
133 |
+PATCHES=( |
134 |
+ "${FILESDIR}"/${PN}-1.12.3_scriptdir.patch |
135 |
+) |
136 |
+ |
137 |
+DOCS=( AUTHORS CHANGELOG.md README.md ) |
138 |
+ |
139 |
+S="${WORKDIR}"/${MY_PN}-${PV} |
140 |
+ |
141 |
+src_prepare() { |
142 |
+ default |
143 |
+ sed -i "s!doc/gitflow!doc/${PF}!" Makefile || die "Fixing doc path failed" |
144 |
+ sed -i "s!@PREFIX@!${EPREFIX}!" git-flow || die "Failed to set prefix in the script" |
145 |
+} |
146 |
+ |
147 |
+src_compile() { |
148 |
+ true |
149 |
+} |
150 |
+ |
151 |
+src_install() { |
152 |
+ emake prefix="${ED}"/usr install |
153 |
+ einstalldocs |
154 |
+ newbashcomp "${WORKDIR}"/${COMP_P}/${COMP_PN}.bash ${PN} |
155 |
+} |