2021-06-15 10:26:26 +02:00
|
|
|
#!/bin/bash
|
2021-04-26 00:07:07 +02:00
|
|
|
|
|
|
|
CWD=$(pwd)
|
|
|
|
|
2023-05-31 14:27:46 +02:00
|
|
|
PRGNAM=$(basename "$CWD")
|
2022-02-22 13:40:31 +01:00
|
|
|
GITHUB_REPO=Kron4ek/Conty
|
2023-05-31 14:27:46 +02:00
|
|
|
VERSION=${VERSION:-"latest"}
|
2021-04-26 00:07:07 +02:00
|
|
|
ARCH=${ARCH:-$(uname -m)}
|
2023-06-30 14:12:29 +02:00
|
|
|
BUILD=${BUILD:-2}
|
2021-04-26 00:07:07 +02:00
|
|
|
TAG=${TAG:-gwh}
|
|
|
|
|
|
|
|
TMP=${TMP:-/tmp/$TAG}
|
|
|
|
PKG=$TMP/pkg-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
PREFIX=/usr
|
|
|
|
|
2022-02-22 13:40:31 +01:00
|
|
|
REPOSITORY=${REPOSITORY:-/home/installs/SlackBuilds/_repositories/$PRGNAM}
|
|
|
|
|
2023-05-31 14:27:46 +02:00
|
|
|
# nettoyage préalable
|
|
|
|
rm -fr "$PKG" "${TMP:?}/$PRGNAM"
|
|
|
|
|
|
|
|
mkdir -p "$PKG"
|
|
|
|
|
|
|
|
# mise en place
|
|
|
|
[ ! -e "$REPOSITORY" ] && git clone https://github.com/${GITHUB_REPO} "$REPOSITORY"
|
|
|
|
cd "$REPOSITORY" || exit 1
|
|
|
|
git reset --hard HEAD
|
|
|
|
git pull --all
|
|
|
|
|
|
|
|
cp -R "$REPOSITORY" "$TMP/"
|
|
|
|
|
|
|
|
cd "$TMP/$PRGNAM/" || exit 1
|
|
|
|
case $VERSION in
|
|
|
|
trunk)
|
|
|
|
VERSION="r$(git rev-list --count HEAD)_$(git log -1 --format=%h)"
|
|
|
|
;;
|
|
|
|
latest)
|
2024-01-11 14:48:15 +01:00
|
|
|
VERSION=$(git tag --sort=-taggerdate | head -n1)
|
2023-05-31 14:27:46 +02:00
|
|
|
git checkout "$VERSION"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
git checkout "$VERSION"
|
|
|
|
;;
|
|
|
|
esac
|
2021-04-26 00:07:07 +02:00
|
|
|
|
2023-06-30 14:12:29 +02:00
|
|
|
# don't embed
|
|
|
|
for i in firefox qbittorrent ; do
|
|
|
|
sed -i "s|$i||" ./create-arch-bootstrap.sh
|
|
|
|
done
|
|
|
|
|
2023-05-31 14:27:46 +02:00
|
|
|
./create-arch-bootstrap.sh
|
2021-04-26 00:07:07 +02:00
|
|
|
|
2023-05-31 14:27:46 +02:00
|
|
|
./create-conty.sh
|
2021-04-26 00:07:07 +02:00
|
|
|
|
2023-05-31 14:27:46 +02:00
|
|
|
mkdir -p "$PKG$PREFIX/bin"
|
|
|
|
cp conty.sh "$PKG$PREFIX/bin/${PRGNAM}"
|
2023-03-06 10:42:39 +01:00
|
|
|
|
2023-05-31 14:27:46 +02:00
|
|
|
cd "$PKG$PREFIX/bin/" || exit 1
|
2023-03-06 10:42:39 +01:00
|
|
|
cat <<EOF > steam
|
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
$PREFIX/bin/conty steam "\$@"
|
|
|
|
EOF
|
2023-06-14 07:36:41 +02:00
|
|
|
chmod +x steam
|
|
|
|
|
|
|
|
chmod +x "$PKG$PREFIX"/bin/*
|
2023-04-07 18:57:16 +02:00
|
|
|
|
2023-05-31 14:27:46 +02:00
|
|
|
mkdir -p "$PKG$PREFIX/share/applications/"
|
|
|
|
cat <<EOF > "$PKG$PREFIX/share/applications/steam.desktop"
|
2023-04-07 18:57:16 +02:00
|
|
|
[Desktop Entry]
|
|
|
|
Encoding=UTF-8
|
|
|
|
Version=1.0
|
|
|
|
Type=Application
|
|
|
|
Terminal=false
|
|
|
|
Exec=$PREFIX/bin/steam
|
|
|
|
Name=Steam
|
|
|
|
EOF
|
|
|
|
|
2023-03-06 10:42:39 +01:00
|
|
|
for prg in wine winetricks lutris playonlinux4; do
|
2023-05-31 14:27:46 +02:00
|
|
|
ln -s "${PRGNAM}" $prg
|
|
|
|
cat <<EOF > "$PKG$PREFIX/share/applications/$prg.desktop"
|
2023-04-07 18:57:16 +02:00
|
|
|
[Desktop Entry]
|
|
|
|
Encoding=UTF-8
|
|
|
|
Version=1.0
|
|
|
|
Type=Application
|
|
|
|
Terminal=false
|
|
|
|
Exec=$PREFIX/bin/$prg
|
|
|
|
Name=$prg
|
|
|
|
EOF
|
2023-03-06 10:42:39 +01:00
|
|
|
done
|
|
|
|
|
2023-05-31 14:27:46 +02:00
|
|
|
# ( cd "$PKG" || exit 1
|
|
|
|
# find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
|
|
|
# find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
|
|
|
|
# )
|
2021-04-26 00:07:07 +02:00
|
|
|
|
2023-05-31 14:27:46 +02:00
|
|
|
mkdir -p "$PKG/install"
|
|
|
|
cat <<EOF > "$PKG/install/slack-desc"
|
2021-04-26 00:07:07 +02:00
|
|
|
# HOW TO EDIT
|
|
|
|
THIS FILE:
|
|
|
|
# The "handy ruler" below makes it easier to edit a package description. Line
|
|
|
|
# up the first '|' above the ':' following the base package name, and the '|'
|
|
|
|
# on the right side marks the last column you can put a character in. You must
|
|
|
|
# make exactly 11 lines for the formatting to be correct. It's also
|
|
|
|
# customary to leave one space after the ':'.
|
|
|
|
|
|
|
|
|-----handy-ruler--------------------------------------------------------|
|
|
|
|
$PRGNAM: $PRGNAM (Easy to use non-root container packed into a single executable)
|
|
|
|
$PRGNAM:
|
|
|
|
$PRGNAM: a portable Arch Linux distro packed into a single executable that can
|
|
|
|
$PRGNAM: be used to run any applications
|
|
|
|
$PRGNAM:
|
|
|
|
$PRGNAM:
|
|
|
|
$PRGNAM:
|
|
|
|
$PRGNAM:
|
|
|
|
$PRGNAM:
|
2022-02-22 13:40:31 +01:00
|
|
|
$PRGNAM: https://github.com/${GITHUB_REPO}
|
2021-04-26 00:07:07 +02:00
|
|
|
$PRGNAM:
|
|
|
|
EOF
|
|
|
|
|
2023-05-31 14:27:46 +02:00
|
|
|
cd "$PKG" || exit 1
|
|
|
|
rm -f "$PKG/{,usr/}lib$(uname -m | grep -o 64)/*.la"
|
2021-04-26 00:07:07 +02:00
|
|
|
|
2023-08-16 12:23:26 +02:00
|
|
|
/sbin/makepkg --linkadd y --chown n --prepend "$OUTPUT/$PRGNAM-$VERSION${EDITION}-$ARCH-$BUILD$TAG.txz"
|