makedeb
An utility to directly boot image files without reformating the USB
Viewing /PKGBUILD
.
Click here to go back to the Git tree for ventoy-bin.
# Maintainer: exponential <echo ZXhwb25lbnRpYWxtYXRyaXhAcHJvdG9ubWFpbC5jb20K | base64 -d>
# Contributor: DuckSoft (AUR)<realducksoft at gmail dot com>
# Contributor: Mark Wagie (AUR)<mark dot wagie at proton dot me>
# Contributor: KokaKiwi (AUR)<kokakiwi+aur@kokakiwi.net>
pkgname=ventoy-bin
pkgver=1.0.99
pkgrel=0
pkgdesc="An utility to directly boot image files without reformating the USB"
_ARCH="$(uname -m)"
arch=("amd64" "arm64" "i386")
url="http://www.ventoy.net"
license=('GPL-3.0-or-later')
depends=('bash' 'util-linux' 'xz-utils' 'dosfstools')
optdepends=('libgtk-3-0: GTK3 GUI'
'libqt5gui5: Qt5 GUI'
'pkexec: run GUI from application menu')
provides=("${pkgname%-bin}")
conflicts=("${pkgname%-bin}")
source=("https://github.com/ventoy/Ventoy/releases/download/v${pkgver}/${pkgname%-bin}-${pkgver}-linux.tar.gz"
"${pkgname%-bin}-wrapper.sh"
"${pkgname%-bin}.desktop"
'sanitize.patch')
sha256sums=('467cdd188a7f739bc706adbc1d695f61ffdefc95916adb015947d80829f00a3d'
'b41f1bb0ba96c6484fd64aefbb63a106b756f08667e19bde93ddc28d7de973a3'
'22225d48023806d0d15e059216ef4921de70cdb78348630be109fa9c669e2900'
'993ffb6daa6b61efe81e9e2922b82a0588737406525c37e0eed682ed500914f6')
prepare() {
cd "${pkgname%-bin}-$pkgver"
# Decompress tools
pushd tool/$_ARCH
for file in *.xz; do
xzcat $file > ${file%.xz}
chmod +x ${file%.xz}
done
# Cleanup .xz crap
rm -fv ./*.xz
popd
# Apply sanitize patch
patch --verbose -p0 < "$srcdir/sanitize.patch"
# WebUI Log location
#sed -i 's|log\.txt|/var/log/ventoy.log|g' WebUI/static/js/languages.js tool/languages.json
# Non-POSIX compliant scripts
sed -i 's|bin/sh|usr/bin/env bash|g' tool/{ventoy_lib.sh,VentoyWorker.sh}
# Clean up unused binaries
# Preserving mkexfatfs and mount.exfat-fuse because exfatprogs is incompatible
for binary in xzcat hexdump; do
rm -fv tool/$_ARCH/$binary
done
}
package() {
cd "${pkgname%-bin}-$pkgver"
_PREFIX="/usr/libexec/${pkgname%-bin}"
_SHAREPREFIX="/usr/share/${pkgname%-bin}"
install -Dm644 -vt "$pkgdir${_SHAREPREFIX}/boot/" boot/*
install -Dm644 -vt "$pkgdir${_SHAREPREFIX}/${pkgname%-bin}/" "${pkgname%-bin}"/*
install -Dm755 -vt "$pkgdir${_SHAREPREFIX}/tool/" tool/*.{cer,glade,json,xz}
install -Dm755 -vt "$pkgdir${_PREFIX}/tool/" tool/*.sh
install -Dm755 -vt "$pkgdir${_PREFIX}/tool/$_ARCH/" tool/$_ARCH/*
install -Dm755 -vt "$pkgdir${_PREFIX}/" *.sh
cp --no-preserve=o -avt "$pkgdir${_SHAREPREFIX}/" plugin WebUI
install -Dm755 "VentoyGUI.$_ARCH" -v "$pkgdir${_PREFIX}/VentoyGUI"
install -dm755 "$pkgdir/usr/share/pixmaps"
ln -s "${_SHAREPREFIX}/WebUI/static/img/VentoyLogo.png" "$pkgdir/usr/share/pixmaps/${pkgname%-bin}.png"
install -Dm644 "$srcdir/${pkgname%-bin}.desktop" -vt "$pkgdir/usr/share/applications"
# Link system binaries
for binary in xzcat hexdump; do
ln -svf /usr/bin/$binary "$pkgdir${_PREFIX}/tool/$_ARCH/"
done
# launchers
install -dm755 "$pkgdir"/usr/bin/
install -m755 "$srcdir/${pkgname%-bin}-wrapper.sh" -vt "$pkgdir${_PREFIX}/"
ln -s "${_PREFIX}/${pkgname%-bin}-wrapper.sh" "$pkgdir/usr/bin/${pkgname%-bin}"2disk
ln -s "${_PREFIX}/${pkgname%-bin}-wrapper.sh" "$pkgdir/usr/bin/${pkgname%-bin}"gui
ln -s "${_PREFIX}/${pkgname%-bin}-wrapper.sh" "$pkgdir/usr/bin/${pkgname%-bin}"web
ln -s "${_PREFIX}/${pkgname%-bin}-wrapper.sh" "$pkgdir/usr/bin/${pkgname%-bin}"plugson
ln -s "${_PREFIX}/${pkgname%-bin}-wrapper.sh" "$pkgdir/usr/bin/${pkgname%-bin}"-extend-persistent
ln -s "${_PREFIX}/${pkgname%-bin}-wrapper.sh" "$pkgdir/usr/bin/${pkgname%-bin}"-create-persistent
ln -s "${_PREFIX}/${pkgname%-bin}-wrapper.sh" "$pkgdir/usr/bin/${pkgname%-bin}"vlink
# Remove Gtk 2 files
if [ $_ARCH == "x86_64" ]; then
rm "$pkgdir${_PREFIX}/tool/$_ARCH/Ventoy2Disk.gtk2"
fi
# readme
install -Dm644 "$srcdir/${pkgname%-bin}-$pkgver/README" "$pkgdir/usr/share/doc/${pkgname%-bin}/readme"
}