Korona wrote:
Okay, but why does the example contain a configure call and a GitHub URL (which presumably contains the sources, not the binaries)? How are these build instructions connected to the binary package?
Those are just examples to one possible configuration.
Korona wrote:
From a binary package manager, I'd expect a tool that takes a DESTDIR and converts it into a package (like dpkg-deb or xbps-create). But it seems that the mechanism is different here, hence I am confused.
Yes, one thing how syspkg is different to all the other package managers is that it doesn't have DESTDIR, instead it has 8 variables, one for each kind. BINDIR for binaries, LIBDIR for libraries, INCDIR for include files, SRCDIR for source files, etc. It's a bit more complicated to set up at first, granted, but has huge advantage on the long run.
As for creation, it doesn't necessarily take a directory as an argument, it could be a github "Download ZIP" url too. But if it's a directory, then you must specify multiple "DESTDIR"s, one for each architecture, for example:
Code:
syspkg build mypackage.json x86_64=./buildIntel/ aarch64=./buildARM/
That is, if you choose binary distribution. With source packages you specify a directory with the source as "DESTDIR", and add postinst hooks in the json instead:
Code:
syspkg build mypackage.json any=./srcdir/
cat mypackage.json | grep "postinst"
"postinst":
When the user installs such a package, SRCDIR will be used as the one you call DESTDIR.
Korona wrote:
EDIT: also, why does configure run in a postinst step? Doesn't postinst run on the user's machine, not the maintainer's one?
It totally up to you. There are two approaches:
1. you compile the application
in this case you run configure and make on your machine, the payload contains pre-compiled binaries and there's no need for postinst in the metajson
2. the user compiles the application
in this case the payload contains source files, and the postinst tells how to compile it into binary on the user's computer
Which one you choose is up to you. You can even mix those, for example having a binary payload and postinst not compiling but generating configuration files for it. It's totally your call how you write the metajsons. Syspkg tries to give you maximum freedom on that matter.
Cheers,
bzt