Commit e75c7ae7 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm play sublime: rewrite via epm pack

parent 885d63e3
#!/bin/sh
TAR="$1"
RETURNTARNAME="$2"
#VERSION="$3"
. $(dirname $0)/common.sh
PRODUCT=sublime-text
PKGNAME="$(basename "$TAR" | sed -e "s|sublime_text_build_|$PRODUCT-|" -e 's|_.*||' )"
mkdir opt/
erc $TAR
mv -v sublime* opt/$PRODUCT
erc a $PKGNAME.tar opt
return_tar $PKGNAME.tar
......@@ -4,6 +4,7 @@ PKGNAME=sublime-text
SUPPORTEDARCHES="x86_64 aarch64"
VERSION="$2"
DESCRIPTION='Sublime Text 4 from the official site'
URL="https://www.sublimetext.com/"
. $(dirname $0)/common.sh
......@@ -23,12 +24,7 @@ esac
PKGURL=$(epm tool eget --list --latest https://www.sublimetext.com/download_thanks "sublime_text_build_${VERSION}_$arch.tar.xz") || fatal "Can't get package URL"
[ -n "$PKGURL" ] || fatal "Can't get package URL"
PKGFILE=$(echo /tmp/$(basename $PKGURL) | sed -e "s|/sublime_text_build_|/$PKGNAME-|")
epm tool eget -O $PKGFILE $PKGURL || exit
epm install --repack "$PKGFILE" || exit
rm -fv $PKGFILE
epm pack $PKGNAME "$PKGURL" || exit
echo
echo "NOTE: Sublime Text 4 is a proprietary software. We recommend to use open source editors: Codium, VS Code, Atom."
......@@ -15,57 +15,16 @@ subst "s|^URL:.*|URL: https://www.sublimetext.com|" $SPEC
subst "s|^Summary:.*|Summary: Sophisticated text editor for code, html and prose|" $SPEC
subst "s|^License: unknown$|License: Proprietary|" $SPEC
filter_from_requires "python3(sublime_api)"
# move package to /opt
ROOTDIR=sublime_text
mkdir -p $BUILDROOT/opt
mv $BUILDROOT/$ROOTDIR $BUILDROOT$PRODUCTDIR
subst "s|\"/$ROOTDIR/|\"$PRODUCTDIR/|" $SPEC
#filter_from_requires "python3(sublime_api)"
for res in 128x128 16x16 256x256 32x32 48x48; do
install -dm755 "$BUILDROOT/usr/share/icons/hicolor/${res}/apps"
cp $BUILDROOT$PRODUCTDIR/Icon/${res}/sublime-text.png $BUILDROOT/usr/share/icons/hicolor/${res}/apps/sublime-text.png
pack_file /usr/share/icons/hicolor/${res}/apps/sublime-text.png
install_file .$PRODUCTDIR/Icon/${res}/sublime-text.png /usr/share/icons/hicolor/${res}/apps/sublime-text.png
done
# add binary to the search path
mkdir -p $BUILDROOT/usr/bin/
ln -s $PRODUCTDIR/sublime_text $BUILDROOT/usr/bin/$PRODUCT
subst "s|%files|%files\n/usr/bin/$PRODUCT|" $SPEC
ln -s $PRODUCTDIR/sublime_text $BUILDROOT/usr/bin/$PRODUCTCUR
subst "s|%files|%files\n/usr/bin/$PRODUCTCUR|" $SPEC
# create desktop file
mkdir -p $BUILDROOT/usr/share/applications/
cat <<EOF >$BUILDROOT/usr/share/applications/$PRODUCT.desktop
[Desktop Entry]
Version=1.0
Type=Application
Name=Sublime Text
GenericName=Text Editor
Comment=Sophisticated text editor for code, markup and prose
Exec=subl %F
Terminal=false
MimeType=text/plain;
Icon=sublime-text
Categories=TextEditor;Development;
StartupNotify=true
StartupWMClass=subl
Actions=Window;Document;
[Desktop Action Window]
Name=New Window
Exec=subl -n
OnlyShowIn=Unity;
add_bin_link_command $PRODUCT $PRODUCTDIR/sublime_text
add_bin_link_command $PRODUCTCUR $PRODUCT
[Desktop Action Document]
Name=New File
Exec=subl --command new_file
OnlyShowIn=Unity;
EOF
subst "s|%files|%files\n/usr/share/applications/$PRODUCT.desktop|" $SPEC
install_file .$PRODUCTDIR/sublime_text.desktop /usr/share/applications/$PRODUCT.desktop
fix_desktop_file /opt/sublime_text/sublime_text $PRODUCT
add_libs_requires
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