For the most part it's like building software from source the old-school way, roughly:
configure --prefix=/usr/local make make DESTDIR=/tmp/package install-strip # or is it DESTDIR=/tmp/package make install-strip # jiggle things around so the files are clean and sane: chmod as needed to remove setgid bit make separate dirs as needed, if your software should be split into multiple components (eg. executable + library/headers) mksquashfs /tmp/package package.tcz -all-root -noappend
Some software is more tedious because they're made for other build systems. So you need to install that first before you can build.
Worked example with Jose
I'm not sure why I have two install phases shown in my old notes...
tc@primer:~/jose/build$ sudo meson install --no-rebuild Installing lib/libjose.so.0.0.0 to /usr/local/lib Installing cmd/jose to /usr/local/bin Installing /home/tc/jose/build/jose/jose.h to /usr/local/include/jose Installing /home/tc/jose/jose/cfg.h to /usr/local/include/jose Installing /home/tc/jose/jose/io.h to /usr/local/include/jose Installing /home/tc/jose/jose/b64.h to /usr/local/include/jose Installing /home/tc/jose/jose/jwk.h to /usr/local/include/jose Installing /home/tc/jose/jose/jws.h to /usr/local/include/jose Installing /home/tc/jose/jose/jwe.h to /usr/local/include/jose Installing /home/tc/jose/jose/openssl.h to /usr/local/include/jose Installing /home/tc/jose/doc/ronn/jose.1 to /usr/local/share/man/man1 Installing /home/tc/jose/doc/ronn/jose-alg.1 to /usr/local/share/man/man1 Installing /home/tc/jose/doc/ronn/jose-fmt.1 to /usr/local/share/man/man1 Installing /home/tc/jose/doc/ronn/jose-b64-dec.1 to /usr/local/share/man/man1 Installing /home/tc/jose/doc/ronn/jose-b64-enc.1 to /usr/local/share/man/man1 Installing /home/tc/jose/doc/ronn/jose-jwe-dec.1 to /usr/local/share/man/man1 Installing /home/tc/jose/doc/ronn/jose-jwe-enc.1 to /usr/local/share/man/man1 Installing /home/tc/jose/doc/ronn/jose-jwe-fmt.1 to /usr/local/share/man/man1 Installing /home/tc/jose/doc/ronn/jose-jwk-exc.1 to /usr/local/share/man/man1 Installing /home/tc/jose/doc/ronn/jose-jwk-gen.1 to /usr/local/share/man/man1 Installing /home/tc/jose/doc/ronn/jose-jwk-pub.1 to /usr/local/share/man/man1 Installing /home/tc/jose/doc/ronn/jose-jwk-thp.1 to /usr/local/share/man/man1 Installing /home/tc/jose/doc/ronn/jose-jwk-use.1 to /usr/local/share/man/man1 Installing /home/tc/jose/doc/ronn/jose-jws-fmt.1 to /usr/local/share/man/man1 Installing /home/tc/jose/doc/ronn/jose-jws-sig.1 to /usr/local/share/man/man1 Installing /home/tc/jose/doc/ronn/jose-jws-ver.1 to /usr/local/share/man/man1 Installing /home/tc/jose/doc/doxygen/man/man3/jose_b64.3 to /usr/local/share/man/man3 Installing /home/tc/jose/doc/doxygen/man/man3/jose_jwk.3 to /usr/local/share/man/man3 Installing /home/tc/jose/doc/doxygen/man/man3/jose_jws.3 to /usr/local/share/man/man3 Installing /home/tc/jose/doc/doxygen/man/man3/jose_cfg.3 to /usr/local/share/man/man3 Installing /home/tc/jose/doc/doxygen/man/man3/jose_jwe.3 to /usr/local/share/man/man3 Installing /home/tc/jose/doc/doxygen/man/man3/jose_io_t.3 to /usr/local/share/man/man3 Installing /home/tc/jose/doc/doxygen/man/man3/jose_io.3 to /usr/local/share/man/man3 Installing /home/tc/jose/build/meson-private/jose.pc to /usr/local/lib/pkgconfig DESTDIR=/home/tc/BUILDROOT/jose ninja install
Now some sanitisation of the outputs:
# current working directory is probably ~/BUILDROOT/jose/ rm -rf usr/local/share/ chmod -R g-s ~/BUILDROOT/jose/ find . | xargs file | grep "executable" | grep ELF | grep "not stripped" | cut -f1 -d':' | xargs strip --strip-unneeded find . | xargs file | grep "shared object" | grep ELF | grep "not stripped" | cut -f1 -d':' | xargs strip -g # Now check that usr/local/lib/pkgconfig/jose.pc looks vanilla and sane.
Make the archive and checksum:
mksquashfs jose jose.tcz md5sum jose.tcz > jose.tcz.md5.txt
Generate the file listing, you might need to select the subtree manually like in this case where I only captured usr/:
cd jose/ find usr -not -type d > jose.tcz.list
libjansson is a dependency for jose that we built earlier, so make note of that
echo jansson.tcz > jose.tcz.dep
Write a .info file that describes the package, crib from existing files where possible.
Wrangle the deps some more so that it can get jose => jansson => libcrypto from jansson-dev.
Another example with more scripting and automation
Ideally we'd like to set a couple variables and then run a fixed set of commands that don't require much thinking. This is pretty close to that.
NAME=http-parser mkdir -p /home/tc/BUILDROOT/$NAME DESTDIR=/home/tc/BUILDROOT/$NAME make install-strip cd ~/BUILDROOT/ chmod -R g-s $NAME find $NAME/usr/local/include -type f -execdir chmod -x {} \; mksquashfs $NAME $NAME.tcz md5sum $NAME.tcz > $NAME.tcz.md5.txt
Then the other steps as mentioned above.