Slackware Templates for Packages
Slackware is great for system management because it allows you to easily modify anything by simply changing a value in a text file.
Slackware is a little less great when you need to install a package for software that has several dependencies 😓. It doesn’t have automatic dependency management by default, so all the work falls on the user who manages the system.
The same applies to package compilation; since it doesn’t manage dependencies, you also have to do everything manually during compilation, compiling the packages in the correct order to get the software you want to install.
SlackRepo
To solve this last problem, there are software programs like sbopkg that allow you to generate compilation queues to compile the packages needed for the software in the correct order.
One step further than sbopkg is slackrepo, software that I have already talked about in my article about managing packages in slackware in 2026, as it also allows you to compile the packages in the correct order with respect to the dependencies of each individual program, but in addition, it installs the already compiled dependencies one by one and then removes them once the compilation of the software that required them is finished.
The most interesting feature of slackrepo, however, is the ability to queue “hooks” to the execution of the program, i.e., to execute code that is not part of slackrepo to extend its functionality. In particular, in my setup, I use several hooks:
- I update the repository via git by performing the rebase each time.
- I generate the HTML files that are then inserted into the repository.
- I generate the .template files for those software programs that have one or more dependencies.
- I upload the files to the repository using rsync.
My packages repository for slackware64-current
my packageshook “git fetch”
This hook takes care of updating the local repository by cloning Ponce’s git (I’m on -current), then it performs the rebase and stops the execution if there are any conflicts, so I know if any of my personal packages conflict with SBo’s. In case of conflicts, I can resolve them by deleting my package or the official one, depending on the situation.
|
|
hook “gen web files”
This hook takes care of launching my script gen_web_hook.sh (visible on my git) to generate the HTML files that will then be uploaded online to the package repository and that are used for viewing the repository online.
|
|
Have a look at my code on my git repo.
my git repositoryhook “template generator”
Here is the function that takes care of generating the .template files used by slackpkg to install the packages.
|
|
hook “rsync push”
Finally, the hook that takes care of uploading the modified files to my online repository:
|
|
The .template files and slackpkg
At the end of the compilation of software that has some dependencies, in my repository, the file <package_name>.template will be generated, which I can copy into /etc/slackpkg/templates and call with:
|
|
and slackpkg will automatically prompt me to install all the dependencies listed in the template, effectively simplifying dependency management.
An example of a template, directly from my repository, is waybar.template:
|
|
I hope this article can be useful to someone, even if only as a starting point to simplify things a bit 😉
If you have any comments, leave a message.
Contact me