diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2019-08-03 16:40:06 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2019-08-03 19:24:55 +0200 |
commit | 0c3b91dbcff63cc965a20a6be7015dd80d02c998 (patch) | |
tree | 8d0a14a43f5ce51ecd59b020e0e746e240b55282 /docker | |
parent | f38c86adbe0f504a2f6309b1cf0784a90ddf43ec (diff) | |
download | slackbuilder-0c3b91dbcff63cc965a20a6be7015dd80d02c998.tar.gz slackbuilder-0c3b91dbcff63cc965a20a6be7015dd80d02c998.tar.bz2 |
Add files for creating slackbuilder images.
Diffstat (limited to 'docker')
-rw-r--r-- | docker/.gitignore | 1 | ||||
-rw-r--r-- | docker/Dockerfile | 6 | ||||
-rw-r--r-- | docker/Makefile | 12 | ||||
-rw-r--r-- | docker/README | 32 | ||||
-rw-r--r-- | docker/slackpkg.conf | 153 | ||||
-rw-r--r-- | docker/sysupdate.sh | 57 |
6 files changed, 261 insertions, 0 deletions
diff --git a/docker/.gitignore b/docker/.gitignore new file mode 100644 index 0000000..0d22edb --- /dev/null +++ b/docker/.gitignore @@ -0,0 +1 @@ +.builder* diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..926fd68 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,6 @@ +ARG OS_VERSION=14.1 +FROM vbatts/slackware:${OS_VERSION} +COPY slackpkg.conf /etc/slackpkg/slackpkg.conf +COPY sysupdate.sh /usr/local/libexec/sysupdate.sh +RUN /bin/sh /usr/local/libexec/sysupdate.sh +RUN rm /usr/local/libexec/sysupdate.sh diff --git a/docker/Makefile b/docker/Makefile new file mode 100644 index 0000000..50ac701 --- /dev/null +++ b/docker/Makefile @@ -0,0 +1,12 @@ +OS_VERSION=14.1 + +builder: + @$(MAKE) .builder_${OS_VERSION} + +clean:; @rm -f .builder_${OS_VERSION} + +.builder_${OS_VERSION}: Dockerfile sysupdate.sh slackpkg.conf + docker build -t gray/slackbuilder:${OS_VERSION} \ + --build-arg=OS_VERSION=${OS_VERSION} . + touch $@ + diff --git a/docker/README b/docker/README new file mode 100644 index 0000000..9bf47fa --- /dev/null +++ b/docker/README @@ -0,0 +1,32 @@ +This directory holds files necessary for creating slackbuild docker images. +A slackbuild image contains the base Slackware system plus all packages from +the following series: + + a - base + ap - applications + d - development + e - emacs + l - libraries + t - TeX + tcl - Tcl/Tk and related + x - X Window System + +Ideally, 'd' and 'e' would suffice. However, the reality is a bit more +complex. Certain packages needed for multimedia packages are located in +'ap' (e.g. 'flac'). The 'x' series contains some libraries necessary for +building graphical applications. The 'e' is necessary for packages that +compile emacs lisp files. The 't' might be required for documentation and +'tcl' for some tcl or expect-based programs. + +To build the image for the Slackware version X.Y run + + make OS_VERSION=X.Y + +The image will be named "gray/slackbuilder:X.Y". To use it with slackbuilder, +add the following to its configuration file (/etc/slackbuilder.conf): + + [core] + image = gray/slackbuilder:X.Y + +or use the --image option. + diff --git a/docker/slackpkg.conf b/docker/slackpkg.conf new file mode 100644 index 0000000..1cfc479 --- /dev/null +++ b/docker/slackpkg.conf @@ -0,0 +1,153 @@ +# +# slackpkg.conf - Configuration for SlackPkg +# v2.8 +# + +# +# SlackPkg - An Automated packaging tool for Slackware Linux +# Copyright (C) 2003-2011 Roberto F. Batista, Evaldo Gardenali +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Project Page: http://slackpkg.org/ +# Roberto F. Batista (aka PiterPunk) piterpunk@slackware.com +# Evaldo Gardenali (aka UdontKnow) evaldogardenali@fasternet.com.br +# + +# For configuration options that have only two states, possible values are +# either "on" or "off" + +# Remember, the only official Slackware ports are x86, s390 and arm, and +# slackpkg developers don't have s390 boxes for testing. If you are +# testing/using other architectures and have suggestions or patches, +# please let me know (piterpunk@slackware.com) +# +# Select the architecture of your system. Valid values are: +# i#86 (where # is 3, 4, 5 or 6) +# x86_64 +# s390 +# arm* (* can be v4, v5tejl, and other ARM versions) +# powerpc +# +# The line is commented because slackpkg will try to find your +# architecture automagically. If you want to override what slackpkg +# finds, put the value after the = and uncomment this line +#ARCH= + +# The default PKGMAIN is "slackware", but some derived distros use other +# names as the main directory. PKGMAIN is the place with the slackware +# package series (a, ap, n, ... ). +# +# Usually slackpkg can automagically discover this variable. If you want +# to override the discovered variable, then uncomment this line and change +# it to reflect the correct value of PKGMAIN +#PKGMAIN=slackware + +# Slackware packages are signed by project key. Slackpkg uses this key +# to check if the packages downloaded are valid, so remember to set +# CHECKGPG to "on". +# +# Usually slackpkg can automagically discover this variable. If you want +# to override the discovered variable, then uncomment this line and edit +# as needed +#SLACKKEY="Slackware Linux Project <security@slackware.com>" + +# Downloaded files will be in directory below: +TEMP=/var/cache/packages + +# Package lists, file lists, and others will be at WORKDIR: +WORKDIR=/var/lib/slackpkg + +# Special options for wget (default is WGETFLAGS="--passive-ftp") +WGETFLAGS="--passive-ftp -nv" + +# If DELALL is "on", all downloaded files will be removed after install. +DELALL=on + +# If CHECKMD5 is "on", the system will check the md5sums of all packages before +# install/upgrade/reinstall is performed. +CHECKMD5=on + +# If CHECKGPG is "on", the system will verify the GPG signature of each package +# before install/upgrade/reinstall is performed. +CHECKGPG=on + +# If CHECKSIZE is "on", the system will check if we have sufficient disk +# space to install selected package. This make upgrade/install safer, but slow +# upgrade/install process. +CHECKSIZE=off + +# PRIORITY sets the download priority. slackpkg will try to found the +# package first in the first value, then the second one, through all +# values in list. +# +# Default value: patches %PKGMAIN extra pasture testing +PRIORITY=( patches %PKGMAIN extra pasture testing ) + +# Enables (on) or disables (off) slackpkg's post-installation features, such +# as checking for new (*.new) configuration files and new kernel images, and +# prompts you for what it should do. Default=on +POSTINST=off + +# Post-installation features, by default, search all of /etc for .new files. +# This is the safe option: with it, you won't have any unmerged .new files +# to cause problems. Even so, some people prefer that only the .new files +# installed by the current slackpkg session be checked. +# If this is your case, change ONLY_NEW_DOTNEW to "on". +# Default=off +ONLY_NEW_DOTNEW=off + +# The ONOFF variable sets the initial behavior of the dialog interface. +# If you set this to "on" then all packages will be selected by default. +# If you prefer the opposite option (all unchecked), then set this to "off". +ONOFF=on + +# If this variable is set to "on", all files will be downloaded before the +# requested operation (install or upgrade) is performed. If set to "off", +# then the files will be downloaded and the operation (install/upgrade) +# performed one by one. Default=on +DOWNLOAD_ALL=on + +# Enables (on) or disables (off) the dialog interface in slackpkg. Default=on +DIALOG=off + +# Enables (on) or disables (off) the non-interactive mode. If set to "on", +# slackpkg will run without asking the user anything, and answer all questions +# with DEFAULT_ANSWER. If you do any upgrades using this mode, you'll need to +# run "slackpkg new-config" later to find and merge any .new files. +BATCH=on + +# Default answer to slackpkg questions. Can be "y" or "n". +DEFAULT_ANSWER=y + +# Slackpkg allows a template to "include" the packages specified in another +# template. This option enables (on) or disables (off) the parsing of +# any "#include" directives in template files. Default=on +USE_INCLUDES=on + +# Enables a spinning bar as visual feedback when slackpkg is making its +# internal lists and some other operations. Default=on +SPINNING=off + +# Max number of characters that "dialog" command can handle. +# If unset, this variable will be 19500 (the number that works on +# Slackware 10.2) +DIALOG_MAXARGS=139000 + +# +# The MIRROR is set from /etc/slackpkg/mirrors +# You only need to uncomment the selected mirror. +# Uncomment one mirror only. +# diff --git a/docker/sysupdate.sh b/docker/sysupdate.sh new file mode 100644 index 0000000..273adb6 --- /dev/null +++ b/docker/sysupdate.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# Update a base Slackware installation so it can be used for building packages +# Copyright (C) 2019 Sergey Poznyakoff +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +set -e + +# Update a list of available packages in /var/lib/slackpkg/pkglist +slackpkg update + +# Create a list of installed packages. Each line in the output consists of +# three fields: +# 1. Package name +# 2. Package version +# 3. Build number +# Only the first field is actually used. Rest is for future use. +find /var/log/packages -type f -maxdepth 1 -printf '%f\n' | \ + sed -r -n -e 's/(.*)-([[:digit:].]+.*)-x86_64-([0-9]+).*/\1 \2 \3/p' | \ + sort -k1 -k2V > /tmp/installed + +# Create a list of available packages in series: +# a - base +# ap - applications +# d - development +# e - emacs +# l - libraries +# t - TeX +# tcl - Tcl/Tk and related +# x - X Window System +# Each output line has four fields. The first three are the same as described +# above. The fourth contains base name of the package without the archive +# suffix (.t[gx]z). +awk '/^slackware64/ { + if (match($7, /\/[adeltx]$/) || match($7, /\/ap/) || match($7, /\/tcl/)) + print $2,$3,$5,$6}' \ + /var/lib/slackpkg/pkglist | \ + sort -k1 -k2V > /tmp/available + +# Install missing packages +slackpkg install $(join -v 2 /tmp/installed /tmp/available | awk '{print $4}') + +# Clean up +rm -rf /tmp/* + + |