Skip to content

Commit

Permalink
app-office/freeoffice: add 1068
Browse files Browse the repository at this point in the history
  • Loading branch information
liangyongxiang committed Nov 11, 2023
1 parent 19c0236 commit 41303bb
Show file tree
Hide file tree
Showing 2 changed files with 193 additions and 0 deletions.
1 change: 1 addition & 0 deletions app-office/freeoffice/Manifest
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
DIST softmaker-freeoffice-2021-1062-amd64.tgz 130160899 BLAKE2B e8e1d4491909fccdda780fb3d2ef3ec3333bd91db1b41c7b783bcb55414af078415f6d4365f3c27bb5c2598672e52fbc95f9b52271e9b48a97a6337197e6cf6f SHA512 83bb9a895916a9459443b2da0e221e9b4628e60339ee7ac4fad08d761456bdbcb9888902f5c635dde3f934dfaa8811dad5e78f2039b726571d3cd00ae48f724c
DIST softmaker-freeoffice-2021-1064-amd64.tgz 130167508 BLAKE2B 8ea095a351558feee88e9ed3cafdfe0468cb0a87a28c0836d0a5ee6ef69b7c97945b7b8423342dcbe545f429da16b39c1e4671846f7e5b166457b7e7760b81cc SHA512 b8583710a0d4ea9c6a969c729d0394642b7e855bd07da0e36599e24d9e75c1578e055e39d66eb672e9d4f2493f97310d149b809c2e623c84a042caa07e59fbc1
DIST softmaker-freeoffice-2021-1068-amd64.tgz 130164325 BLAKE2B 56ea5939f316aedc79ec53f520ac6c13ae6176ad04cc697b2af4ca343a94497923dd4a6e6a09e1249a632e5e07ec1471bf320dacd92832ba490b7aed8e6ebd2f SHA512 7321d725d496d716b72e7813117d46e32d467c2659512fef8af072afda99ff7d6404107d04750630abcb3870fe8cf70d9c5dc9e191b2c4101492e53060abe27d
192 changes: 192 additions & 0 deletions app-office/freeoffice/freeoffice-1068.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit desktop pax-utils xdg

DESCRIPTION="A complete, free Microsoft Office-compatible alternative office suite."
HOMEPAGE="https://www.freeoffice.com"
BASE_URI="https://www.softmaker.net/down/softmaker-freeoffice-2021-${PV}"
SRC_URI="${BASE_URI}-amd64.tgz"

LICENSE="SoftMaker"
SLOT="0"
KEYWORDS="~amd64"
LANGUAGES="ar bg da de el en-GB en-US es et fi fr hu id it ja kk ko lt lv nl pl pt pt-BR ro ru sl sv tr uk zh"
for lang in ${LANGUAGES}; do
IUSE+="l10n_${lang%:*} "
done

RESTRICT="mirror strip"

DEPEND="
app-admin/chrpath
app-arch/xz-utils"
RDEPEND="
${DEPEND}
media-libs/mesa
net-misc/curl
x11-libs/libXrandr
dev-util/desktop-file-utils
dev-util/gtk-update-icon-cache
media-libs/libglvnd
x11-misc/xdg-utils"

QA_PRESTRIPPED="*"
QA_PREBUILT="*"
QA_FLAGS_IGNORED="*"

S="${WORKDIR}"

font_clean(){
for lang in ${LANGUAGES}; do
use l10n_${lang%:*} && continue
declare suf
case ${lang%:*} in
zh-CN)
suf="sc";;
ko)
suf="kr";;
ja)
suf="jp";;
esac
rm fonts/NotoSansCJK${suf}-Regular.otf
done
}

free_clean(){
for lang in ${LANGUAGES}; do
use l10n_${lang%:*} && continue
declare fix
case ${lang%:*} in
de)
fix="de";;
esac
rm *free_${fix}.pdf
done
}

lang_clean(){
for lang in ${LANGUAGES}; do
use l10n_${lang%:*} && continue
declare suffix
case ${lang%:*} in
da)
suffix="dk";;
el)
suffix="gr";;
en-US)
suffix="us";;
en-GB)
suffix="uk";;
et)
suffix="ee";;
ja)
suffix="jp";;
kk)
suffix="kz";;
ko)
suffix="kr";;
pt-BR)
suffix="pb";;
sl)
suffix="si";;
sv)
suffix="se";;
uk)
suffix="ua";;
*)
suffix="${lang%:*}";;
esac
rm *_${suffix}.dwr
done

}

doc_clean(){
for lang in ${LANGUAGES}; do
use l10n_${lang%:*} && continue
declare doc
case ${lang%:*} in
da)
doc="dk";;
el)
doc="gr";;
en-US)
doc="us";;
en-GB)
doc="uk";;
et)
doc="ee";;
ja)
doc="jp";;
kk)
doc="kz";;
ko)
doc="kr";;
pt-BR)
doc="pb";;
sl)
doc="si";;
sv)
doc="se";;
uk)
doc="ua";;
*)
doc="${lang%:*}";;
esac
rm inst/*_${doc}.zip
done

}

src_unpack() {
:
}

src_install(){
mkdir -p "${ED}/usr/lib64/${PN}"
cd "${ED}/usr/lib64/${PN}"

unpack ${A}
xz -d "freeoffice2021.tar.lzma" || die
tar x -f "freeoffice2021.tar" \
&& rm "freeoffice2021.tar" || die
rm "installfreeoffice"

chrpath --delete "textmaker"
chrpath --delete "planmaker"
chrpath --delete "presentations"

font_clean
lang_clean
free_clean
doc_clean

for m in "${FILESDIR}"/*.desktop; do
domenu "${m}"
done

for size in 16 24 32 48 64 128 256 512; do
newicon -s ${size} icons/pml_${size}.png ${PN}-planmaker.png
newicon -s ${size} icons/prl_${size}.png ${PN}-presentations.png
newicon -s ${size} icons/tml_${size}.png ${PN}-textmaker.png
done

insinto /usr/share/mime/packages
doins mime/softmaker-freeoffice21.xml

pax-mark -m "${ED}"/usr/lib64/${PN}/planmaker
pax-mark -m "${ED}"/usr/lib64/${PN}/presentations
pax-mark -m "${ED}"/usr/lib64/${PN}/textmaker
}

pkg_postinst(){
einfo
elog "In order to use Softmaker Freeoffice, you need a serial number."
elog "To obtain a valid free serial number, please visit"
elog "https://www.freeoffice.com/en/download"
einfo
xdg_pkg_postinst
}

0 comments on commit 41303bb

Please sign in to comment.