Making a package for Fatdog64 consists of 3 (three) steps.
You first need to download the source code that you want to
compile, and read any README or INSTALL text files for
information on how to compile.
Typically it looks like this for autoconf-based build system:
./configure --prefix=/usr --libdir=/usr/lib64 --sysconfdir=/etc --localstatedir=/var make
Or for cmake build system:
mkdir build && cd build cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DLIBDIR=/usr/lib64 makeIn both systems, the usual next step, usually mentioned in a package's README is "
make install
" (or "sudo make
install
") but don't do it yet. Doing this will immediately
install the application to your system, but does not package it in
a format that you can re-use later (e.g. installing it in another
machine).cd /tmp/xxx makepkg -c n -l n /path/to/where/you/want/to/keep/the/package-version-x86_64-num.txzThe filename package-version-x86_64-1.txz is a standard that you need to follow; it comprises of 4 components all separated by the "-" (dash, minus) character.
x86_64
. For FatdogArm, it would be armhf for
hardfloat binaries, armel for softfloat binaries, and
armeb for big-endian ARM systems (rare). For 32-bit
binaries, you have the choice of i386, i486, i586,
i686, or x86 depending which flavour of x86 you
compiled the package for.cd /tmp/xxx mkdir install slackdesc "package" "version" "short summary" "long description" "source URL" | tee install/slack-desc cp /your/prepared/install-script install/doinst.sh cp /your/prepared/un-install-script install/slack-uninstall.sh makepkg -c n -l n /path/to/where/you/want/to/keep/the/package-version-x86_64-num.txz1. Note for slackdesc: "package" must match the package name you used in makepkg, exactly (sans the other 3 components); "version" must match the version you use in makepkg exactly. All other components are optional.
strip --strip-unneeded *before you run makepkg. Afterwards, you can also delete anything else that is not needed (e.g. locale directories if you're going for English-only package, templates, documentations, etc). makepkg does not automatically create DEV or NLS package like dir2pet, it will just make a tarball of the entire contents of the directory it is in.
make install
"
with DESTDIRmake install
", you run
"make install
DESTDIR=/tmp/xxx
".DESTDIR=/tmp/xxx
" to "make install
"
simply tells the build system to install the files with their
correct hierachy to "/tmp/xxx
" location instead of the usual root
"/
" location. Thus, for example, a file that will usually be
installed to "/usr/bin/myprogram"
will instead be installed
to "/tmp/xxx/usr/bin/myprogram"
./tmp/xxx
". make install DESTDIR=/tmp/xxx
" finishes you're ready for
step 3 above.new2dir
new2dir make install
instead
of just "make install
". Once you have run this, two things
will happen: Method 3 - Using paco -lp
and paco2pkg
paco is program to perform installation file capture, just like new2dir. (The website for paco used to be here, but unfortunately when the author of paco deprecated paco in favour of a new program called "porg" that is identical in purpose to paco, he also took down the website. With very minor changes, however, information for porg is also applicable for paco).
To use paco, you run "paco -lp
package-version -- make install" instead of just "make
install".
After paco finishes, the package will be installed as normal
but paco will keep a record of what files have been installed.
The next step is to ensure you have a directory called "/archive/repo" as the output of the package
will be stored there; then you just need to run "paco2pkg package-version" which will create
the "/archive/repo/package-version-x86_64-1paco.txz"
- ready for use.
Using paco has the benefit that it works with even more packages (even for programs where new2dir traditionally fails), and even though you still have to install the program when you try to package it, paco has the ability to uninstall the package that it installed during packaging method (use "paco -r package-version" command). Of course, uninstall this after you create the package, not before.
paco is a very versatile tool. It has a lot more features that
what can be covered here. For example, it can create pacoballs
(using the pacoball command) which is a complete package
on its own; these pacoballs can be installed or
uninstalled on demand. Paco can actually function as a
full-fledged package manager by itself.
Note: Using this method, it isn't obvious how you can add the equivalent of slack-desc and doinst.sh script, as the packaging is done by paco2pkg instead of makepkg; but it can be done. Run "paco2pkg --help" for more details. This method is meant for batch creation of packages; where the doinst.sh and slack-desc files for multiple packages are pre-created in advance.
Method 4 overview - Using Fatdog sandbox
The idea is to build the packages inside Fatdog sandbox, and then install as
usual (with "make install"). All the installed files (new or
modified files) will be kept in the sandbox, after which you can
use "sb2dir.sh" to extract them to the /tmp directory. From
within this extraction directory, you can run "makepkg" as
usual. Obviously you need to remove unneeded files first (the
source tarball, etc).
Method 5 overview - Using the Fatdog native pkgbuild system
Fatdog's pkgbuild system expands on the idea of Fatdog sandbox
above, to download, compile, build and assemble packages, but doing it
automatically. This is called "native" as all Fatdog base
packages are built using this system.
The system is "recipe" driven, you need to give the
pkgbuild system a "recipe" - a set of instructions for how to
build the package. A "recipe" is actually a shell script
containing the commands that you usually use to build a package,
e.g. the "configure" and "make" and "make install"; it also must
include commands for where to download the source tarball.
The Fatdog pkgbuild system is located in /usr/src/pkgbuild (when Fatdog devx is loaded). It comes with samples. Put your own recipe script (named "recipe") in a subfolder you create in the "pkg" directory (e.g. "/usr/src/pkgbuild/pkg/abiword"), then run the build-pkg.sh command, as follows:
cd /usr/src/pkgbuild build-pkg.sh name-of-created-subfolder
E.g."build-pkg.sh abiword".
The finished package will be stored in "output"
directory. "src" directory will contain the downloaded
source tarball.
The "source" directory contains the recipes used to create
installed Fatdog packages.