pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/devel/got-portable



Module Name:    pkgsrc
Committed By:   vins
Date:           Mon Jan 15 19:41:19 UTC 2024

Modified Files:
        pkgsrc/devel/got-portable: Makefile PLIST distinfo
Added Files:
        pkgsrc/devel/got-portable: MESSAGE
        pkgsrc/devel/got-portable/files: README.pkgsrc gotd.conf gotd.sh
        pkgsrc/devel/got-portable/patches: patch-gotd_log.h

Log Message:
devel/got-portable: update to 0.95

# pkgsrc changes

* Explicitely enable cvg(1) by default.
* Enable building/installing of gotd(8), the GoT daemon:
  - install gotd, gotsh and gitwrapper, alongside relevant man pages
  - provide sample configuratio.
  - provide a README.pkgsrc with instructions on how to set it up
  - provide rc.d service script for gotd
  - create _gotd user and group, and add gotsh to shells
* Standardise yacc/bison usage to match pkgsrc default.
* Install documentation.
* Fix hard-coded paths.

# Changes (upstream, since 0.93)

* got 0.95; 2023-12-08
  see git repository history for per-change authorship information
  - plug memory leaks in checkout, update, and status commands
  - gotwebd: repair the "chroot" option in /etc/gotwebd.conf; regression
    from 0.94
  - gotwebd: add breadcumbs to navigate paths in tree/blob/commits/blame
    views
  - gotwebd: add a dark mode, enabled based on web-browser preferences
  - gotwebd: add History/Blob/Raw-File links to blob and blame views
  - gotwebd: adjust blob line numbers for text-mode browsers
  - gotwebd: make the blame view work in text-mode browsers
  - gotwebd: add a Patch action to serve diffs in plain text
  - gotwebd: add Patch and Tree links to the diff view
  - gotwebd: display README files in tree views
  - gotwebd: display a tree-listing and README files in the summary view
  - gotwebd: render less tags in the summary page to make space for
    other content
  - gotwebd: swap order of tags and branch listings on the summary page
  - gotwebd: display 'More' link instead of 'prev/next' links in the tag
    listing

* got 0.94; 2023-11-29
  see git repository history for per-change authorship information
  - in diff error message, say what was being diffed
  - gotwebd.css: vertically align briefs age and author
  - honor fetch_all_branches configuration again
  - tog: switch back to patience diff algorithm by default for pretty
    diffs
  - gotwebd: render all the datetimes in a time tag
  - slightly reword 'got merge' documentation to hopefully be more clear
  - make 'tog diff' release the work-tree lock earlier
  - got patch: handle embedded NULs in lines of patch files with binary
    data
  - simplify usage of the 'mesg' histedit script command
  - fix some fd leaks in error paths and avoid some double-close()
  - use ibuf_fd_set() instead of reaching into the ibuf struct
  - gotwebd: remove dead ipproto handling in host() and host_if()
  - allow setting variables in gotd.conf syntax
  - fix gotwebd unveil permissions; gotwebd now runs entirely read-only
  - reduce gotwebd pledges to the minimum currently required
  - gotwebd.conf: drop support for inferring listen addresses via
    interface names
  - gotwebd.conf: use listen * instead of listen "" to listen on any
    address
  - gotwebd: get rid of got_sockaddr.[ch] usage to help -portable
  - allow gotd repo read/write processes to max out data-size resource
    limits
  - gotwebd: replace proc.c with much simpler code
  - gotwebd: don't chdir to / before spawning the child processes
  - remove the quite ineffective gotwebd repository cache to fix
    stability issues
  - fix memory leak on error in got_privsep_recv_painted_commits()
  - gotwebd: fix broken signal catching


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 pkgsrc/devel/got-portable/MESSAGE
cvs rdiff -u -r1.15 -r1.16 pkgsrc/devel/got-portable/Makefile
cvs rdiff -u -r1.2 -r1.3 pkgsrc/devel/got-portable/PLIST
cvs rdiff -u -r1.10 -r1.11 pkgsrc/devel/got-portable/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/devel/got-portable/files/README.pkgsrc \
    pkgsrc/devel/got-portable/files/gotd.conf \
    pkgsrc/devel/got-portable/files/gotd.sh
cvs rdiff -u -r0 -r1.1 pkgsrc/devel/got-portable/patches/patch-gotd_log.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/devel/got-portable/Makefile
diff -u pkgsrc/devel/got-portable/Makefile:1.15 pkgsrc/devel/got-portable/Makefile:1.16
--- pkgsrc/devel/got-portable/Makefile:1.15     Tue Oct 24 22:08:45 2023
+++ pkgsrc/devel/got-portable/Makefile  Mon Jan 15 19:41:19 2024
@@ -1,7 +1,6 @@
-# $NetBSD: Makefile,v 1.15 2023/10/24 22:08:45 wiz Exp $
+# $NetBSD: Makefile,v 1.16 2024/01/15 19:41:19 vins Exp $
 
-DISTNAME=      got-portable-0.93
-PKGREVISION=   1
+DISTNAME=      got-portable-0.95
 CATEGORIES=    devel
 MASTER_SITES=  https://gameoftrees.org/releases/portable/
 
@@ -18,27 +17,72 @@ ONLY_FOR_PLATFORM+= Linux-*-*
 ONLY_FOR_PLATFORM+=    FreeBSD-*-*
 ONLY_FOR_PLATFORM+=    DragonFly-*-*
 
+BUILD_DEFS+=   VARBASE
+
 USE_TOOLS+=    pkg-config yacc
 
-.include "../../mk/bsd.prefs.mk"
+PKG_GROUPS=            _gotd
+PKG_USERS=             _gotd:_gotd
+PKG_GECOS._gotd=       Game of Trees Daemon
+PKG_SHELL._gotd=       /sbin/nologin
+PKG_HOME._gotd=                /nonexistent
+
+GNU_CONFIGURE=         yes
+CONFIGURE_ENV+=                YACC=${YACC:Q}
+CONFIGURE_ENV+=                CFLAGS=${CFLAGS:Q}
+CONFIGURE_ENV+=                LDFLAGS=${LDFLAGS:Q}
+CONFIGURE_ARGS+=       --enable-gotd
+CONFIGURE_ARGS+=       --enable-cvg
+CONFIGURE_ARGS+=       --with-gotd-empty-path=${VARBASE}/empty
+CONFIGURE_ARGS+=       --with-gitwrapper-git-libexec-path=${PREFIX}/libexec/git-core
 
-.if ${OPSYS} == "Linux" || ${OPSYS} == "Darwin"
-USE_TOOLS+=    bison
-.endif
+EGDIR=         ${PREFIX}/share/examples/got
+CONF_FILES+=   ${EGDIR}/gotd.conf ${PKG_SYSCONFDIR}/gotd.conf
 
-GNU_CONFIGURE= yes
+DOCDIR=                ${PREFIX}/share/doc/got
+PKG_DOCS=      CHANGELOG README README.pkgsrc README.portable TODO
+
+MAKE_DIRS+=    ${VARBASE}/empty ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 0700
 
 INSTALLATION_DIRS=     bin libexec
 INSTALLATION_DIRS+=    ${PKGMANDIR}/man1 ${PKGMANDIR}/man5
+INSTALLATION_DIRS+=    share/doc/got share/examples/got
+
+RCD_SCRIPTS=   gotd
+PKG_SHELL=     bin/gotsh
+
+TEST_TARGET=   tests
+
+SUBST_CLASSES+=                pkgsrc
+SUBST_STAGE.pkgsrc=    pre-configure
+SUBST_FILES.pkgsrc=    README.pkgsrc
+SUBST_VARS.pkgsrc=     PKG_SYSCONFDIR PREFIX VARBASE
+SUBST_MESSAGE.pkgsrc=  Replacing pkgsrc placeholders.
+
+SUBST_CLASSES+=                conf
+SUBST_STAGE.conf=      pre-configure
+SUBST_MESSAGE.conf=    Fix configuration file path.
+SUBST_FILES.conf+=     gitwrapper/gitwrapper.1 gotd/gotd.conf.5        \
+                       gotd/gotd.h gotd/gotd.8
+SUBST_SED.conf+=       -e "s:/etc/gotd.conf:${PKG_SYSCONFDIR}/gotd.conf:g"
+
+MESSAGE_SUBST+=                DOCDIR=${DOCDIR:Q}
+
+.include "../../mk/bsd.prefs.mk"
+
+post-extract:
+       ${RUN}cp ${FILESDIR}/README.pkgsrc ${WRKSRC}
 
 .if ${OPSYS} == "Linux"
 post-patch:
 # let libmd include the correct header.
        ${RM} -f ${WRKSRC}/compat/sha2.h
-# compatibility macros and functions for Linux.
-.  include "../../devel/libbsd/buildlink3.mk"
 .endif
 
+post-install:
+       ${INSTALL_DATA} ${FILESDIR}/gotd.conf ${DESTDIR}${EGDIR}
+       ${INSTALL_DATA} ${PKG_DOCS:S|^|${WRKSRC}/|} ${DESTDIR}${DOCDIR}
+
 # need libcrypto.so.1.1
 BUILDLINK_API_DEPENDS.openssl+=   openssl>=1.1.1d
 .include "../../security/openssl/buildlink3.mk"
@@ -46,6 +90,11 @@ BUILDLINK_API_DEPENDS.openssl+=   openss
 # required for set_panel_userptr(3) and waddwstr(3).
 .include "../../devel/ncursesw/buildlink3.mk"
 
+# compatibility macros and functions for Linux.
+.if ${OPSYS} == "Linux"
+.  include "../../devel/libbsd/buildlink3.mk"
+.endif
+
 .include "../../devel/libevent/buildlink3.mk"
 .include "../../devel/libuuid/buildlink3.mk"
 .include "../../devel/zlib/buildlink3.mk"

Index: pkgsrc/devel/got-portable/PLIST
diff -u pkgsrc/devel/got-portable/PLIST:1.2 pkgsrc/devel/got-portable/PLIST:1.3
--- pkgsrc/devel/got-portable/PLIST:1.2 Sat Sep  2 15:48:12 2023
+++ pkgsrc/devel/got-portable/PLIST     Mon Jan 15 19:41:19 2024
@@ -1,6 +1,9 @@
-@comment $NetBSD: PLIST,v 1.2 2023/09/02 15:48:12 vins Exp $
+@comment $NetBSD: PLIST,v 1.3 2024/01/15 19:41:19 vins Exp $
+bin/gitwrapper
 bin/got
 bin/gotadmin
+bin/gotctl
+bin/gotsh
 bin/tog
 libexec/got-fetch-pack
 libexec/got-index-pack
@@ -15,13 +18,25 @@ libexec/got-read-tag
 libexec/got-read-tree
 libexec/got-send-pack
 man/man1/cvg.1
+man/man1/gitwrapper.1
 man/man1/got.1
 man/man1/gotadmin.1
+man/man1/gotsh.1
 man/man1/tog.1
 man/man5/git-repository.5
 man/man5/got-worktree.5
 man/man5/got.conf.5
+man/man5/gotd.conf.5
 man/man5/gotwebd.conf.5
+man/man8/gotctl.8
+man/man8/gotd.8
 man/man8/gotwebd.8
 sbin/cvg
+sbin/gotd
 sbin/gotwebd
+share/doc/got/CHANGELOG
+share/doc/got/README
+share/doc/got/README.pkgsrc
+share/doc/got/README.portable
+share/doc/got/TODO
+share/examples/got/gotd.conf

Index: pkgsrc/devel/got-portable/distinfo
diff -u pkgsrc/devel/got-portable/distinfo:1.10 pkgsrc/devel/got-portable/distinfo:1.11
--- pkgsrc/devel/got-portable/distinfo:1.10     Wed Sep 20 21:25:02 2023
+++ pkgsrc/devel/got-portable/distinfo  Mon Jan 15 19:41:19 2024
@@ -1,6 +1,7 @@
-$NetBSD: distinfo,v 1.10 2023/09/20 21:25:02 vins Exp $
+$NetBSD: distinfo,v 1.11 2024/01/15 19:41:19 vins Exp $
 
-BLAKE2s (got-portable-0.93.tar.gz) = 85b1991acb96e13a13bbd3ccd2b161bd5a7e3b49f89b000c7796e9086af996b1
-SHA512 (got-portable-0.93.tar.gz) = 3d611463d652f64ed2943a3d4f85b42789714221b640a54d7cfb0ec88e4dc820d74fbadc66b0ace953d03fd40b25e8296599195e14b34e5b860264f36a831bc0
-Size (got-portable-0.93.tar.gz) = 1267233 bytes
+BLAKE2s (got-portable-0.95.tar.gz) = 0207d87899366b18310ef711c9e0c89fb1190363be6976b105891a2cb0ee51cf
+SHA512 (got-portable-0.95.tar.gz) = d07efc24bbf3228a888fa3731672d0196411cba7f2efff654d30e2bbe4dca2518fc0892cfbf8e8a438872d1a1dece8a1df2569127cd0204042b859b54d5e4ce5
+Size (got-portable-0.95.tar.gz) = 1271793 bytes
 SHA1 (patch-compat_sha2.h) = 56c722110049bbbc6ccbbf0418717d2430788459
+SHA1 (patch-gotd_log.h) = eb0890789c1fe7a490ea01d02e48fd71cddc2891

Added files:

Index: pkgsrc/devel/got-portable/MESSAGE
diff -u /dev/null pkgsrc/devel/got-portable/MESSAGE:1.1
--- /dev/null   Mon Jan 15 19:41:19 2024
+++ pkgsrc/devel/got-portable/MESSAGE   Mon Jan 15 19:41:19 2024
@@ -0,0 +1,9 @@
+===========================================================================
+$NetBSD: MESSAGE,v 1.1 2024/01/15 19:41:19 vins Exp $
+
+A sample configuration file for the GoT daemon has been installed inside
+${PKG_SYSCONFDIR}.
+
+Check the README.pkgsrc available at ${DOCDIR}.
+
+===========================================================================

Index: pkgsrc/devel/got-portable/files/README.pkgsrc
diff -u /dev/null pkgsrc/devel/got-portable/files/README.pkgsrc:1.1
--- /dev/null   Mon Jan 15 19:41:19 2024
+++ pkgsrc/devel/got-portable/files/README.pkgsrc       Mon Jan 15 19:41:19 2024
@@ -0,0 +1,121 @@
++----------------------------------------------------------------------
+| Getting started with Game of Trees on pkgsrc
++----------------------------------------------------------------------
+
+To use the Game of Trees daemon to host git repositoties, a few
+manual setup steps are required.
+
+| NOTE: this tutorial was originally written for Debian by Tobias
+| Heider (@tobhe), to whom all credit goes. This is a modified
+| version adjusted for pkgsrc/NetBSD, with minor additions.
+
+Below is an example for setting up read only anonymous access to a
+clone of the upstream got repository.
+
+First we need to check out the got source code on our host machine.
+
+    ----------------------------------------------------------------
+    # Create git directory
+    $ mkdir -p @VARBASE@/git
+    $ cd @VARBASE@/git
+
+    # Clone repository you are planning to serve with got
+    $ got clone ssh://anonymous%got.gameoftrees.org@localhost/got.git
+
+    # Alternatively you can use git
+    $ git clone --bare ssh://anonymous%got.gameoftrees.org@localhost/got.git
+
+    # Make sure the gotd user can access the directory
+    $ chown -R _gotd:_gotd @VARBASE@/git
+    ----------------------------------------------------------------
+
+For our example we need to create an anonymous ssh login user and
+group with an empty password to allow everyone read only access.
+For a more restricted setup it is also possible to create a developer
+group and users with pre-shared ssh keys.
+
+    ----------------------------------------------------------------
+    # Add anonymous user for ssh login
+    $ groupadd anonymous
+    $ useradd -g anonymous -c "Anonymous GoT server login" \
+      -d /nonexistent -s @PREFIX@/bin/gotsh anonymous
+    ----------------------------------------------------------------
+
+It is strongly recommended to harden the anonymous user's sshd config to
+make sure they can only run their gotsh shell.  In our case password
+authentication and empty passwords need to be allowed explicitly.
+
+    /etc/ssh/sshd_config:
+    ================================================================
+    Match User anonymous
+       DisableForwarding yes
+       PermitTTY no
+       PasswordAuthentication yes
+       PermitEmptyPasswords yes
+    ================================================================
+
+Now, modify @PKG_SYSCONFDIR@/gotd.conf to point the daemon to our git
+repository and allow read-only access for the anonymous user:
+
+    @PKG_SYSCONFDIR@/gotd.conf:
+    ================================================================
+    # Run as the default user
+    user _gotd
+
+    # ssh://anonymous%example.com@localhost/got
+    repository "got" {
+            path "@VARBASE@/git/got.git"
+            permit ro anonymous
+    }
+    ================================================================
+
+See the gotd.conf(5) man page to learn more about gotd configuration. 
+
+gotd requires the `git-receive-pack' and `git-upload-pack' commands to
+invoke gotsh. However any git distribution provides these commands as
+symbolic links to the git binary. To prevent conflicting names, GoT
+comes with the gitwrapper(1) utility, which acts similarly to
+mailwrapper(8) for MTAs, invoking the correct git server (git or got
+daemon) for the right repository.
+
+For this to work, the aforementioned commands need to be symlinked to
+gitwrapper under @PREFIX@/bin: 
+
+    ---------------------------------------------------------------
+    $ cd @PREFIX@/bin
+    $ ln -sf gitwrapper git-upload-pack
+    $ ln -sf gitwrapper git-receive-pack
+    ---------------------------------------------------------------
+
+In such way, any Git repository listed in @PKG_SYSCONFDIR/gotd.conf
+will be automatically served by gotd, while any Git repository not
+listed in @PKG_SYSCONFDIR/gotd.conf shall be automatically served by
+regular Git's git-upload-pack and git-receive-pack. The client's login
+shell or $PATH no longer matter, and a peaceful co-existence of gotd and
+Git is possible.
+
+To run the GoT server, import the sample rc.d service script provided
+with this package and and activate the gotd service:
+
+| NOTE: this assumes an underlying BSD system using rc services
+
+    ----------------------------------------------------------------
+    $ cp @PREFIX@/share/examples/rc.d/gotd /etc/rc.d
+    $ echo gotd=YES >> /etc/rc.conf
+    ----------------------------------------------------------------
+
+Finally, reload the sshd configuration and start the gotd service:
+
+    ----------------------------------------------------------------
+    $ service sshd restart
+    $ service gotd start 
+    ----------------------------------------------------------------
+
+It should now be possible to clone the git repository with:
+
+    ----------------------------------------------------------------
+    $ got clone ssh://anonymous%example.com@localhost/got
+    ----------------------------------------------------------------
+
+You can find more information on how to configure gotsh and gotd in
+their respective man pages gotsh(1), gotd(8), and got.conf(5).
Index: pkgsrc/devel/got-portable/files/gotd.conf
diff -u /dev/null pkgsrc/devel/got-portable/files/gotd.conf:1.1
--- /dev/null   Mon Jan 15 19:41:19 2024
+++ pkgsrc/devel/got-portable/files/gotd.conf   Mon Jan 15 19:41:19 2024
@@ -0,0 +1,39 @@
+# Run as the default user
+#user _gotd
+
+# Listen on the default socket
+#listen on "/var/run/gotd.sock"
+
+# This repository can be accessed via ssh://user%example.com@localhost/src
+#repository "src" {
+#        path "/var/git/src.git"
+#        permit rw flan_hacker
+#        permit rw :developers
+#        permit ro anonymous
+#
+#        protect branch "main"
+#        protect tag namespace "refs/tags/"
+#}
+
+# This repository can be accessed via
+# ssh://user%example.com@localhost/openbsd/ports
+#repository "openbsd/ports" {
+#        path "/var/git/ports.git"
+#        permit rw :porters
+#        permit ro anonymous
+#        deny flan_hacker
+#
+#        protect {
+#                branch "main"
+#                tag namespace "refs/tags/"
+#        }
+#}
+
+# Use a larger request timeout value:
+#connection request timeout 2h
+
+# Some users are granted a higher concurrent connection limit:
+#connection {
+#        limit user flan_hacker 16
+#        limit user anonymous 32
+#}
Index: pkgsrc/devel/got-portable/files/gotd.sh
diff -u /dev/null pkgsrc/devel/got-portable/files/gotd.sh:1.1
--- /dev/null   Mon Jan 15 19:41:19 2024
+++ pkgsrc/devel/got-portable/files/gotd.sh     Mon Jan 15 19:41:19 2024
@@ -0,0 +1,40 @@
+#!/bin/sh
+#
+# $NetBSD: gotd.sh,v 1.1 2024/01/15 19:41:19 vins Exp $
+#
+
+# PROVIDE: gotd
+# REQUIRE: DAEMON
+# KEYWORD: shutdown
+
+$_rc_subr_loaded . @SYSCONFBASE@/rc.subr
+
+name="gotd"
+rcvar=$name
+
+: ${gotd_config:="@PKG_SYSCONFDIR@/${name}.conf"}
+: ${gotd_server:="@PREFIX@/sbin/${name}"}
+: ${gotd_flags:=""}
+
+command="${gotd_server}"
+command_args="-f ${gotd_config} -v"
+required_files="${gotd_config}"
+pidfile="@VARBASE@/run/${name}.pid"
+
+start_precmd="gotd_precmd"
+check_cmd="gotd_check"
+extra_commands="check"
+
+gotd_check()
+{
+       echo "Performing sanity check on gotd configuration:"
+       eval ${command} ${command_args} ${gotd_flags} -n
+}
+
+gotd_precmd()
+{
+       gotd_check
+}
+
+load_rc_config $name
+run_rc_command "$1"

Index: pkgsrc/devel/got-portable/patches/patch-gotd_log.h
diff -u /dev/null pkgsrc/devel/got-portable/patches/patch-gotd_log.h:1.1
--- /dev/null   Mon Jan 15 19:41:19 2024
+++ pkgsrc/devel/got-portable/patches/patch-gotd_log.h  Mon Jan 15 19:41:19 2024
@@ -0,0 +1,14 @@
+$NetBSD: patch-gotd_log.h,v 1.1 2024/01/15 19:41:19 vins Exp $
+
+Provide a declaration of va_list
+
+--- gotd/log.h.orig    2024-01-14 16:07:41.039068602 +0000
++++ gotd/log.h
+@@ -14,6 +14,7 @@
+  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+  */
+ 
++#include <stdarg.h>
+ #include "got_compat.h"
+ 
+ void  log_init(int, int);



Home | Main Index | Thread Index | Old Index