Skip to content

Commit

Permalink
Add missing libudev.so.0 fix to deb/rpm postinst
Browse files Browse the repository at this point in the history
  • Loading branch information
bastimeyer committed Oct 14, 2016
1 parent f9bf359 commit b621ece
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 6 deletions.
26 changes: 23 additions & 3 deletions build/resources/package/deb/postinst
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
#!/bin/bash
set -e

ln -sf "<%= prefix %>/<%= exec %>" "/usr/bin/<%= exec %>"
sed -i "s/CHECKNEWVERSIONS=true/CHECKNEWVERSIONS=false/g" "<%= prefix %>/start.sh"
"<%= prefix %>/add-menuitem.sh"
HERE="<%= prefix %>"
EXEC="<%= exec %>"

ln -sf "${HERE}/${EXEC}" "/usr/bin/${EXEC}"
sed -i "s/CHECKNEWVERSIONS=true/CHECKNEWVERSIONS=false/g" "${HERE}/start.sh"
"${HERE}/add-menuitem.sh"


if ldd "${HERE}/${EXEC}" 2>&1 >/dev/null | grep "libudev.so.0 => not found"; then
if [ ! -e "${HERE}/libudev.so.0" ]; then
libpaths=(
"/lib/x86_64-linux-gnu"
"/lib/i386-linux-gnu"
)
for libpath in "${libpaths[@]}"; do
libpath="${libpath}/libudev.so.1"
if [ -f "${libpath}" ]; then
ln -sf "${libpath}" "${HERE}/libudev.so.0"
break
fi
done
fi
fi
26 changes: 23 additions & 3 deletions build/resources/package/rpm/postinst
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
ln -sf "<%= prefix %>/<%= exec %>" "/usr/bin/<%= exec %>"
sed -i "s/CHECKNEWVERSIONS=true/CHECKNEWVERSIONS=false/g" "<%= prefix %>/start.sh"
"<%= prefix %>/add-menuitem.sh"
HERE="<%= prefix %>"
EXEC="<%= exec %>"

ln -sf "${HERE}/${EXEC}" "/usr/bin/${EXEC}"
sed -i "s/CHECKNEWVERSIONS=true/CHECKNEWVERSIONS=false/g" "${HERE}/start.sh"
"${HERE}/add-menuitem.sh"


if ldd "${HERE}/${EXEC}" 2>&1 >/dev/null | grep "libudev.so.0 => not found"; then
if [ ! -e "${HERE}/libudev.so.0" ]; then
libpaths=(
"/usr/lib64"
"/usr/lib"
)
for libpath in "${libpaths[@]}"; do
libpath="${libpath}/libudev.so.1"
if [ -f "${libpath}" ]; then
ln -sf "${libpath}" "${HERE}/libudev.so.0"
break
fi
done
fi
fi
4 changes: 4 additions & 0 deletions build/tasks/configs/fpm.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ module.exports = {

depends: [
"livestreamer (>= 1.12.2)",
"libc-bin",
"xdg-utils",
"x11-utils"
],
Expand Down Expand Up @@ -78,6 +79,7 @@ module.exports = {

depends: [
"livestreamer (>= 1.12.2)",
"libc-bin",
"xdg-utils",
"x11-utils"
],
Expand Down Expand Up @@ -118,6 +120,7 @@ module.exports = {

depends: [
"livestreamer >= 1.12.2",
"glibc-common",
"xdg-utils",
"xorg-x11-utils"
],
Expand Down Expand Up @@ -149,6 +152,7 @@ module.exports = {

depends: [
"livestreamer >= 1.12.2",
"glibc-common",
"xdg-utils",
"xorg-x11-utils"
],
Expand Down

0 comments on commit b621ece

Please sign in to comment.