-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathslapt-src.Slackbuild
executable file
·48 lines (41 loc) · 2.06 KB
/
slapt-src.Slackbuild
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
#!/bin/sh
set -eu
# Slackware build script for slapt-src
# Copyright (C) 2003-2025 Jason Woodward <woodwardj at jaos dot org>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Library General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
VERSION=${1:-$(grep '^\s*version:' meson.build | cut -f2 -d\')}
BUILD=${BUILD:-1}
if [ -z "${ARCH:=}" ]; then
case "$( uname -m )" in
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
aarch64*) ARCH=aarch64 ;;
*) ARCH=$( uname -m ) ;;
esac
fi
TOP="${PWD}"
DESTDIR="${TOP}/pkg"
rm -rf "${DESTDIR}"
meson setup build --prefix=/usr --sysconfdir=/etc --mandir=/usr/man
meson compile -C build
DESTDIR="${DESTDIR}" meson install -C build
find "${DESTDIR}" -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
find "${DESTDIR}/usr/man" -type f -exec gzip {} \; || true
mkdir -p "${DESTDIR}/install"
cat slack-desc > "${DESTDIR}/install/slack-desc"
cat slack-required > "${DESTDIR}/install/slack-required"
cat slack-suggests > "${DESTDIR}/install/slack-suggests"
echo "if [ ! -d etc/slapt-get ]; then mkdir -p etc/slapt-get; fi; if [ ! -f etc/slapt-get/slapt-srcrc ]; then mv -f etc/slapt-get/slapt-srcrc.new etc/slapt-get/slapt-srcrc; else ! diff -q etc/slapt-get/slapt-srcrc etc/slapt-get/slapt-srcrc.new >/dev/null 2>&1 || rm etc/slapt-get/slapt-srcrc.new; fi;" > "${DESTDIR}/install/doinst.sh"
(cd "${DESTDIR}" && /sbin/makepkg -l y -c n "${TOP}/slapt-src-${VERSION}-${ARCH}-${BUILD}.txz")