Thu Jan 9 11:59:53 2020 UTC ()
hub: Generate and install hub-* man pages

Add necessary logic to generate and install hub man pages.

We could use the existent targets provided by Makefile by introducing a gmake
tool dependency and adjusting install.sh but it is probably easier to mimic it
and rarely new commands are added to hub (so possible HUB_COMMANDS sync against
${WRKSRC}/Makefile should hopefully scale).  We can revisit that in the future
if that will not be the case.

PKGREVISION++


(leot)
diff -r1.35 -r1.36 pkgsrc/net/hub/Makefile
diff -r1.1 -r1.2 pkgsrc/net/hub/PLIST

cvs diff -r1.35 -r1.36 pkgsrc/net/hub/Makefile (expand / switch to unified diff)

--- pkgsrc/net/hub/Makefile 2020/01/02 11:52:48 1.35
+++ pkgsrc/net/hub/Makefile 2020/01/09 11:59:53 1.36
@@ -1,42 +1,67 @@ @@ -1,42 +1,67 @@
1# $NetBSD: Makefile,v 1.35 2020/01/02 11:52:48 leot Exp $ 1# $NetBSD: Makefile,v 1.36 2020/01/09 11:59:53 leot Exp $
2 2
3DISTNAME= hub-2.13.0 3DISTNAME= hub-2.13.0
 4PKGREVISION= 1
4CATEGORIES= net 5CATEGORIES= net
5MASTER_SITES= ${MASTER_SITE_GITHUB:=github/} 6MASTER_SITES= ${MASTER_SITE_GITHUB:=github/}
6GITHUB_TAG= v${PKGVERSION_NOREV} 7GITHUB_TAG= v${PKGVERSION_NOREV}
7 8
8MAINTAINER= leot@NetBSD.org 9MAINTAINER= leot@NetBSD.org
9HOMEPAGE= https://hub.github.com/ 10HOMEPAGE= https://hub.github.com/
10COMMENT= Command-line tool that makes git easier to use with GitHub 11COMMENT= Command-line tool that makes git easier to use with GitHub
11LICENSE= mit 12LICENSE= mit
12 13
13GO_DIST_BASE= ${DISTNAME} 14GO_DIST_BASE= ${DISTNAME}
14GO_SRCPATH= github.com/github/hub 15GO_SRCPATH= github.com/github/hub
15 16
16DEPENDS+= git-base>=1.7.3:../../devel/git-base 17DEPENDS+= git-base>=1.7.3:../../devel/git-base
17 18
18SUBST_CLASSES+= man 19SUBST_CLASSES+= man
19SUBST_STAGE.man= pre-configure 20SUBST_STAGE.man= pre-configure
20SUBST_MESSAGE.man= Fix hub name in hub(1) man page 21SUBST_MESSAGE.man= Fix hub name in hub(1) man page
21SUBST_FILES.man= share/man/man1/hub.1.md 22SUBST_FILES.man= share/man/man1/hub.1.md
22SUBST_SED.man+= -e 's/\$$ git/$$ hub/' 23SUBST_SED.man+= -e 's/\$$ git/$$ hub/'
23SUBST_SED.man+= -e '/\$$ GITHUB_HOST=/ s/ git clone / hub clone /' 24SUBST_SED.man+= -e '/\$$ GITHUB_HOST=/ s/ git clone / hub clone /'
24 25
25INSTALLATION_DIRS+= bin ${PKGMANDIR}/man1 26INSTALLATION_DIRS+= bin ${PKGMANDIR}/man1
26 27
27CHECK_RELRO_SKIP+= bin/hub 28CHECK_RELRO_SKIP+= bin/hub
28 29
29# Generate hub(1) man page 30# List of hub commands to generate man pages, HELP_CMD list of ${WRKSRC}/Makefile
 31HUB_COMMANDS= alias \
 32 api \
 33 browse \
 34 ci-status \
 35 compare \
 36 create \
 37 delete \
 38 fork \
 39 gist \
 40 pr \
 41 pull-request \
 42 release \
 43 issue \
 44 sync
 45
 46# Generate hub man pages
30pre-install: 47pre-install:
 48.for hc in ${HUB_COMMANDS}
 49 cd ${WRKDIR} && \
 50 ./bin/hub help ${hc} --plain-text > \
 51 src/github.com/github/hub/share/man/man1/hub-${hc}.1.md
 52.endfor
31 cd ${WRKDIR} && \ 53 cd ${WRKDIR} && \
32 ./bin/md2roff-bin --manual="hub manual" \ 54 ./bin/md2roff-bin --manual="hub manual" \
33 --version=${PKGVERSION_NOREV} \ 55 --version=${PKGVERSION_NOREV} \
34 --template=src/github.com/github/hub/man-template.html \ 56 --template=src/github.com/github/hub/man-template.html \
35 src/github.com/github/hub/share/man/man1/hub.1.md 57 src/github.com/github/hub/share/man/man1/*.md
36 58
37do-install: 59do-install:
38 ${INSTALL_PROGRAM} ${WRKDIR}/bin/hub ${DESTDIR}${PREFIX}/bin 60 ${INSTALL_PROGRAM} ${WRKDIR}/bin/hub ${DESTDIR}${PREFIX}/bin
39 ${INSTALL_MAN} ${WRKSRC}/share/man/man1/hub.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1 61 ${INSTALL_MAN} ${WRKSRC}/share/man/man1/hub.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1
 62.for hc in ${HUB_COMMANDS}
 63 ${INSTALL_MAN} ${WRKSRC}/share/man/man1/hub-${hc}.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1
 64.endfor
40 65
41.include "../../lang/go/go-package.mk" 66.include "../../lang/go/go-package.mk"
42.include "../../mk/bsd.pkg.mk" 67.include "../../mk/bsd.pkg.mk"

cvs diff -r1.1 -r1.2 pkgsrc/net/hub/PLIST (expand / switch to unified diff)

--- pkgsrc/net/hub/PLIST 2018/02/27 17:08:35 1.1
+++ pkgsrc/net/hub/PLIST 2020/01/09 11:59:53 1.2
@@ -1,3 +1,17 @@ @@ -1,3 +1,17 @@
1@comment $NetBSD: PLIST,v 1.1 2018/02/27 17:08:35 leot Exp $ 1@comment $NetBSD: PLIST,v 1.2 2020/01/09 11:59:53 leot Exp $
2bin/hub 2bin/hub
 3man/man1/hub-alias.1
 4man/man1/hub-api.1
 5man/man1/hub-browse.1
 6man/man1/hub-ci-status.1
 7man/man1/hub-compare.1
 8man/man1/hub-create.1
 9man/man1/hub-delete.1
 10man/man1/hub-fork.1
 11man/man1/hub-gist.1
 12man/man1/hub-issue.1
 13man/man1/hub-pr.1
 14man/man1/hub-pull-request.1
 15man/man1/hub-release.1
 16man/man1/hub-sync.1
3man/man1/hub.1 17man/man1/hub.1