Blob


1 README.portable
2 ===============
4 This is the portable version of got[1] (Game of Trees), using autotools to
5 provide the library checks required for GoT's dependencies.
7 The following operating systems are supported:
9 * FreeBSD
10 * NetBSD
11 * DragonFlyBSD
12 * MacOS
13 * Linux
15 DEPENDENCIES
16 ============
18 Linux:
20 * `libncurses` (for tog(1))
21 * `libbsd` (BSD's arc4random routines)
22 * `libmd` (SHA256 routines)
23 * `libuuid` (for UUID generation)
24 * `libz` (for Z compression)
25 * `pkg-config` (for searching libraries)
26 * `bison` (for configuration file grammar)
27 * `libevent` (for gotwebd)
29 FreeBSD:
31 * `automake`
32 * `pkgconf`
33 * `libevent` (for gotwebd)
35 NetBSD:
37 * `automake`
38 * `libuuid`
39 * `ncuresesw`
40 * `libevent` (for gotwebd)
42 DragonFlyBSD:
44 * `automake`
45 * `pkgconf`
46 * `openssl`
47 * `libevent` (for gotwebd)
49 Darwin (MacOS):
51 * `automake`
52 * `bison`
53 * `pkg-config`
54 * `ncurses`
55 * `openssl`
56 * `ossp-uuid`
57 * `libevent` (for gotwebd)
59 TESTS (REGRESS)
60 ===============
62 To run the test suite:
64 ```
65 $ make tests
66 ```
68 Dependencies
69 ============
71 * ed
73 NOTE: THIS ONLY WORKS AFTER `make install` DUE TO HOW PATHS TO LIBEXEC
74 HELPERS ARE HARD-CODED INTO THE BINARIES.
76 INSTALLATION
77 ============
79 ```
80 $ ./autogen.sh
81 $ ./configure && make
82 $ sudo make install
83 ```
85 INSTALLING AND PACKAGING GITWRAPPER
86 ===================================
88 The gotd server has an optional companion tool called gitwrapper.
90 A gotd server can be used without gitwrapper in the following cases:
92 1) The Git client's user account has gotsh configured as its login shell.
94 2) The Git client's user account sees gotsh installed under the names
95 git-receive-pack and git-upload-pack, and these appear in $PATH before
96 the corresponding Git binaries if Git is also installed. Setting up the
97 user's $PATH in this way can require the use of SetEnv in sshd_config.
99 The above cases can be too restrictive. For example, users who have regular
100 shell access to the system may expect to be able to serve Git repositories
101 from their home directories while also accessing repositories served by gotd.
103 Once gitwrapper has been installed correctly it provides an out-of-the box
104 experience where both gotd and Git "just work".
105 However, this will require coordination with the system's Git installation
106 and/or distribution package because the names of two specific Git programs
107 will be overlapping: git-upload-pack and git-receive-pack
109 If the gitwrapper tool will be used then it must replace git-receive-pack
110 and git-upload-pack in /usr/bin. This is usually achieved by replacing the
111 regular Git binaries in /usr/bin with symlinks to gitwrapper:
113 ```
114 -rwxr-xr-x 1 root root 1019928 Aug 24 00:16 /usr/bin/gitwrapper
115 lrwxrwxrwx 1 root root 10 Aug 20 12:40 /usr/bin/git-receive-pack -> gitwrapper
116 lrwxrwxrwx 1 root root 10 Aug 20 12:40 /usr/bin/git-upload-pack -> gitwrapper
117 ```
119 The Git binaries remain available in Git's libexec directory, which is set
120 when Git gets compiled. On Debian it defaults to /usr/lib/git-core.
121 This same path must be given to Got's configure script at build time to
122 allow gitwrapper to find Git's binaries:
124 ```
125 ./configure --with-gitwrapper-git-libexec-path=/usr/lib/git-core
126 ```
128 Once gitwrapper is found in /usr/bin under the names git-receive-pack and
129 git-upload-pack, any Git repositories listed in /etc/gotd.conf will be
130 automatically served by gotd, and any Git repositories not listed in
131 /etc/gotd.conf will be automatically served by regular Git's git-upload-pack
132 and git-receive-pack. The client's login shell or $PATH no longer matter,
133 and a peaceful co-existence of gotd and Git is possible.
135 We recommend that distribution packagers take appropriate steps to package
136 gitwrapper as a required dependency of gotd. It is also possible to install
137 gitwrapper without installing gotd. As long as /etc/gotd.conf does not exist
138 or no repositories are listed in /etc/gotd.conf there will be no visible
139 change in run-time behaviour for Git users since gitwrapper will simply run
140 the standard Git tools.
141 In the OpenBSD ports tree both the regular git package and the gotd package
142 are depending on gitwrapper, and the git package no longer installs the
143 git-receive-pack and git-upload-pack programs in /usr/local/bin.
145 BRANCHES + SUBMITTING PATCHES
146 =============================
148 `got-portable` has two key branches:
150 * `main` which tracks got upstream untainted.
151 * `portable` which provides the portable version of GoT based from code on `main`
153 Patches for portable code fixes should be based from the `portable` branch and
154 sent to the mailing list for review [2] or sent to me directly (see CONTACT).
156 Portable-specific patches should have a shortlog in the form of:
158 ```
159 portable: AREA: description
160 ```
162 Where `AREA` relates to the change in question (for example, `regress`,
163 `libexec`, etc). In some cases, this can be omitted if it's a generic change.
165 This helps to delineate `-portable` changes from upstream `got`.
167 The read-only Github repository also runs CI checks using Cirrus-CI on Linux
168 and FreeBSD.
170 SYNCING UPSTREAM CHANGES WITH PORTABLE
171 ======================================
173 The `-portable` GoT repository uses the following workflow:
175 ```
176 Github (gh) GoT (upstream)
177 ^ ^
178 | |
179 | |
180 | |
181 | |
182 +--------> GoT-portable <------+
184 ```
186 Here, `got-portable` is a clone of the `-portable` repository, locally on
187 disk. There are two remotes set up within that repository, via `git-remote`:
189 * `upstream` -- which points to the official GoT repository;
190 * `gh` -- which points to the mirrored `-portable` repository so that CI can
191 be run for cross-platform/test purposes [3]
192 * `origin` -- our cloned copy from `-portable`
194 Within the `-portable` repository are two key branches (there may be other
195 topic branches which represent on-going work):
197 * `main` -- this is the branch that tracks (without modification) those
198 changes from `upstream`. This branch is continually reset to
199 `upstream/main` whenever changes occur.
201 * `portable` -- this is the *default* branch of the `-portable` repository which
202 contains portable-specific changes to make `GoT` compile across different
203 OSes.
205 When updating `-portable` from upstream changes, the following actions happen:
207 1. Changes from `upstream` are fetched. If there are no new changes, there's
208 nothing else to do.
209 2. Changes from `gh` are fetch so that the result can be pushed out to `gh`.
210 3. The difference between the local copy of `main` and `origin/main` is used
211 to represent the set of commits which have *NOT* yet been merged to
212 `-portable`.
213 4. A topic-branch called `syncup` is created from the HEAD of the `portable`
214 branch to hold the to-be-cherry-picked commits from step 3.
215 5. These commits are then cherry-picked to the `syncup` branch.
216 6. If there's any conflicts, they must be resolved.
217 7. Once done, a sanity build is done in-situ to check there's nothing amiss.
218 8. If that succeeds, the `syncup` branch is merged to `portable` and pushed to
219 `gh` for verification against CI.
220 9. If that fails, fixes continue and pushed up to `gh` as required.
221 10. Once happy, both the `main` and `portable` branches can be merged to `origin`.
223 These steps are encapsulated in a script within `-portable`. [Link](../maintscripts/sync-upstream.sh)
225 RELEASING A NEW VERSION
226 =======================
228 Release for `-portable` try and align as close to upstream GoT as much as
229 possible, even on the same day where that can happen. That being said,
230 sometimes a release of `-portable` might happen outside of that cadence, where
231 a `-portable`-specific issue needs addressing, for example.
233 Before creating a new release, check the version of GoT as found in
234 `util/got-portable-ver.sh` -- as `GOT_PORTABLE_VER`:
236 ```
237 GOT_PORTABLE_VER=0.75
239 ```
241 Here, the *to be released* version of `got-portable` will be `0.75`.
242 Typically, this version is incremented directly after a release, such that
243 there's no need to change this value. The only exception would be if there
244 were an out-of-band release to `-portable`. In such cases, that would take
245 the form:
247 ```
248 0.75.1
249 ```
251 Where the suffix of `1`, `2`, etc., can be used to denote any sub-releases
252 from the `0.75` version.
254 The variable `GOT_RELEASE` needs be changed to `yes` so that the
255 GOT_PORTABLE_VER is asserted correctly.
257 Once the version is verified, the following should be run from the `portable`
258 branch -- and the repository should not have any outstanding modifications to
259 the source:
261 ```
262 make clean ; ./autogen && ./configure && make distcheck
263 ```
265 If this succeeds, the tarball is in the CWD, as: `got-portable-VERSION.tar.gz`
267 This can then be copied to the `got-www` repository and uploaded, along with
268 changing a couple of HTML pages therein to represent the new released version.
269 Additionally, the CHANGELOG file can be copied to the `got-www` and committed.
271 Once all of that has been done, the repository should be tagged to indicate
272 the release, hence:
274 ```
275 git tag -a 0.75
276 ```
278 This can then be pushed out to `gh` and `origin`.
280 After that point, the version of `GOT_PORTABLE_VER` in
281 `util/got-portable-ver.sh` should be changed to the next version, and
282 `GOT_RELEASE` should be setg back to `no`.
284 TODO
285 ====
287 * configure.ac should start defining AC_ENABLE arguments to allow for
288 finer-grained control of where to search for includes/libraries, etc.
289 * review the compat/ code. Some of those functions are probably picked up in
290 libbsd, so we should drop such implementations from compat/ where there's
291 overlap between libbsd and what's natively available.
293 CONTACT
294 =======
296 Thomas Adam <thomas@xteddy.org><br />
297 thomas_adam (#gameoftrees on irc.libera.chat)
299 [1] https://gameoftrees.org<br />
300 [2] https://lists.openbsd.org/cgi-bin/mj_wwwusr?user=&passw=&func=lists-long-full&extra=gameoftrees
301 [3] https://github.com/ThomasAdam/got-portable