Blob


1 README.portable
2 ===============
3
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.
6
7 The following operating systems are supported:
8
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 * jot
72 * ed
74 NOTE: For Linux, you must have the jot(1) command which is typically in the
75 `athena-jot` package, or similar.
77 NOTE: THIS ONLY WORKS AFTER `make install` DUE TO HOW PATHS TO LIBEXEC
78 HELPERS ARE HARD-CODED INTO THE BINARIES.
80 INSTALLATION
81 ============
83 ```
84 $ ./autogen.sh
85 $ ./configure && make
86 $ sudo make install
87 ```
89 INSTALLING AND PACKAGING GITWRAPPER
90 ===================================
92 The gotd server has an optional companion tool called gitwrapper.
94 A gotd server can be used without gitwrapper in the following cases:
96 1) The Git client's user account has gotsh configured as its login shell.
98 2) The Git client's user account sees gotsh installed under the names
99 git-receive-pack and git-upload-pack, and these appear in $PATH before
100 the corresponding Git binaries if Git is also installed. Setting up the
101 user's $PATH in this way can require the use of SetEnv in sshd_config.
103 The above cases can be too restrictive. For example, users who have regular
104 shell access to the system may expect to be able to serve Git repositories
105 from their home directories while also accessing repositories served by gotd.
107 Once gitwrapper has been installed correctly it provides an out-of-the box
108 experience where both gotd and Git "just work".
109 However, this will require coordination with the system's Git installation
110 and/or distribution package because the names of two specific Git programs
111 will be overlapping: git-upload-pack and git-receive-pack
113 If the gitwrapper tool will be used then it must replace git-receive-pack
114 and git-upload-pack in /usr/bin. This is usually achieved by replacing the
115 regular Git binaries in /usr/bin with symlinks to gitwrapper:
117 ```
118 -rwxr-xr-x 1 root root 1019928 Aug 24 00:16 /usr/bin/gitwrapper
119 lrwxrwxrwx 1 root root 10 Aug 20 12:40 /usr/bin/git-receive-pack -> gitwrapper
120 lrwxrwxrwx 1 root root 10 Aug 20 12:40 /usr/bin/git-upload-pack -> gitwrapper
121 ```
123 The Git binaries remain available in Git's libexec directory, which is set
124 when Git gets compiled. On Debian it defaults to /usr/lib/git-core.
125 This same path must be given to Got's configure script at build time to
126 allow gitwrapper to find Git's binaries:
128 ```
129 ./configure --with-gitwrapper-git-libexec-path=/usr/lib/git-core
130 ```
132 Once gitwrapper is found in /usr/bin under the names git-receive-pack and
133 git-upload-pack, any Git repositories listed in /etc/gotd.conf will be
134 automatically served by gotd, and any Git repositories not listed in
135 /etc/gotd.conf will be automatically served by regular Git's git-upload-pack
136 and git-receive-pack. The client's login shell or $PATH no longer matter,
137 and a peaceful co-existence of gotd and Git is possible.
139 We recommend that distribution packagers take appropriate steps to package
140 gitwrapper as a required dependency of gotd. It is also possible to install
141 gitwrapper without installing gotd. As long as /etc/gotd.conf does not exist
142 or no repositories are listed in /etc/gotd.conf there will be no visible
143 change in run-time behaviour for Git users since gitwrapper will simply run
144 the standard Git tools.
145 In the OpenBSD ports tree both the regular git package and the gotd package
146 are depending on gitwrapper, and the git package no longer installs the
147 git-receive-pack and git-upload-pack programs in /usr/local/bin.
149 BRANCHES + SUBMITTING PATCHES
150 =============================
152 `got-portable` has two key branches:
154 * `main` which tracks got upstream untainted.
155 * `portable` which provides the portable version of GoT based from code on `main`
157 Patches for portable code fixes should be based from the `portable` branch and
158 sent to the mailing list for review [2] or sent to me directly (see CONTACT).
160 Portable-specific patches should have a shortlog in the form of:
162 ```
163 portable: AREA: description
164 ```
166 Where `AREA` relates to the change in question (for example, `regress`,
167 `libexec`, etc). In some cases, this can be omitted if it's a generic change.
169 This helps to delineate `-portable` changes from upstream `got`.
171 The read-only Github repository also runs CI checks using Cirrus-CI on Linux
172 and FreeBSD.
174 SYNCING UPSTREAM CHANGES WITH PORTABLE
175 ======================================
177 The `-portable` GoT repository uses the following workflow:
179 ```
180 Github (gh) GoT (upstream)
181 ^ ^
182 | |
183 | |
184 | |
185 | |
186 +--------> GoT-portable <------+
188 ```
190 Here, `got-portable` is a clone of the `-portable` repository, locally on
191 disk. There are two remotes set up within that repository, via `git-remote`:
193 * `upstream` -- which points to the official GoT repository;
194 * `gh` -- which points to the mirrored `-portable` repository so that CI can
195 be run for cross-platform/test purposes [3]
196 * `origin` -- our cloned copy from `-portable`
198 Within the `-portable` repository are two key branches (there may be other
199 topic branches which represent on-going work):
201 * `main` -- this is the branch that tracks (without modification) those
202 changes from `upstream`. This branch is continually reset to
203 `upstream/main` whenever changes occur.
205 * `portable` -- this is the *default* branch of the `-portable` repository which
206 contains portable-specific changes to make `GoT` compile across different
207 OSes.
209 When updating `-portable` from upstream changes, the following actions happen:
211 1. Changes from `upstream` are fetched. If there are no new changes, there's
212 nothing else to do.
213 2. Changes from `gh` are fetch so that the result can be pushed out to `gh`.
214 3. The difference between the local copy of `main` and `origin/main` is used
215 to represent the set of commits which have *NOT* yet been merged to
216 `-portable`.
217 4. A topic-branch called `syncup` is created from the HEAD of the `portable`
218 branch to hold the to-be-cherry-picked commits from step 3.
219 5. These commits are then cherry-picked to the `syncup` branch.
220 6. If there's any conflicts, they must be resolved.
221 7. Once done, a sanity build is done in-situ to check there's nothing amiss.
222 8. If that succeeds, the `syncup` branch is merged to `portable` and pushed to
223 `gh` for verification against CI.
224 9. If that fails, fixes continue and pushed up to `gh` as required.
225 10. Once happy, both the `main` and `portable` branches can be merged to `origin`.
227 These steps are encapsulated in a script within `-portable`. [Link](../maintscripts/sync-upstream.sh)
229 RELEASING A NEW VERSION
230 =======================
232 Release for `-portable` try and align as close to upstream GoT as much as
233 possible, even on the same day where that can happen. That being said,
234 sometimes a release of `-portable` might happen outside of that cadence, where
235 a `-portable`-specific issue needs addressing, for example.
237 Before creating a new release, check the version of GoT as found in
238 `util/got-portable-ver.sh` -- as `GOT_PORTABLE_VER`:
240 ```
241 GOT_PORTABLE_VER=0.75
243 ```
245 Here, the *to be released* version of `got-portable` will be `0.75`.
246 Typically, this version is incremented directly after a release, such that
247 there's no need to change this value. The only exception would be if there
248 were an out-of-band release to `-portable`. In such cases, that would take
249 the form:
251 ```
252 0.75.1
253 ```
255 Where the suffix of `1`, `2`, etc., can be used to denote any sub-releases
256 from the `0.75` version.
258 The variable `GOT_RELEASE` needs be changed to `yes` so that the
259 GOT_PORTABLE_VER is asserted correctly.
261 Once the version is verified, the following should be run from the `portable`
262 branch -- and the repository should not have any outstanding modifications to
263 the source:
265 ```
266 make clean ; ./autogen && ./configure && make distcheck
267 ```
269 If this succeeds, the tarball is in the CWD, as: `got-portable-VERSION.tar.gz`
271 This can then be copied to the `got-www` repository and uploaded, along with
272 changing a couple of HTML pages therein to represent the new released version.
273 Additionally, the CHANGELOG file can be copied to the `got-www` and committed.
275 Once all of that has been done, the repository should be tagged to indicate
276 the release, hence:
278 ```
279 git tag -a 0.75
280 ```
282 This can then be pushed out to `gh` and `origin`.
284 After that point, the version of `GOT_PORTABLE_VER` in
285 `util/got-portable-ver.sh` should be changed to the next version, and
286 `GOT_RELEASE` should be setg back to `no`.
288 TODO
289 ====
291 * configure.ac should start defining AC_ENABLE arguments to allow for
292 finer-grained control of where to search for includes/libraries, etc.
293 * review the compat/ code. Some of those functions are probably picked up in
294 libbsd, so we should drop such implementations from compat/ where there's
295 overlap between libbsd and what's natively available.
297 CONTACT
298 =======
300 Thomas Adam <thomas@xteddy.org><br />
301 thomas_adam (#gameoftrees on irc.libera.chat)
303 [1] https://gameoftrees.org<br />
304 [2] https://lists.openbsd.org/cgi-bin/mj_wwwusr?user=&passw=&func=lists-long-full&extra=gameoftrees
305 [3] https://github.com/ThomasAdam/got-portable