Project

General

Profile

Packaging Request #3124

[gmnisrv][gmid]: gemini server for PCR

CBotulinum - over 2 years ago - . Updated over 1 year ago.

Status:
fixed
Priority:
wish
Assignee:
% Done:

0%


Description

As it stands today, Parabola carries two gemini clients in the repos (amfora and lagrange). But, there is no gemini server software.

I've checked upstream Arch Linux - they too don't carry any of the server software in the official repos. Yet, in the AUR, both gmnisrv and gmid caught my attention. Both are written in C, latter licensed under the ISC license and the former under GPLv3. I would like to inquire on the possibility of packaging at least one of them in Parabola.

gmnisrv:
AUR: https://aur.archlinux.org/packages/gmnisrv-git/
Cgit: https://git.sr.ht/~sircmpwn/gmnisrv

gmid-git:
AUR: https://aur.archlinux.org/packages/gmid-git/
Cgit: https://gmid.omarpolo.com/

History

#1

Updated by bill-auger over 2 years ago

  • Priority changed from bug to wish
  • Assignee set to bill-auger

CBotulinum has sent some PKGBUILDs for 'gmnisrv' and 'gmid' to the mailing list https://lists.parabola.nu/pipermail/dev/2021-December/

i audited 'gmnisrv' and pushed a package to [pcr-testing] for review, but IMHO, it is not properly licensed - CBotulinum has since asked the author to add some license notice; but the author is convinced that the mere presence of a GPL file in the code-base is sufficient, even with no indication of which files are intended to be covered by the GPL - AFAIK, that is not sufficient, and so the program has no license; and so we should consider others

from the mailing list (WRT 'gmnisrv'):

i am not impressed with the licensing of this code-base - i see
no indication of the license, other than a GPL file itself -
unlike a permissive license, it is not sufficient to simply drop
a GPL file into a codebase - it must explicitly associated with
some files, somehow - so strictly, i beleive that it is not
licensed at all; because the author reserves the claim that it
was not intended to apply to all portions of the code; because
no part of the codebase states any exceptions to standard
copyright - it just so happens to include a GPL file, for
reasons unknown by any receiver - though it is a petty detail
(the author very likely intended to license it GPL3), parabola
probably should not accept the code-base, as it is

even a vague "all files of the foo project are licensed GPL3 or
later" in the README would be something to base permissiom on;
but usually license headers are added to each source-code file -
if i were to maintain this package, i would ask the upstream to
clarify the licensing somehow - i might even add the license
headers to each source-code file, if the upstream agreed to
accept those changes

otherwise, it is a sensibly small code-base (compiles in
seconds); so it would probably be a relatively easy package to
maintain

#2

Updated by bill-auger over 2 years ago

  • Description updated (diff)
#3

Updated by CBotulinum over 2 years ago

Carrying on from discussions on the mailing list and IRC, I have sent in patches for a PKGBUILD for gmid (not the git package, regular one) from the AUR after I modified the PKGBUILD to remove files without a license/copyright (contrib and webiste directory - not needed by the program at all).
As noted on the mailing list, the patches were submitted after verifying compilation with libremakepkg and running the software to test basic functionality (the compilation stage also includes a comprehensive test suite, which passed all tests).

The only "downside" compared to gmnisrv is that the codebase is larger - but it is better documented and the extra features are useful to most users probably.

Since I might have caused some confusion by using different nicks: "wael" on IRC, "Wael Karram" on the mailing list and cbotulinum here are all the same person.

#4

Updated by GNUtoo about 2 years ago

CBotulinum has since asked the author to add some license notice; but the author is convinced that the mere presence of a GPL file in the code-base is sufficient, [...]

Do we have any public statement of that? If so that might constitute the clarification that we need.

#5

Updated by wael about 2 years ago

I have sent the author of the software another email asking for permission to post the reply he had given me (by email) earlier.
Once I get his OK I'll post it here.

#6

Updated by wael about 2 years ago

The author of gemnisrv didn't accept to deal with the licensing issue whatsoever.
I've checked gmid again, it is using the ISC license and has proper license headers in all the project's files except the contrib section (which we can just not package in the first place as it isn't part of the core software).
I'll be working on a PKGBUILD for it, and uploading it shortly.

#7

Updated by wael about 2 years ago

  • File gmid.conf added

Seeing as gmnisrv seems to be a dead end, I have managed to package gmid.
I've attached the PKGBUILD and complementary files.
It is licensed under the ISC license, which while libremakepkg gave me a warning for, the FSF lists it as a "Free and GPL-Compatible License": https://directory.fsf.org/wiki/License:ISC

I've also copied the project's README as a man file, and I've written a systemd unit file.

#8

Updated by wael about 2 years ago

  • File gmid.conf added

I've attached the service and doc files.

#9

Updated by wael about 2 years ago

  • File PKGBUILD added

PKGBUILD

#10

Updated by wael about 2 years ago

  • File gmid.service added

I seem to have a problem with attaching the files, just noticed on last missing file.

#11

Updated by bill-auger about 2 years ago

licenses are recognized by name, only if they match one of the
directory names under /usr/share/licenses/common/ - those
licenses do not need to be installed in the package - any other
license must be prefixed with 'custom:' and the license file
must be installed into a directory named /usr/share/licenses/${pkgname}/

license=(custom:ISC)

#12

Updated by wael about 2 years ago

  • File PKGBUILD added

Added PKGBUILD with fixed license declaration.

#13

Updated by bill-auger about 2 years ago

VG - hope you dont mind the nit-picking - i noticed a few other things that need attention - this ended up quite lengthy - i will split them into the next 3 comments

#14

Updated by bill-auger about 2 years ago

WRT "upstream" PKGBUILDs

if the PKGBUILD was derived from another, from another arch-like distro (eg: archlinux{,arm,32}, artix, hyperbola, or the AUR), and they are mostly identical (they usually are), it is courteous to keep the attributions in tact - but it is most helpful to indicate to the reader or future maintainer, where to find the original, so to compare/merge the changes, past and future - if the PKGBUILD is well-maintained upstream, and if the software is sufficiently libre; the parabola maintainer may need to do nothing more than to merge new changes from the AUR, for the next version N+1 - it also help parabola users to do the same, in case the parabola maintainer has been slacking

if the AUR PKGBUILD has:

Maintainer: fred <>

change it to:

Maintainer (aur): fred <>

and retain all "Contributor:" lines

#15

Updated by bill-auger about 2 years ago

WRT pkgrel:

pkgrel=1.parabola${PARABOLA_RELEASE_COUNT}

put the number by hand - "PARABOLA_RELEASE_COUNT" is a hack - as it is, anyone who runs makepkg on it, will get a blank there

but ... the important thing to remember about pkgrel, is that we only change it for package which exist in arch proper (the pacage would be in one of libre, nonsystemd, or nonprism) - the appended pkgrel segment is semantic - it indicates that the package exists in arch; but that the parabola package over-rides/replaces it for some reason - the appended pkgrel segment indicates that reason

for [libre] packages:

pkgrel+=.parabolaN

for [nonsystemd] packages:

pkgrel+=.nonsystemdN

for [nonprism] packages:

pkgrel+=.nonprismN

also, try to keep the diff as clean as possible - for example, if the upstream PKGBUILD has

pkgrel=1

dont change that line - but add a line just below it like:

pkgrel=1
pkgrel+=.parabola1

even if there is a blacklisted dependency, i usually leave it in tact for the sake of the diff - for example:

depends=(bar foo blacklisted)

i do not change that line, instead i add a new line below it:

depends=( ${depends[*]/blacklisted/} )

#16

Updated by bill-auger about 2 years ago

WRT un-licensed files

unfortunately, this one is more hairy

because of the "unlicensed files" in the upstream sources, the "# Remove unlicensed files." code should be in a mksource() function - the reason is that those files will be present in the *.src..tar.xz source package - in most cases, there is no effect of deleting them during build()

in order for the source package to be fully libre, any un-licensed files must be removed before the source package is generated - the source package is generated before prepare() runs; so the the mksource() mechanism was invented to accomplish this task - there is a proposal to eliminate mksource() and have the source package generated after prepare(); but changes in build() would never be reflected in the source package - for now mksource() is the only semi-automated way to accomplish it - unfortunately, it's use was never documented

mksource packages are a bit trickier to build; and the mechanism is broken in current libretools - the patch is simple though - it will be working again in the next libretools

TODO: add these instructions to the wiki (section 6.1)
https://wiki.parabola.nu/Package_maintainer_guide#mksource.28.29_and_intermediate_source-balls

to create a mksource PKGBUILD, or to convert an existing PKGBUILD to support mksource:

  • put whatever would normally be in source=() in mksource=()
  • put whatever would normally be in <ALGO>sums=() in mk<ALGO>sums=()
  • add a new source=() containing the URL to the (yet non-existent) intermediate source-ball, of the form:
    https://repo.parabola.nu/other/${pkgname}-libre/${pkgname}-libre-${pkgver}.tar.xz{,.sig}
  • add a new <ALGO>sums=() containing: (0 SKIP)
  • add, or move out of prepare(), any code that applies libre-treatments, into a new mksource() function
  • run libremakepkg normally
libremakepkg, upon detecting a mksource PKGBUILD, will then:
  • run the mksource() function
  • generate the intermediate source-ball
  • replace the '0' checksum with the appropriate one for the newly generated source-ball
  • prompt the user to sign the source-ball

if the user elects to sign the libre source-ball, libremakepkg will restart itself, and build the package normally - otherwise, the build will halt - the user must sign the source package, and run libremakepkg again - initially, it is probably most convenient to make the PKGBUILD work without mksource first - after converting it to mksource, it should "just work" - it would not be necessary to actually generate the libre source-ball, nor to sign it - future revisions would need the signature, or to prepare the libre source-ball manually, and delete the .sig from the source array temporarily

librerelease will upload the libre source-ball to it's expected location, along with the package, so the PKGBUILD will work normally for anyone else later, without running mksource(), even with the standard makepkg

#17

Updated by wael about 2 years ago

  • File PKGBUILD added

I tried to implement the recommendations where applicable.
As for the dependencies, it seems that either the AUR package isn't properly tested or that Arch's base has more packages than Parabola's, as such I've still had to manually set it.
I've hardened the original systemd service given from the original author (https://codeberg.org/op/gmid/src/branch/master/contrib/gmid.service).
I've also tried to do the mksource thing, but I seem to be missing something and now the package is refusing to compile, moreover I would like to point that the build() and package() stages are quite different from the AUR package since the whole dealing with contrib/ part is just omitted now (it now is a matter of make install + installing docs, license and the systemd service.

#18

Updated by wael about 2 years ago

  • File PKGBUILD added

I've tried to add the sysusers file too, but I still cannot figure out how to do that for OpenRC and how to get the service files for that too.

#19

Updated by wael about 2 years ago

  • File gmid.initd added

And here is the OpenRC initd file, I hope I didn't screw it up.

#20

Updated by wael about 2 years ago

  • File PKGBUILD added

I think now it should work, just that the files need to be uploaded first.

#21

Updated by bill-auger about 2 years ago

the intermediate source-ball does not need to be on the server -
none of the source do - all PKGBUILDs can be packaged offline -
if all files listed in the source=() array are present in the
working directory (alongside the PKGBUILD), then no network
connection is needed

libremakepkg relies on that - networking is not available to
libremakepkg inside the librechroot - all sources must exist
locally, then copied into the chroot before libremakepkg enters
the chroot

#22

Updated by wael about 2 years ago

  • File gmid.conf added

I got it to work by manually cleaning up the archive beforehand.
Ugly hack, but otherwise I couldn't get it to compile with mksource, because there would never be an intermediate source package.

#23

Updated by wael about 2 years ago

  • File gmid_package_build.tar.gz added

Here is an attached archive with all the files

#24

Updated by bill-auger about 2 years ago

  • Status changed from open to in progress
  • Subject changed from [packaging request] gemini server to [gmnisrv][gmid]: gemini server for PCR
#25

Updated by bill-auger about 2 years ago

i merged this PKGBUILD with the one from AUR - most of the changes are superficial, to minimize the diffs (such as changing double-quote to single-quotes)

WRT the service files:

the files gmid.conf and gmid.sysusers are redundant - they are identical, and get installed into the same directory, and serve the same purpose - only one is needed

you used the GMID_USER in the openrc init script; but that is not defined anywhere - the syncthing example also had a file under /etc/conf.d/ which defines that var - np, i added the conf file

however i noticed one thing of concern - both the systemd and openrc service files start the server with `-c /etc/gmid.conf` - is that file installed by the package ? - or, do you know what that file is expected to be? - could it be a symlink to something under /usr/lib ? - does the user need to add it manually ?
TODO: (i have not built the package yet - i will erase this question if i find the answer)

WRT depends:

the one significant difference is the depends array - why did you change the 'libbsd' dependency to 'libevent'? - those appear to be very different software - without using the program, and without knowing how it presumably uses 'libbsd' or 'libevent', its difficult to know if either are actually required

AUR PKGBUILD:

depends=('libretls' 'libbsd')

this PKGBUILD:
depends=('libretls' 'libevent')

WRT mksource:

this is just a note - the commented line was correct - even though you created the source-ball manually, it still would have worked -

the file gets downloaded only if it does not already exist in the working directory - if the file exists in the working directory, both lines are equivalent - normally, the file will not exist until after mksource has completed at least once - initially, mksource needs to know where to get the upstream source-ball; so that github URL must be in the PKGBUILD

mksource=(
    #"https://github.com/omar-polo/${pkgname}/releases/download/${pkgver}/${pkgname}-${pkgver}.tar.gz" 
    "gmid-1.8.3.tar.gz" 
#26

Updated by wael about 2 years ago

  • File PKGBUILD added

Fixed the issue with the dependencies and the config file (missing and duplicate).
The package now ships a dummy config file that the user has to edit.
Only thing that might need changing is that I am listed as a contributor, but I would like to maintain all the packages that I have submitted if possible.

#27

Updated by bill-auger about 2 years ago

  • File deleted (gmid.conf)
#28

Updated by bill-auger about 2 years ago

  • File deleted (gmid.conf)
#29

Updated by bill-auger about 2 years ago

  • File deleted (PKGBUILD)
#30

Updated by bill-auger about 2 years ago

  • File deleted (gmid.service)
#31

Updated by bill-auger about 2 years ago

  • File deleted (PKGBUILD)
#32

Updated by bill-auger about 2 years ago

  • File deleted (PKGBUILD)
#33

Updated by bill-auger about 2 years ago

  • File deleted (PKGBUILD)
#34

Updated by bill-auger about 2 years ago

  • File deleted (gmid.initd)
#35

Updated by bill-auger about 2 years ago

  • File deleted (PKGBUILD)
#36

Updated by bill-auger about 2 years ago

  • File deleted (gmid.conf)
#37

Updated by bill-auger about 2 years ago

  • File deleted (gmid_package_build.tar.gz)
#38

Updated by bill-auger about 2 years ago

  • File deleted (PKGBUILD)
#39

Updated by bill-auger about 2 years ago

  • Status changed from in progress to fixed

excellent, i was hoping that you would - i also fixed up the "Gemini" wiki page

Also available in: Atom PDF