aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSlack Coder <slackcoder@server.ky>2025-01-28 12:05:53 -0500
committerSlack Coder <slackcoder@server.ky>2025-01-29 06:27:23 -0500
commit6379cb0c0fa848f61ec30c434aed2d6b81d4ad49 (patch)
tree0328c744c9b28cf9210b69d50da162203b9a76fa
parentefcb26931712858d70e671c37d09c9aede862572 (diff)
downloadsbotools2-6379cb0c0fa848f61ec30c434aed2d6b81d4ad49.tar.xz
Add /etc/sbotools/sbotools.conf automatically
-rw-r--r--ChangeLog.md1
-rw-r--r--etc/sbotools.conf29
-rw-r--r--slackbuild/sbotools2/doinst.sh25
-rw-r--r--slackbuild/sbotools2/sbotools2.SlackBuild4
4 files changed, 59 insertions, 0 deletions
diff --git a/ChangeLog.md b/ChangeLog.md
index aed26fc..15d2ead 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file.
### Added
+ - Automatically add /etc/sbotools/sbotools.conf on installation.
- GPG and checksum verification. Breaking change, disable by configuring 'GPG_KEY=FALSE'.
- Import GPG key with 'sbosnap import-key'.
- Dockerfile for 15.0 testing.
diff --git a/etc/sbotools.conf b/etc/sbotools.conf
new file mode 100644
index 0000000..ecede5c
--- /dev/null
+++ b/etc/sbotools.conf
@@ -0,0 +1,29 @@
+# See the manual page for sbotools.conf for more information on
+# configuration parameters.
+
+# DISTCLEAN can be FALSE or TRUE.
+# DISTCLEAN=TRUE
+
+# JOBS can be FALSE or a number.
+# JOBS=FALSE
+
+# GPG_KEY can be FALSE of the GNUPG long form key ID.
+# GPG_KEY=D3076BC3E783EE747F09B8B70368EF579C7BA3B6
+
+# NOCLEAN can be FALSE or TRUE.
+# NOCLEAN=FALSE
+
+# PKG_DIR can be FALSE or a /path.
+# PKG_DIR=FALSE
+
+# SBO_HOME is the path where to sync Slackbuilds.org's SlackBuilds.
+# SBO_HOME=/usr/sbo
+
+# LOCAL_OVERRIDES is FALSE or the path where overrides are located.
+# LOCAL_OVERRIDES=FALSE
+
+# SLACKWARE_VERSION is FALSE or a predefined slackware version.
+# SLACKWARE_VERSION=FALSE
+
+# REPO is FALSE or the URL to sync slackbuilds.org SlackBuild scripts from.
+# REPO=FALSE
diff --git a/slackbuild/sbotools2/doinst.sh b/slackbuild/sbotools2/doinst.sh
new file mode 100644
index 0000000..5008fc5
--- /dev/null
+++ b/slackbuild/sbotools2/doinst.sh
@@ -0,0 +1,25 @@
+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...
+}
+
+preserve_perms() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ if [ -e $OLD ]; then
+ cp -a $OLD ${NEW}.incoming
+ cat $NEW > ${NEW}.incoming
+ mv ${NEW}.incoming $NEW
+ fi
+ config $NEW
+}
+
+preserve_perms etc/sbotools/sbotools.conf.new
diff --git a/slackbuild/sbotools2/sbotools2.SlackBuild b/slackbuild/sbotools2/sbotools2.SlackBuild
index d879ce9..09968a3 100644
--- a/slackbuild/sbotools2/sbotools2.SlackBuild
+++ b/slackbuild/sbotools2/sbotools2.SlackBuild
@@ -86,6 +86,9 @@ find $PKG -name perllocal.pod -o -name ".packlist" -o -name "*.bs" | xargs rm -f
find $PKG -depth -type d -empty -delete || true
+mkdir -p $PKG/etc/sbotools
+cp etc/sbotools.conf $PKG/etc/sbotools/sbotools.conf.new
+
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/SBO-Lib
cp -a SBO-Lib/README $PKG/usr/doc/$PRGNAM-$VERSION/SBO-Lib
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
@@ -93,6 +96,7 @@ cp -a LICENSE.txt ChangeLog.md 'key/slackbuilds-devel@slackbuilds.org.asc' $PKG/
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-noarch-$BUILD$TAG.${PKGTYPE:-tgz}