Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

system/pkg: Added (Fast Package Manager). #8931

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions system/pkg/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
`pkg` Simple and fast package manager for the Slackbuilds.org repository

Can download, build and install packages. Resolves dependencies and
manages the installed packages and blacklist. Can search for packages,
and display them and their dependencies/dependees.

It differs from many other package managers in that you can simply
specify the packages you actually use in /etc/pkg/pkg_list.txt and the
(possibly changing) dependencies are managed automatically.

Written in go, it is fast and lightweight and can easily be
configured by changing src/config.go and recompiling.

Read README.md of the actual package for more information on how to use
it.
85 changes: 85 additions & 0 deletions system/pkg/pkg.SlackBuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
#!/bin/bash

# Slackware build script for <appname>

# Copyright 2024 Moritz R. Schaefer Germany
# 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=pkg
VERSION=${VERSION:-v0.1.0}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}

if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi

# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
# the name of the created package would be, and then exit. This information
# could be useful to other scripts.
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}

set -e

rm -rf $PKG
mkdir -p $TMP $PKG/usr/bin $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
-o -perm 511 \) -exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;

make APP_NAME=$PRGNAM
make install PREFIX=$PKG/usr APP_NAME=$PRGNAM

# Strip binary
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a \
README.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

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
10 changes: 10 additions & 0 deletions system/pkg/pkg.info
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
PRGNAM="pkg"
VERSION="v0.1.0"
HOMEPAGE="https://gitlab.com/M0M097/pkg"
DOWNLOAD="https://gitlab.com/M0M097/pkg/-/archive/v0.1.0/pkg-v0.1.0.tar.gz"
MD5SUM="b41f1889c7a6e51da6705dcc46b23dd2"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
MAINTAINER="Moritz R. Schäfer"
EMAIL="[email protected]"
19 changes: 19 additions & 0 deletions system/pkg/slack-desc
Original file line number Diff line number Diff line change
@@ -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------------------------------------------------------|
pkg: pkg (Simple and fast package manager for the SlackBuilds.org repo)
pkg:
pkg: Can download, build and install packages. Resolves dependencies and
pkg: manages the installed packages and blacklist. Can search for packages,
pkg: and display them and their dependencies/dependees.
pkg:
pkg: You can specify the packages you actually use in /etc/pkg/pkg_list.txt
pkg: and the (possibly changing) dependencies are managed automatically.
pkg:
pkg: Written in go, it is fast and lightweight and can easily be
pkg: configured by changing src/config.go and recompiling.