Commit d4ed1c16 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm play: rewrite geobra install

parent 8026f6e1
#!/bin/sh
# TODO: common place
fatal()
{
echo "FATAL: $*" >&2
exit 1
}
PKGNAME=geogebra-classic
DESCRIPTION="Geogebra 6 from the official site"
. $(dirname $0)/common.sh
arch=$($DISTRVENDOR --distro-arch)
case $arch in
x86_64|amd64)
arch=$arch ;;
i686|i586|i386)
arch=i386 ;;
*)
fatal "Unsupported arch $arch for $($DISTRVENDOR -d)"
esac
pkgtype="$($DISTRVENDOR -p)"
repack=''
[ "$($DISTRVENDOR -d)" = "ALTLinux" ] && repack='--repack'
case $pkgtype in
deb)
epm install "http://www.geogebra.net/linux/pool/main/g/geogebra-classic/(epm print constructname $PKGNAME "*")"
;;
rpm)
epm $repack install "http://www.geogebra.net/linux/rpm/$arch/$(epm print constructname $PKGNAME "*")"
;;
*)
fatal "Unsupported $pkgtype"
;;
esac
PKGNAME=geogebra
if [ "$1" = "--remove" ] ; then
epm remove $PKGNAME
exit
fi
[ "$1" != "--run" ] && echo "Geogebra 6 from the official site" && exit
[ "$($DISTRVENDOR -a)" != "x86_64" ] && echo "Only x86_64 is supported" && exit 1
# See also
arch=x86_64
pkgtype=rpm
pkgver="6.0.666.0"
pkgrel="202109211234"
epm install "http://www.geogebra.net/linux/rpm/x86_64/$PKGNAME-classic-$pkgver-$pkgrel.$arch.$pkgtype"
echo
echo '
Setting SUID bit on /usr/share/geogebra-classic/chrome-sandbox to allow this crap to work...
'
chmod 4755 /usr/share/geogebra-classic/chrome-sandbox
echo
echo '
Geogebra 6 successfully installed.
'
......@@ -113,6 +113,16 @@ add_bin_commands()
fi
}
move_to_opt()
{
local from=/usr/share/$PRODUCT
mkdir -p $BUILDROOT$PRODUCTDIR/
mv $BUILDROOT/$from/* $BUILDROOT$PRODUCTDIR/
subst "s|$from|$PRODUCTDIR|g" $SPEC
}
fix_chrome_sandbox()
{
local sandbox="$1"
......
#!/bin/sh -x
# It will run with two args: buildroot spec
BUILDROOT="$1"
SPEC="$2"
PRODUCT=geogebra-classic
PRODUCTDIR=/opt/$PRODUCT
. $(dirname $0)/common-chromium-browser.sh
subst '1iAutoReq:yes,noshell,nomonolib,nomono,nopython' $SPEC
subst '1iBuildRequires:rpm-build-python3' $SPEC
subst "1i%add_python3_path $PRODUCTDIR" $SPEC
move_to_opt
subst "s|/usr/share/$PRODUCT|$PRODUCTDIR|" $BUILDROOT/usr/bin/$PRODUCT
cleanup
fix_chrome_sandbox
epm install --skip-installed python3 rpm-build-python3
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