makepkg was borrowed from Slackware and rewritten 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:
I would advice you to create a directory where you will package 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#x86_64#1.tar.xz will install the binary file foo in /usr/bin and a configuration file foorc in /usr/etc. Therefore, /pkg will contain the following directories:
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#x86_64#1.tar.xz, and they are foo and foorc. We then copy the files to where they will be installed, in this case, /usr/bin and /usr/etc respectively. When that is done with, we do the following:
cd /pkg makepkg -s -c -z foo#1.0#x86_64#1.tar.xz
This will create a package called foo#1.0#x86_64#1.tar.xz which contains the files foo and foorc which will be installed in /usr/bin and /usr/etc respectively. Also, given the options -s, -c and -z was given, it will strip binaries (in this case
/usr/bin/foo), chown all files to root:root and compress man pages if any.
As you probably noted, 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. If 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. A full sequence of a software source which uses autotools would be:
tar xvzf foo-1.0.tar.gz cd foo-1.0 ./configure --prefix=/usr make make DESTDIR=/pkg install cd /pkg makepkg -s -z -c foo#1.0#x86_64#1.tar.xz
./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 the known
make install to install all files 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
The fact that you did all that doesn't mean that your package is gonna be in the official mirror, as your package must be stable, well tested, etc. But at first sight it will not be rejected because you didn't "follow the book".