Skip to content

Commit

Permalink
Satisfy FHS in generic packaging
Browse files Browse the repository at this point in the history
Co-authored-by: hwsmm <hwsnemo@gmail.com>
  • Loading branch information
X9VoiD and hwsmm committed Jun 20, 2023
1 parent 6191aa2 commit 206b7af
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions eng/linux/BinaryTarBall/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,29 @@ PKG_FILE="${OTD_LNAME}-${OTD_VERSION}-x64.tar.gz"

output="${1}"

move_to_nested "${output}" "${output}/lib/opentabletdriver"
move_to_nested "${output}" "${output}/usr/local/lib/opentabletdriver"

echo "Copying generic files..."
cp -R "${GENERIC_FILES}"/* "${output}/"
mv "${output}/usr/lib"/* "${output}/usr/local/lib"
mkdir -p "${output}/etc/"
mv "${output}/usr/lib"/* "${output}/etc/"
mv "${output}/usr/local/lib/systemd" "${output}/etc"

echo "Patching wrapper scripts to point to '/lib/opentabletdriver'..."
mkdir -p "${output}/bin"
echo "Patching wrapper scripts to point to '/usr/local/lib/opentabletdriver'..."
mkdir -p "${output}/usr/local/bin"
for exe in "${output}/usr/bin"/*; do
sed -i "s|#!/usr/bin/env sh|#!/bin/sh|" "${exe}"
sed -i "s|/usr/lib|/lib|" "${exe}"
mv "${exe}" "${output}/bin/${exe##*/}"
sed -i "s|/usr/lib|/usr/local/lib|" "${exe}"
mv "${exe}" "${output}/usr/local/bin/${exe##*/}"
done

echo "Removing unused directories..."
rmdir "${output}/usr/bin"
rmdir "${output}/usr/lib"
rmdir "${output}/usr"

generate_rules "${output}/etc/udev/rules.d/99-opentabletdriver.rules"
generate_desktop_file "${output}/share/applications/opentabletdriver.desktop"
sed -i "s|/usr/share|/share|" "${output}/share/applications/opentabletdriver.desktop"
copy_pixmap_assets "${output}/share/pixmaps"
generate_desktop_file "${output}/usr/local/share/applications/opentabletdriver.desktop"
sed -i "s|/usr/share|/usr/local/share|" "${output}/usr/local/share/applications/opentabletdriver.desktop"
copy_pixmap_assets "${output}/usr/local/share/pixmaps"

echo "Creating binary tarball '${output}/${PKG_FILE}'..."

Expand Down

0 comments on commit 206b7af

Please sign in to comment.