Commit 26070bd7 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm repack: add install_file, fix_desktop_file and use it

parent f7edd377
......@@ -19,7 +19,5 @@ subst '1iRequires:/bin/sh' $SPEC
add_bin_link_command $PRODUCT $PRODUCTDIR/aimp.bash
subst "s|/usr/bin/sh|/bin/sh|" $BUILDROOT$PRODUCTDIR/aimp.bash
mkdir -p $BUILDROOT/usr/share/applications/
cp $BUILDROOT/opt/aimp/aimp.desktop $BUILDROOT/usr/share/applications/aimp.desktop
pack_file /usr/share/applications/aimp.desktop
install_file /opt/aimp/aimp.desktop /usr/share/applications/aimp.desktop
#!/bin/sh
fatal()
{
echo "FATAL: $*" >&2
exit 1
}
# compatibility layer
# add realpath if missed
if ! which realpath 2>/dev/null >/dev/null ; then
......@@ -100,6 +106,14 @@ pack_dir()
subst "s|%files|%files\n%dir $file|" $SPEC
}
install_file()
{
local src="$1"
local dest="$2"
mkdir -p "$BUILDROOT/$(dirname "$dest")" || return
cp "$BUILDROOT/$src" "$BUILDROOT/$dest"
pack_file "$dest"
}
add_bin_link_command()
{
......@@ -167,6 +181,16 @@ move_to_opt()
subst "s|$rdir|$PRODUCTDIR|g" $SPEC
}
# remove absolute path from desktop file
fix_desktop_file()
{
local from="$1"
local to="$2"
[ -n "$from" ] || from="$PRODUCTDIR/$PRODUCT"
[ -n "$to" ] || to="$(basename "$from")"
subst "s|$from|$to|" $BUILDROOT/usr/share/applications/*.desktop
}
fix_chrome_sandbox()
{
local sandbox="$1"
......
......@@ -23,9 +23,7 @@ cd $BUILDROOT$PRODUCTDIR/
chmod -R a+rX .
mkdir -p $BUILDROOT/usr/share/pixmaps/
cp icon.png $BUILDROOT/usr/share/pixmaps/$ICONFILE
pack_file /usr/share/pixmaps/$ICONFILE
install_file $PRODUCTDIR/icon.png /usr/share/pixmaps/$ICONFILE
epm assure patchelf || exit
for i in IWB_Driver libQt*.so.* ; do
......
......@@ -11,7 +11,7 @@ subst '1iAutoReq:yes,noshell,nomonolib,nomono,nopython' $SPEC
subst '1iAutoProv:no' $SPEC
move_to_opt
subst "s|/usr/share/$PRODUCT/$PRODUCT|$PRODUCT|" $BUILDROOT/usr/share/applications/start-$PRODUCT.desktop
fix_desktop_file "/usr/share/$PRODUCT/$PRODUCT"
rm -f $BUILDROOT/usr/bin/librewolf
add_bin_link_command
......
......@@ -52,9 +52,7 @@ subst "s|^Categories.*|Categories=GNOME;GTK;Network;RemoteAccess;|" $BUILDROOT/u
subst "s|/usr/share/rustdesk/files/rustdesk.png|$PRODUCT|" $BUILDROOT/usr/share/applications/$PRODUCT.desktop
ICONFILE=$PRODUCT.png
mkdir -p $BUILDROOT/usr/share/pixmaps/
cp $BUILDROOT/usr/share/rustdesk/files/rustdesk.png $BUILDROOT/usr/share/pixmaps/$ICONFILE
pack_file /usr/share/pixmaps/$ICONFILE
install_file /usr/share/rustdesk/files/rustdesk.png /usr/share/pixmaps/$ICONFILE
#move_to_opt /usr/lib/rustdesk
add_bin_link_command
......
......@@ -14,7 +14,7 @@ add_bin_link_command $PRODUCTCUR $PRODUCT
subst '1i%filter_from_requires /^libtiff.so.5(LIBTIFF_.*/d' $SPEC
subst "s|$PRODUCTDIR/$PRODUCT|$PRODUCTCUR|" $BUILDROOT/usr/share/applications/viber.desktop
fix_desktop_file
epm install --skip-installed glib2 gst-plugins-bad1.0 libalsa libbrotlidec libcups libdbus libdrm libEGL libexpat libfreetype libGL libGLX libgomp1 libgst-plugins1.0 libgstreamer1.0 libharfbuzz libICE libkrb5 liblcms2 libmng libmtdev libnspr libnss libOpenGL libopus libSM libsnappy libtiff5 libts0 libudev1 libwayland-client libwayland-cursor libwayland-egl libwayland-server libwebp7 libX11 libxcb libxcb-render-util libxcbutil-icccm libxcbutil-image libxcbutil-keysyms libXext libXfixes libxkbcommon libxkbcommon-x11 libxkbfile libxml2 libXrandr libXScrnSaver libxshmfence libxslt libXtst libzstd zlib
# libfontconfig1
......
......@@ -11,6 +11,6 @@ PRODUCTDIR=/opt/VinteoDesktop
add_bin_link_command
subst 's|/opt/VinteoDesktop/||' $BUILDROOT/usr/share/applications/vinteo.desktop.desktop
fix_desktop_file
fix_chrome_sandbox
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment