Skip to content

Commit

Permalink
Fix installing DEB package when lib64 is a symlink to lib (fixes #414)
Browse files Browse the repository at this point in the history
  • Loading branch information
filips123 committed Nov 11, 2023
1 parent 29789db commit 6bcfb24
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
3 changes: 1 addition & 2 deletions native/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,8 @@ assets = [
["target/release/firefoxpwa", "/usr/bin/firefoxpwa", "755"],
["target/release/firefoxpwa-connector", "/usr/libexec/firefoxpwa-connector", "755"],

# Manifests
# Manifest
["manifests/linux.json", "/usr/lib/mozilla/native-messaging-hosts/firefoxpwa.json", "644"],
["manifests/linux.json", "/usr/lib64/mozilla/native-messaging-hosts/firefoxpwa.json", "644"],

# Completions
["target/release/completions/firefoxpwa.bash", "/usr/share/bash-completion/completions/firefoxpwa", "644"],
Expand Down
6 changes: 6 additions & 0 deletions native/packages/deb/postinst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#!/bin/sh
set -e

# Duplicate the manifest file over lib and lib64 directories
# Needed because otherwise the manifest may not be detected on some platforms
# Needed here because packaging it normally breaks when lib64 is a symlink to lib
mkdir -p /usr/lib64/mozilla/native-messaging-hosts || true
cp -f /usr/lib/mozilla/native-messaging-hosts/firefoxpwa.json /usr/lib64/mozilla/native-messaging-hosts/firefoxpwa.json || true

# Make shell completions executable
# We cannot do this in Cargo.toml because of cargo-deb bug
# See: https://github.com/mmstick/cargo-deb/issues/67
Expand Down
7 changes: 7 additions & 0 deletions native/packages/deb/postrm
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
#!/bin/sh
set -e

# Remove the duplicated manifest files
if [ "$1" = "remove" ]
then
rm /usr/lib/mozilla/native-messaging-hosts/firefoxpwa.json || true
rm /usr/lib64/mozilla/native-messaging-hosts/firefoxpwa.json || true
fi

# Add warning that runtime, profiles and web apps are still installed
if [ "$1" = "remove" ]
then
Expand Down

0 comments on commit 6bcfb24

Please sign in to comment.