A new release of got introduces gitwrapper which makes it much
easier to run gotd side-by-side with regular Git binaries.
Essentially, clients fetching repositories over ssh will be talking to
gotd if the repository is listed in /etc/gotd.conf. Otherwise they
will be talking to regular Git. (Unless the user account has gotsh
set as login shell, which will always talk to gotd.)

For this to work, gitwrapper must replace two specific binaries in
the git package with symlinks to itself. I am trying to make this
work seemlessly during upgrades from got-0.86 and git-2.40.0.

When I install the git package from the ports tree with:
        make install SUDO=doas
this does not install the gitwrapper package from devel/got and the
files end up missing from disk. Can anyone tell what am I doing wrong?
I would hope the RUN_DEPENDS I've added would take care of this?

diff /usr/ports
commit - 6e3c62131849d4c5d8f47e7e4e2d5d95fb0a263f
path + /usr/ports
blob - ddabef359f8634fd9bbf1bb3b9ca610794cad214
file + devel/git/Makefile
--- devel/git/Makefile
+++ devel/git/Makefile
@@ -3,6 +3,7 @@ DISTNAME =      git-${V}
 COMMENT-x11 =  graphical tools
 
 V =            2.40.0
+REVISION =     0
 DISTNAME =     git-${V}
 CATEGORIES =   devel
 
@@ -33,6 +34,8 @@ MULTI_PACKAGES =      -main -svn -x11
                        textproc/asciidoc \
                        textproc/xmlto
 
+RUN_DEPENDS =          devel/got,gitwrapper
+
 MULTI_PACKAGES =       -main -svn -x11
 
 WANTLIB-main =         c crypto curl expat iconv intl pthread ssl z
@@ -137,5 +140,7 @@ post-install:
        perl -pi -e "s|${WRKINST}||g" ${PREFIX}/share/gitweb/gitweb.cgi
        ${INSTALL_DATA} ${WRKBUILD}/gitweb/README ${PREFIX}/share/gitweb
        ${MODTCL_WISH_ADJ} ${PREFIX}/libexec/git/git-gui--askpass
+       rm ${PREFIX}/bin/git-receive-pack       # handled by gitwrapper
+       rm ${PREFIX}/bin/git-upload-pack        # handled by gitwrapper
 
 .include <bsd.port.mk>
blob - ae0a7f1539223a157f78d388e6c358f9f4c8107b
file + devel/git/pkg/PLIST-main
--- devel/git/pkg/PLIST-main
+++ devel/git/pkg/PLIST-main
@@ -5,10 +5,8 @@ bin/git-cvsserver
 @rcscript ${RCDIR}/gitdaemon
 @bin bin/git
 bin/git-cvsserver
-@bin bin/git-receive-pack
 @shell bin/git-shell
 @bin bin/git-upload-archive
-@bin bin/git-upload-pack
 @bin bin/scalar
 @static-lib lib/libgit.a
 ${P5SITE}/Git/
blob - 84f229d487bb8f3fbf6d1b3a1f04693f75daaa3b
file + devel/got/Makefile
--- devel/got/Makefile
+++ devel/got/Makefile
@@ -1,11 +1,13 @@
 COMMENT-main =         game of trees version control system
 COMMENT-server =       game of trees repository server
 COMMENT-webd =         game of trees repository fast-cgi server
+COMMENT-gitwrapper =   invoke an appropriate Git repository server
 
-V =                    0.86
+V =                    0.87
 DISTNAME =             got-${V}
 PKGNAME-server =       gotd-${V}
 PKGNAME-webd =         gotwebd-${V}
+PKGNAME-gitwrapper =   gitwrapper-${V}
 CATEGORIES =           devel
 HOMEPAGE =             https://gameoftrees.org
 MAINTAINER =           Stefan Sperling <s...@openbsd.org>
@@ -13,12 +15,13 @@ MULTI_PACKAGES =    -main -server -webd
 # ISC
 PERMIT_PACKAGE =       Yes
 
-MULTI_PACKAGES =       -main -server -webd
+MULTI_PACKAGES =       -main -server -webd -gitwrapper
 
 # uses pledge()
 WANTLIB-main =         c curses m panel pthread util z
 WANTLIB-server =       c event m util z
 WANTLIB-webd =         c event m util z
+WANTLIB-gitwrapper =   c
 
 MAKE_FLAGS =           CC="${CC}"
 ALL_TARGET =           all server webd
@@ -38,4 +41,8 @@ FAKE_FLAGS =          MANDIR=${PREFIX}/man/man CHROOT_DIR=${VA
 TEST_TARGET =          regress
 FAKE_FLAGS =           MANDIR=${PREFIX}/man/man CHROOT_DIR=${VARBASE}/www
 
+post-install:
+       @ln -s gitwrapper ${PREFIX}/bin/git-upload-pack
+       @ln -s gitwrapper ${PREFIX}/bin/git-receive-pack
+
 .include <bsd.port.mk>
blob - e5e69b24f97535a28a03dea6989f19bd9fdd61f6
file + devel/got/distinfo
--- devel/got/distinfo
+++ devel/got/distinfo
@@ -1,2 +1,2 @@
-SHA256 (got-0.86.tar.gz) = JHOjr8U1bRmZ74/qf/P3PqZJGUYq34cQVCSw+jurh+w=
-SIZE (got-0.86.tar.gz) = 806708
+SHA256 (got-0.87.tar.gz) = dPi14M4RWMh3Yo4NlaQrjhzh/gr8L8AZEbpOpHGXhgU=
+SIZE (got-0.87.tar.gz) = 822791
blob - /dev/null
file + devel/got/pkg/DESCR-gitwrapper (mode 644)
--- /dev/null
+++ devel/got/pkg/DESCR-gitwrapper
@@ -0,0 +1,8 @@
+The gitwrapper program is designed to replace git-upload-pack(1) and
+git-receive-pack(1) and to invoke an appropriate Git server based on
+configuration information placed in gotd.conf(5).  This permits the
+administrator to configure which Git server is to be invoked on the
+system at run-time.  Git repositories which are listed in gotd.conf(5)
+and exist on the filesystem will be served by gotsh(1).  Any other Git
+repositories will be served by git-upload-pack(1) and
+git-receive-pack(1).
blob - /dev/null
file + devel/got/pkg/PLIST-gitwrapper (mode 644)
--- /dev/null
+++ devel/got/pkg/PLIST-gitwrapper
@@ -0,0 +1,5 @@
+@conflict git-<=2.40.0
+bin/git-receive-pack
+bin/git-upload-pack
+@bin bin/gitwrapper
+@man man/man1/gitwrapper.1

Reply via email to