PackageSystem
The Kwort package system
Kwort package system is very simple, just tar packages containing the binaries compressed with lzma (xz in the future). If your package needs the execution of extra commands after being decompressed, the /install/doinst.sh script is excecuted.
This page explains the usage of kpkg and makepkg. The first one is used to manage your packages (install, remove, upgrade packages, etc...), while the second one is used to create packages.
kpkg
kpkg is Kwort's package tool to manage packages (.lzma or .tgz). It can install packages from our mirrors or any one you choose. It has several options, including the basics, installing and removing, and more advanced features.
Usage: kpkg <options> [PACKAGE[S]|FILE ...]
OPTIONS
update:
This option brings the Kwort Linux database from the chosen mirror, to select another one see the variables section down here.
Example:
kpkg update
install PACKAGE1 [PACKAGE2 ...]:
This option allows you to install a package from a local place or from the chosen mirrors.
Examples:
kpkg install openofficekpkg install wbar openofficekpkg install /home/user/openoffice-2.0-i486-1.tar.lzmakpkg install /var/packages/xapps/xfmedia-0.9.1-i486-1.tar.lzma /home/user/openoffice-2.0-i486-1.tgz
remove PACKAGE1 [PACKAGE2 ...]
Use this option to remove installed packages.
Examples:
kpkg remove openofficekpkg remove xfmedia openoffice
ATTENTION: This option does not remove packages installed from source. Only packages installed with kpkg.
download PACKAGE1 [PACKAGE2 ...]
With this version you download packages from the mirror but don't install them. The downloaded packages go to /var/packages/serie/application.
Examples:
kpkg download openofficekpkg download xfmedia openoffice
search PACKAGE1 [PACKAGE2 ...]
This option only search a package in the database, it doesn't install or remove any package. It doesn't modify the database at all. If you want to know all packages in the database, you can use "/all" as package name.
Examples:
kpkg search enkpkg search xfmediakpkg search /all
provides FILE
This option allows you to know which package installed by kpkg is providing a given file.
Examples:
kpkg provides ls
upgrade
This option upgrades the whole system or a given serie. Useful to upgrade the whole desktop for example.
Examples:
kpkg upgradekpkg upgrade xapps
ENVIRONMENT
MIRROR, MIRROR_PATH
Use these variables to set another mirror than the default (ftp://europa.fapyd.unr.edu.ar) and a special path in that mirror.
Example:
export MIRROR="http://kienhoefer.com"export MIRROR_PATH="kwort/2.4/base/packages"kpkg update && kpkg install bluez-libs
REINSTALL
If a package is installed already, you can force kpkg to re-install the package. This variable allows only booleans (yes or no).
Examples:
REINSTALL=yes kpkg install audaciousREINSTALL=Yes kpkg install openoffice xfmedia
REDOWNLOAD
This variable works in the same way as REINSTALL but of course, for downloads. Accept only booleans.
Examples:
REDOWNLOAD=yes kpkg download openoffice
ROOT
This option is used to set a path to an installation. Leave it empty to install in the root (/). Accepted value is a full absolute directory name.
Examples:
ROOT=/home/nomius kpkg install openoffice
KPKG_DB_HOME
This option is used to set a path where the database is. You can work with this with several database using them completely separated. Leave it empty to use the default database path (/var/packages). Accepted value is a full absolute directory name.
Examples:
KPKG_DB_HOME=/home/nomius kpkg install openoffice
STANDALONE
In Kwort, every package installed from local system is considered "a third party package", this means that it wasn't downloaded from a registered mirror. Use this variable to override this behavior. If you set STANDALONE to "no" a good idea might be to indicate to which serie the new package belongs, this is done with the SERIE variable. Be sure that the package has a valid format name (name-version-arch-build.ext). If STANDALONE was given but SERIE wasn't, package gets installed in "noserie" serie.
Examples:
export STANDALONE=noexport SERIE=networkingkpkg install /home/nomius/ettercap-0.1-i486-1.tar.lzma# This package gets installed under serie networkingexport STANDALONE=nokpkg install /home/nomius/snort-0.5-i486-2.tgz# This package gets installed under serie noserie
SERIE
If you are installing a package from local path and STANDALONE=no was given, you should set SERIE to the desired serie in which the package should be installed.
Examples:
export STANDALONE=noexport SERIE=networkingkpkg install /home/nomius/ettercap-0.1-i486-1.tar.lzma# This package gets installed under serie networking
CSV
Using the search command willl produce a human readable form list of installed packages, setting this variable to "yes" will make it look like a csv list. This option is useful for front-ends where the output of kpkg must be piped to another program.
Examples:
CSV=yes kpkg install search /all
KNOWN BUGS
Upgrading a single package is not supported yet. Instead please use kpkg remove PACKAGE && kpkg install PACKAGE
Packaging with makepkg
The next documentation was taken from the Slackware documentation and slighted modified to apply to Kwort
makepkg was borrowed from Slackware. It is used to create Kwort specific packages. In order to create a package, you will need to have the binary files for the package you want to create. Obviously this means you will need to either have the binary files already available in your system, or you will have to build the binary files from the source files. Here are the steps you need to follow to create a package:
- create a directory tree
- copy all the files related to the package into the appropriate directories in the directory tree.
- run makepkg to create the package.
I would advice you to create a directory where you will keep your packages. For instance, something like /pkg. This is where you will create your directory tree. /pkg will simple contain the location on where the files in the package you are creating will be installed. For instance, foo-1.0-i686-1.tar.lzma will install the binary file foo in /usr/local/bin and a configuration file foorc in /usr/local/etc. Therefore, /pkg will contain the following directories:
- /pkg/usr/local/bin
- /pkg/usr/local/etc
The next step is to copy all the files to the directory tree. So in this case, there are only two files to foo-1.0-i686-1.tar.lzma, and they are foo and foorc. We then copy the files to where they will be installed, in this case, /usr/local/bin and /usr/local/etc respectively. When that is done with, we do the following:
cd /pkgmakepkg foo-1.0-i686-1
This will create a package called foo-1.0-i686-1.tar.lzma which contains the files foo and foorc which will be installed in /usr/local/bin and /usr/local/etc respectively.
As you can probably see, you will need to hunt around for the files and then to copy them to the created directory tree. An easier way to do this would be to build the package from source, and then have the built binaries installed into the directory tree. For instance, we have downloaded a source package called foo-1.0.tar.gz. We have already created a directory /pkg it is currently empty. The first thing to do is to unpack the source file and then to build the source:
tar xvzf foo-1.0.tar.gzcd foo-1.0./configure --prefix=/usrmakemake DESTDIR=/pkg installcd /pkgmakepkg --zip-man --strip --linkadd y foo-1.0-i686-1
The line ./configure --prefix=/usr will build the package in order to get configured for the real system in usr.
The line make DESTDIR=/pkg install will cause make install to install all packages into /pkg while at the same time, building the directory tree for you.
So when you are done, just go to /pkg and run makepkg from within it, and it will automatically build the package for you. If the source package doesn't use autotools, then you will have to build and find out where the files will be installed in. Fortunately, most major source packages will require you to make use of the ./configure stage.
When you run makepkg two things will happen. First it will check to see if there are any symbolic links in the package you are creating. If there are, makepkg will recommend that a script be made and that all symbolic links are deleted. Do it if you want to. Secondly, it will as you if you want to change the permissions of the files to 755 and changing all ownerships to root. Unless some of the files need to retain special permissions for whatever reasons, go ahead and say yes to this question. Once you have finished all of these steps, your Kwort package is ready. Options like --linkadd and --chown will do that automatically for you, but it's a good idea to automate the first one leaving the second one to us unless you know what you're doing.
In our case, we used also options --zip-man and --strip; those options are very handy, since --zip-man will gzip the manpages for us, and --strip will remove debug and unneeded symbols in binaries, shared objects and static libraries, reducing the package size significantly, no only in the package itself but also once it is installed.
