-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakeslackware.sh.in
More file actions
56 lines (46 loc) · 1.5 KB
/
makeslackware.sh.in
File metadata and controls
56 lines (46 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
#
# Script to build a Slackware .txz package for @PACKAGE_NAME@
# using the @PACKAGE@.SlackBuild and related files in the current directory.
#
# This version:
# - Prefers a source tarball already present in the current directory
# - Only downloads it if not found locally
# - Runs the SlackBuild (as root recommended for makepkg)
#
# Requirements:
# - Run as root (or with sudo) for proper ownership/permissions in package
set -euo pipefail
VERSION="@PACKAGE_VERSION@"
TARBALL="@PACKAGE@-${VERSION}.tar.gz"
SOURCE_URL="https://github.com/amadvance/@PACKAGE@/releases/download/v${VERSION}/${TARBALL}"
if [[ ! -f "pkg/@PACKAGE@.SlackBuild" ]]; then
echo "Error: @PACKAGE@.SlackBuild not found in the current directory."
exit 1
fi
if [[ ! -f "pkg/slack-desc" ]]; then
echo "Error: slack-desc not found in the current directory."
exit 1
fi
# Prefer local tarball
if [[ -f "./${TARBALL}" ]]; then
echo "Found ${TARBALL} locally."
cp ${TARBALL} pkg/
else
echo "Downloading ${TARBALL}..."
curl -L -O "$SOURCE_URL"
fi
# Set environment variables for SlackBuild
export VERSION BUILD=1 TAG=_am OUTPUT=$(pwd) # Package output in current dir
echo "Running SlackBuild..."
bash pkg/@PACKAGE@.SlackBuild
echo "Cleanup..."
rm -f pkg/${TARBALL}
echo ""
echo "Build complete!"
echo "The .txz package should be in the current directory:"
ls @PACKAGE@-${VERSION}-*-*.txz
echo ""
echo "You can install it with:"
echo " installpkg @PACKAGE@-${VERSION}-*-*.txz"
echo " or upgradepkg if replacing an older version."