Build/install scripts: verbose tar output and set files' owner/group to root

pull/58/head
jackun 4 years ago
parent 987b72174c
commit a64b6cada2
No known key found for this signature in database
GPG Key ID: 119DB3F1D05A9ED3

@ -1,12 +1,12 @@
install() { install() {
[ "$UID" -eq 0 ] || exec sudo bash "$0" "$@" [ "$UID" -eq 0 ] || exec sudo bash "$0" install
tar -C / -xf MangoHud*.tar tar -C / -xvf MangoHud-package.tar
ldconfig ldconfig
echo "MangoHud Installed" echo "MangoHud Installed"
} }
uninstall() { uninstall() {
[ "$UID" -eq 0 ] || exec sudo bash "$0" "$@" [ "$UID" -eq 0 ] || exec sudo bash "$0" uninstall
rm -rfv "/usr/lib/MangoHud" rm -rfv "/usr/lib/MangoHud"
rm -fv "/usr/share/vulkan/implicit_layer.d/mangohud.json" rm -fv "/usr/share/vulkan/implicit_layer.d/mangohud.json"
rm -fv "/etc/ld.so.conf.d/libmangohud.conf" rm -fv "/etc/ld.so.conf.d/libmangohud.conf"

@ -17,4 +17,4 @@ fi
# pass through the overriden LD_PRELOAD environment variables # pass through the overriden LD_PRELOAD environment variables
LD_PRELOAD="${LD_PRELOAD}:${MANGOHUD_LIB_NAME}" LD_PRELOAD="${LD_PRELOAD}:${MANGOHUD_LIB_NAME}"
exec env MANGOHUD="1" LD_PRELOAD="${LD_PRELOAD}" "$@" exec env MANGOHUD=1 LD_PRELOAD="${LD_PRELOAD}" "$@"

@ -139,31 +139,34 @@ package() {
mkdir -p "$INSTALL_DIR/usr/lib/MangoHud/"{lib32,lib64} mkdir -p "$INSTALL_DIR/usr/lib/MangoHud/"{lib32,lib64}
mkdir -p "$INSTALL_DIR/usr/share/vulkan/implicit_layer.d" mkdir -p "$INSTALL_DIR/usr/share/vulkan/implicit_layer.d"
mkdir -p "$INSTALL_DIR/etc/ld.so.conf.d" mkdir -p "$INSTALL_DIR/etc/ld.so.conf.d"
cp libmangohud.conf "$INSTALL_DIR/etc/ld.so.conf.d/libmangohud.conf" cp libmangohud.conf "$INSTALL_DIR/etc/ld.so.conf.d/libmangohud.conf"
cp "$LIB" "$INSTALL_DIR/usr/lib/MangoHud/lib64/libMangoHud.so" cp "$LIB" "$INSTALL_DIR/usr/lib/MangoHud/lib64/libMangoHud.so"
cp "$LIB32" "$INSTALL_DIR/usr/lib/MangoHud/lib32/libMangoHud.so" cp "$LIB32" "$INSTALL_DIR/usr/lib/MangoHud/lib32/libMangoHud.so"
cp "$LAYER" "$INSTALL_DIR/usr/share/vulkan/implicit_layer.d/" cp "$LAYER" "$INSTALL_DIR/usr/share/vulkan/implicit_layer.d/"
cp --preserve=mode "build/release/usr/bin/mangohud" "$INSTALL_DIR/usr/bin/mangohud" cp --preserve=mode "build/release/usr/bin/mangohud" "$INSTALL_DIR/usr/bin/mangohud"
tar -C build/package -cf "build/MangoHud-package.tar" . tar --numeric-owner --owner=0 --group=0 \
-C build/package -cvf "build/MangoHud-package.tar" .
} }
release() { release() {
rm build/MangoHud-package.tar rm build/MangoHud-package.tar
mkdir -p build/MangoHud mkdir -p build/MangoHud
package package
cp bin/mangohud-setup.sh build/MangoHud/mangohud-setup.sh cp --preserve=mode bin/mangohud-setup.sh build/MangoHud/mangohud-setup.sh
cp build/MangoHud-package.tar build/MangoHud/MangoHud-package.tar cp build/MangoHud-package.tar build/MangoHud/MangoHud-package.tar
cd build/ tar --numeric-owner --owner=0 --group=0 \
tar -czvf MangoHud-$VERSION.tar.gz MangoHud -C build -czvf build/MangoHud-$VERSION.tar.gz MangoHud
cd ..
} }
install() { install() {
package if [[ ! -f build/MangoHud-package.tar ]]; then
[ "$UID" -eq 0 ] || exec sudo bash "$0" "$@" echo No package found. Run \"$0 package\".
tar -C / -xf build/MangoHud*.tar exit 1
fi
[ "$UID" -eq 0 ] || exec sudo bash "$0" install
tar -C / -xvf build/MangoHud-package.tar
ldconfig ldconfig
echo "MangoHud Installed" echo "MangoHud Installed"
} }
@ -173,7 +176,7 @@ clean() {
} }
uninstall() { uninstall() {
[ "$UID" -eq 0 ] || exec sudo bash "$0" "$@" [ "$UID" -eq 0 ] || exec sudo bash "$0" uninstall
rm -rfv "/usr/lib/MangoHud" rm -rfv "/usr/lib/MangoHud"
rm -fv "/usr/share/vulkan/implicit_layer.d/mangohud.json" rm -fv "/usr/share/vulkan/implicit_layer.d/mangohud.json"
rm -fv "/etc/ld.so.conf.d/libmangohud.conf" rm -fv "/etc/ld.so.conf.d/libmangohud.conf"

@ -96,4 +96,4 @@ install_data(
install_dir : get_option('bindir'), install_dir : get_option('bindir'),
install_mode: 'rwxr-xr-x', install_mode: 'rwxr-xr-x',
rename : ['mangohud'] rename : ['mangohud']
) )

Loading…
Cancel
Save