-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclash-verge.SlackBuild
52 lines (41 loc) · 1.68 KB
/
clash-verge.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
49
50
51
52
#!/bin/sh
# Slackware build script for clash-verge.
# Copyright 2024 Shi Pujin <[email protected]>
# All rights reserved.
#
PRGNAM=clash-verge
VERSION=${VERSION:-1.6.6}
DISTVERSION="${VERSION}-1"
BUILD=${BUILD:-1}
TAG=${TAG:-SlackwareCN}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH="x86" ;;
arm*) ARCH=arm ;;
x86_64) ARCH="x86_64" ;;
*) ARCH=$( uname -m ) ;;
esac
fi
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
DOCFILES=""
set -e
rm -rf $PKG
rm -rf $TMP/$PRGNAM-$VERSION
mkdir -p $TMP $PKG $OUTPUT $TMP/$PRGNAM-$VERSION
cd $TMP/$PRGNAM-$VERSION
rpm2cpio $CWD/clash-verge-${DISTVERSION}.$ARCH.rpm | cpio -idmv
# Copy the unpacked things to Temp dir.
mkdir -pv $PKG/usr/local/bin $PKG/usr/local/lib $PKG/usr/share/applications $PKG/usr/share/icons/hicolor/{128x128,256x256@2,32x32}/apps
mkdir -pv $PKG/usr/local/lib/clash-verge/resources
cp -a $TMP/$PRGNAM-$VERSION/usr/bin/{clash-meta,clash-meta-alpha,clash-verge} $PKG/usr/local/bin/
cp -a $TMP/$PRGNAM-$VERSION/usr/lib/clash-verge/ $PKG/usr/local/lib/
cp -a $TMP/$PRGNAM-$VERSION/usr/share/applications/clash-verge.desktop $PKG/usr/share/applications/
cp -a $TMP/$PRGNAM-$VERSION/usr/share/icons/* $PKG/usr/share/icons/
cp -a $TMP/$PRGNAM-$VERSION/usr/share/icons/hicolor/128x128/apps/clash-verge.png $PKG/usr/share/icons/hicolor/128x128/apps/
cp -a $TMP/$PRGNAM-$VERSION/usr/share/icons/hicolor/256x256@2/apps/clash-verge.png $PKG/usr/share/icons/hicolor/256x256@2/apps/
cp -a $TMP/$PRGNAM-$VERSION/usr/share/icons/hicolor/32x32/apps/clash-verge.png $PKG/usr/share/icons/hicolor/32x32/apps/
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD-$TAG.${PKGTYPE:-tgz}