The tool looks for a file called "pakdef.txt" at the top level directory for the package, where it should be run from. This file contains information about which files should be included or not in the final package.
pakdef.txt contains one directive per line. A line can also be a comment line starting with '#' or a completely empty line. These lines will of course be ignored. There are two kinds of directives for now: filters and shell command directives.
The program normally tries to add all files and directories it finds under the package directory into the tarball. The filters provide a way to exclude some of the files from the tarball. For each directory/file, the negative filters are applied first. If the file entry passes thru all negative filters, then it's added to the tarball. Otherwise, the program looks at all positive filters. If one of the positive filters match the file entry, it's added to the tarball. If the file entry goes thru all positive filters, then it's not added. Here is an example:
-sfx .d +sfx .o.dThe first rule would eliminate all files ending with ".d". The second rule would add those back which end in ".o.d". For example, "libfoo.d" would be eliminated but "bar.o.d" would be added to the tarball.
Here is a list of the filters:
name X Name of the file or directory is X. foo/X and bar/misc/X would both match. dir X Everything under directory X would match, excluding the directory X itself. sfx X Name of the file ends with X. foo/machineX would match. pfx X Name of the file starts with X. foo/Xmachine would match, but not Xfoo/parity.c. file X The file at path X would match only. magic X A file with magic bytes corresponding to magic type X would match. Current magic types are elf, pdf and postscript.
<run echo this is a pre-archival command <run ls -l >run echo this is post-archivalNote that any escape encoding in command lines is ignored and fed directly to the shell. However, all whitespace characters are converted to spaces and multiple spaces are converted to single spaces.
The tool can also process symbolic links, but it doesn't follow them. It doesn't process any other weird file type such as sockets, pipes or device nodes.
1.0: Initial version. You need the libarchive library from here. Just run "make" and put the resulting binary "mkpak" somewhere in your $PATH.