Blame


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