~rbn/buildslack

builds SlackBuilds in clean environments
installtion notes
Merge branch 'delete'
documentation fixes

clone

read-only
https://git.sr.ht/~rbn/buildslack
read/write
git@git.sr.ht:~rbn/buildslack

You can also use your local clone with git send-email.

#buildslack, builds SlackBuilds in clean environments

#usage

main [options] [slackbuild name]
 -db value            database with slackbuild and package index <db.sqlite>
 -envroot value       build environment path <env>
 -slackroot value     slackware install path <slackroot>
 -mirror value        slackware mirror path </mnt/mirror/slackware/slackware64-current>
 -slackbuilds value   slackbuilds path <slackbuilds>
 -custom value        customizations path <custom>
 -sources value       source cache path <sources>
 -packages value      packages directory path <packages>
 -series value        bootstrap these package series <a,ap,d,e,k,l,n,t,tcl,x,xap,y>
 -bootstrap           bootstrap slackware install into slackroot
 -upgraderoot         upgrade slackware install in slackroot
 -initdb              initialize database
 -fkey                enable foreign key checks
 -index               build slackbuilds/patches index
 -build               build a package
 -upgrade             upgrade package / upgrade all packages
 -keep                keep environments of broken builds
 -debug               print debug output
 -force               force redownload and rebuild
 --                   Forcibly stop option processing
 -help                Print this message
 -?                   Print this message
	

#setup

	

#installation

as buildslack is written in TCL, you need it. just install it from the tcl series. it also requires tcllib which can be found on SlackBuilds.org.

you can either put the *.tcl files somewhere and run with tclsh main.tcl or build a starpack (bundled tcl runtime and sources) with make buildslack. this will download sdx and kitcreator, create a tclkit with the required packages and glue everything together. the result is a binary file buildslack.

#slackware root

you need a seperate slackware installation somewhere, used as lower directory of the overlayfs. this can be done manually or with the -bootstrap option:

buildslack -slackroot ./slackroot -bootstrap -mirror /path/to/slackware64-current

you can select which package series are installed using the -series argument. by default everything except kde is installed.

#indexing slackbuilds

buildslack uses a sqlite database to reason about slackbuilds and their dependencies. this index has to be rebuild after changes to the slackbuilds info files, eg. after pulling from slackbuilds.org repo.

buildslack -index -slackbuilds ./slackbuilds -db ./db.sqlite

this usually takes a few moments as every .info file has to be read and parsed.

#building packages

after these steps you can build a package using

buildslack -build -db ./db.sqlite -slackroot ./slackroot -envroot ./env -sources ./sources -packages ./packages slackbuildname

with -envroot being the directory where the overlayfs will be assembled, -sources giving the directory where downloaded source files will be stored and build packages will be stored into the directory specified by -packages. this will then recursively build (skipping present packages) every dependency and then the requested slackbuild.

#customizations

sometimes it is required to customize the build environment, e.g. adding user and group for a slackbuild. these customizations are stored seperately from the slackbuilds in a directory structure mirroring the one in which slackbuilds are stored. shell scripts (files with extension .sh) stored in those directories are sourced before the slackbuild is executed. additionally the info file can also be overridden by placing a modified copy into the respective customization directory.

if a customization for a slackbuild is added, the slackbuilds need to be reindexed.

#global customizations

it is possible to apply customizations to every slackbuild for example to set MAKEFLAGS=-j$(nproc). these global customizations go into the global directory in the customizations directory structure (this assumes that there will be no category "global" and is due to change, but works for now).

customizations of a slackbuild with the same name as a global one replace it.

#examples
#global/makeflags.sh
export MAKEFLAGS="-j$(nproc)"
	
#system/postgresql/usergroup.sh
groupadd -g 209 postgres
useradd -u 209 -g 209 -d /var/lib/pgsql postgres

#license

	
buildslack, builds SlackBuilds in clean environments
Copyright (C) 2021  Ruben Schuller <code@rbn.im>
	
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, version 3 of the License.
	
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.
	
You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.