With this guide I will try to illustrate in brief way but (I hope) exhaustive how it is possible to create some packets ad hoc for Slackware Linux distributions.

1) create a temporary directory whether to be able to work with the binaries, es.: mkdir /work
This dir can be created for practical motives inside the dir of the sources of the program that u want to packets, for es. if we want to packets nmap we will create the dir work in the dir of the sources of nmap.

2) after having created the work's dir, let's position us in the directory of the program to compile and we proceed with the first phase of the usual installation: ./configure--prefix=/usr (with the parameter--prefix we go to plan the run of installation, it is often advisable (to choose / usr).

3) now we have to end to install the program, however we have to do so that the files is positioned in the directory by us previously created, in our es.: / nmap/work - Therefore we perform:

make install prefix=/nmap/work

Usually this operation is enough for the simplest programs, but in the specific case of nmap we need to plan other runs for the correct operation of the program. To know these runs "particular" it will be enough to look in the Makefile that immediately will be created inside the dir of nmap sources after the. /configure.
We open the Makefile with our preferred editor (pico is mine) and then:

pico Makefile
prefix = /usr
exec_prefix = ${prefix}
bindir = ${exec_prefix}/bin
sbindir = ${exec_prefix}/sbin
mandir = ${prefix}/man
srcdir = .
nmapdatadir = ${prefix}/share/nmap
deskdir = $(prefix)/share/gnome/apps/Utilities

on top of the file we will find these Useful Information.. that therefore we will use in the following way:

make install prefix=/nmap/work/usr \
exec_prefix=/nmap/work/usr/bin \
bindir=/nmap/work/usr/bin \
sbindir=/nmap/work/usr/sbin \
mandir=nmap/work/usr/man \
nmapdatadir=/nmap/work/usr/share/nmap \

Doing so everything will be put to the correct place, the main point is to act according to the Makefile.

4) now we are ready to create the packet. tgz, let's position us on /nmap/work and we perform the following command:

makepkg pacchetto-X.XX-i386-1.tgz

in our example:

makepkg nmap-3.26-i386-1.tgz

it is necessary to follow this syntax if it is wanted to use upgradepkg.
The packet is so completed and ready for the use, it can be installed with installpkg, upgradepkg, pkgtool and it can be uninstalled with removepkg or pkgtool. During this phase probably it will be asked us if we want to eliminate the present symbolic links these links will automatically be inserted in a script called "doinst.sh" that will provide to restore them during the installation of the packet.
Let's answer then yes!
Immediately after makepkg it will set us a new question, or if we want to plan the permissions of the files to root, it is advisable to answer yes, but in some cases we could have different demands.

5) besides it is possible to add a description to the packet tgz, all it takes is inserting in the dir /nmap/work/install a text file called
"slack-desc" following the scheme called "handy ruler" to es.:

nmap: nmap (network scanner)
nmap: Nmap ("Network Mapper") is an open source utility for network
nmap: exploration or security auditing. It was designed to rapidly scan
nmap: large networks, although it works fine against single hosts. Nmap
nmap: uses raw IP packets in novel ways to determine what hosts are
nmap: available on the network, what services (ports) they are offering,
nmap: what operating system (and version) they are running, what type of
nmap: packet filters/firewalls are in use, and dozens of other
nmap: characteristics. Nmap runs on most types of computers, and both
nmap: console and graphical versions are available.

The "#" must not be insert.
The characters "|" are set for delimiting the length of the comment, one is positioned on the ":" and the other in correspondence of the last letter of the longest line. You known that the name of the program, in our es. "nmap", has been written 11 times, this allows to give the correct formatting to the text.