diff options
Diffstat (limited to 'slacker')
| -rw-r--r-- | slacker/README | 16 | ||||
| -rw-r--r-- | slacker/doinst.sh | 16 | ||||
| -rw-r--r-- | slacker/slack-desc | 19 | ||||
| -rw-r--r-- | slacker/slacker.SlackBuild | 147 | ||||
| -rw-r--r-- | slacker/slacker.info | 12 |
5 files changed, 210 insertions, 0 deletions
diff --git a/slacker/README b/slacker/README new file mode 100644 index 0000000..a76625e --- /dev/null +++ b/slacker/README @@ -0,0 +1,16 @@ +slacker is a Slackware package manager written in Rust. It covers the +actions of slackpkg and adds slackpkg+ style multi-repository priority +resolution, dependency resolution, GPG verification, pinning and +reverting of upgrades. Packages are always applied through pkgtools. + +Configuration lives in /etc/slacker. The files are installed as .new +and merged on first install, like other Slackware configs. Start with +/etc/slacker/mirrors and /etc/slacker/repos. + +Optional repository credentials go in /etc/slacker/credentials.cat or +/etc/slacker/credentials.d, see the README.credentials there. + +A GTK front-end is available as slacker-gui, and a Flatpak front-end +as slacker-flatpak. + +Rust sources are built offline from upstream's vendored crates. diff --git a/slacker/doinst.sh b/slacker/doinst.sh new file mode 100644 index 0000000..8992b7e --- /dev/null +++ b/slacker/doinst.sh @@ -0,0 +1,16 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +for f in slacker.conf distro-upgrade.conf mirrors repos blacklist credentials.cat ; do + config etc/slacker/$f.new +done diff --git a/slacker/slack-desc b/slacker/slack-desc new file mode 100644 index 0000000..091b219 --- /dev/null +++ b/slacker/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +slacker: slacker (Slackware package manager written in Rust) +slacker: +slacker: slacker installs, upgrades and removes Slackware packages through +slacker: pkgtools. It matches slackpkg's actions and adds slackpkg+ style +slacker: multi-repository priority resolution, dependency resolution, GPG +slacker: verification, package pinning and reverting. +slacker: +slacker: Homepage: https://forge.slackware.nl/rizitis/slacker +slacker: +slacker: +slacker: diff --git a/slacker/slacker.SlackBuild b/slacker/slacker.SlackBuild new file mode 100644 index 0000000..fb5cb5f --- /dev/null +++ b/slacker/slacker.SlackBuild @@ -0,0 +1,147 @@ +#!/bin/bash + +# Slackware build script for slacker + +# Copyright 2026 danix <danix@danix.xyz> +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +cd $(dirname $0) ; CWD=$(pwd) + +PRGNAM=slacker +VERSION=${VERSION:-0.14.3_beta.7} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} + +# Release tag is 0.14.3_beta.7, the tarballs are named 0.14.3. +SRCVER=${VERSION%%_*} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" -o "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=$ARCH -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" -o "$ARCH" = "aarch64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +# Upstream ships example configs for i686 and x86_64, per release. +case "$ARCH" in + i?86) CONFARCH=i686 ;; + *) CONFARCH=$ARCH ;; +esac +CONFREL=stable +grep -q '^VERSION_CODENAME=current$' /etc/os-release && CONFREL=current + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$SRCVER-source +tar xvf $CWD/$PRGNAM-cli-$SRCVER-source.tar.gz +cd $PRGNAM-$SRCVER-source +chown -R root:root . +find . ! -type l -a \( \ + \( -perm /111 -a ! -perm 755 -a -exec chmod -f 755 {} + \) -o \ + \( ! -perm /111 -a ! -perm 644 -a -exec chmod -f 644 {} + \) \) + +cd slacker-cli +CONF=CONF/etc-slacker/$CONFREL/$CONFARCH +[ -d $CONF ] || { echo "No upstream config for $CONFREL/$CONFARCH" ; exit 1 ; } + +# Build offline from upstream's vendored crates (vendors.tar.gz). +tar xf $CWD/vendors.tar.gz +tar xf vendors/slacker-cli-*.tar.gz +tar xf slacker-cli-vendor-*/slacker-cli-vendor-*.tar.gz +mkdir -p .cargo +cat slacker-cli-vendor-*/cargo-config.toml > .cargo/config.toml + +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +cargo build --frozen --release + +install -Dm0755 target/release/slacker $PKG/usr/bin/slacker +strip --strip-unneeded $PKG/usr/bin/slacker + +mkdir -p $PKG/etc/slacker/templates +for f in slacker.conf distro-upgrade.conf mirrors repos blacklist ; do + cat $CONF/$f > $PKG/etc/slacker/$f.new +done +echo "https://forge.slackware.nl/rizitis/slacker/wiki/Templates" \ + > $PKG/etc/slacker/templates/Templates-howto.txt + +# Repository credentials are optional, keep them readable by root only. +install -d -m0700 $PKG/etc/slacker/credentials.d +install -m0600 CONF/README.credentials $PKG/etc/slacker/credentials.d/ +cat > $PKG/etc/slacker/credentials.cat.new <<'EOF' +# slacker repository credentials (HTTPS Basic), optional. +# Public Slackware mirrors need none of this. +# +# Per-URL catalog: any repo whose URL starts with a section prefix uses it. +# [https://forge.example.org/owner] +# username = user +# password = <token> +# +# Or a named set in credentials.d/<name>, referenced from the repos line with +# `credentials=<name>`. Either way: chmod 600, chown root:root. +EOF +chmod 0600 $PKG/etc/slacker/credentials.cat.new + +mkdir -p $PKG/usr/man/man8 +gzip -9c man/slacker.8 > $PKG/usr/man/man8/slacker.8.gz + +install -Dm0644 contrib/slacker-completion.bash \ + $PKG/usr/share/bash-completion/completions/slacker +install -Dm0644 contrib/slacker-completion.zsh \ + $PKG/usr/share/zsh/site-functions/_slacker +install -Dm0644 contrib/slacker.fish \ + $PKG/usr/share/fish/vendor_completions.d/slacker.fish + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a ../LICENSE ../NEWS ../README.md ARCHITECTURE.md \ + $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/slacker/slacker.info b/slacker/slacker.info new file mode 100644 index 0000000..97ca556 --- /dev/null +++ b/slacker/slacker.info @@ -0,0 +1,12 @@ +PRGNAM="slacker" +VERSION="0.14.3_beta.7" +HOMEPAGE="https://forge.slackware.nl/rizitis/slacker" +DOWNLOAD="https://forge.slackware.nl/rizitis/slacker/releases/download/0.14.3_beta.7/slacker-cli-0.14.3-source.tar.gz \ + https://forge.slackware.nl/rizitis/slacker/releases/download/0.14.3_beta.7/vendors.tar.gz" +MD5SUM="b967183cd219a13be2b577c38b33e699 \ + bb88386ac64264cc653beb1abef367e2" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="danix" +EMAIL="danix@danix.xyz" |
