snapraid/makeslackware.sh.in

52 lines
1.2 KiB
Bash
Raw Normal View History

2025-12-25 23:58:55 +01:00
#!/bin/bash
#
2026-02-13 11:37:07 +01:00
# Script to build a Slackware .txz package for @PACKAGE_NAME@
# using the @PACKAGE@.SlackBuild and related files in the current directory.
2025-12-25 23:58:55 +01:00
#
# This version:
# - Runs the SlackBuild (as root recommended for makepkg)
#
# Requirements:
# - Run as root (or with sudo) for proper ownership/permissions in package
set -euo pipefail
2026-02-13 11:37:07 +01:00
VERSION="@PACKAGE_VERSION@"
TARBALL="@PACKAGE@-${VERSION}.tar.gz"
2025-12-25 23:58:55 +01:00
2026-02-13 11:37:07 +01:00
if [[ ! -f "pkg/@PACKAGE@.SlackBuild" ]]; then
echo "Error: @PACKAGE@.SlackBuild not found in the current directory."
2025-12-25 23:58:55 +01:00
exit 1
fi
2026-02-13 11:37:07 +01:00
if [[ ! -f "pkg/slack-desc" ]]; then
2025-12-25 23:58:55 +01:00
echo "Error: slack-desc not found in the current directory."
exit 1
fi
if [[ ! -f "${TARBALL}" ]]; then
echo "Error: ${TARBALL} not found in the current directory."
exit 1
2025-12-25 23:58:55 +01:00
fi
cp ${TARBALL} pkg/
2025-12-25 23:58:55 +01:00
# Set environment variables for SlackBuild
2026-02-13 11:37:07 +01:00
export VERSION BUILD=1 TAG=_am OUTPUT=$(pwd) # Package output in current dir
2025-12-25 23:58:55 +01:00
echo "Running SlackBuild..."
2026-02-13 11:37:07 +01:00
bash pkg/@PACKAGE@.SlackBuild
echo "Cleanup..."
rm -f pkg/${TARBALL}
2025-12-25 23:58:55 +01:00
echo ""
echo "Build complete!"
echo "The .txz package should be in the current directory:"
2026-02-13 11:37:07 +01:00
ls @PACKAGE@-${VERSION}-*-*.txz
2025-12-25 23:58:55 +01:00
echo ""
echo "You can install it with:"
2026-02-13 11:37:07 +01:00
echo " installpkg @PACKAGE@-${VERSION}-*-*.txz"
2025-12-25 23:58:55 +01:00
echo " or upgradepkg if replacing an older version."