net-im/tencent-qq: bump version to 3.2.15_p241224
[gentoo-zh.git] / app-office / freeoffice / freeoffice-1064.ebuild
blobb3f69d10d94a415a976ba7c8a014797db8a93a4a
1 # Copyright 1999-2022 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
6 inherit desktop pax-utils xdg
8 DESCRIPTION="A complete, free Microsoft Office-compatible alternative office suite."
9 HOMEPAGE="https://www.freeoffice.com"
10 BASE_URI="https://www.softmaker.net/down/softmaker-freeoffice-2021-${PV}"
11 SRC_URI="${BASE_URI}-amd64.tgz"
13 LICENSE="SoftMaker"
14 SLOT="0"
15 KEYWORDS="~amd64"
16 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"
17 for lang in ${LANGUAGES}; do
18 IUSE+="l10n_${lang%:*} "
19 done
21 RESTRICT="mirror strip"
23 DEPEND="
24 app-admin/chrpath
25 app-arch/xz-utils"
26 RDEPEND="
27 ${DEPEND}
28 media-libs/mesa
29 net-misc/curl
30 x11-libs/libXrandr
31 dev-util/desktop-file-utils
32 dev-util/gtk-update-icon-cache
33 media-libs/libglvnd
34 x11-misc/xdg-utils"
36 QA_PRESTRIPPED="*"
37 QA_PREBUILT="*"
38 QA_FLAGS_IGNORED="*"
40 S="${WORKDIR}"
42 font_clean(){
43 for lang in ${LANGUAGES}; do
44 use l10n_${lang%:*} && continue
45 declare suf
46 case ${lang%:*} in
47 zh-CN)
48 suf="sc";;
49 ko)
50 suf="kr";;
51 ja)
52 suf="jp";;
53 esac
54 rm fonts/NotoSansCJK${suf}-Regular.otf
55 done
58 free_clean(){
59 for lang in ${LANGUAGES}; do
60 use l10n_${lang%:*} && continue
61 declare fix
62 case ${lang%:*} in
63 de)
64 fix="de";;
65 esac
66 rm *free_${fix}.pdf
67 done
70 lang_clean(){
71 for lang in ${LANGUAGES}; do
72 use l10n_${lang%:*} && continue
73 declare suffix
74 case ${lang%:*} in
75 da)
76 suffix="dk";;
77 el)
78 suffix="gr";;
79 en-US)
80 suffix="us";;
81 en-GB)
82 suffix="uk";;
83 et)
84 suffix="ee";;
85 ja)
86 suffix="jp";;
87 kk)
88 suffix="kz";;
89 ko)
90 suffix="kr";;
91 pt-BR)
92 suffix="pb";;
93 sl)
94 suffix="si";;
95 sv)
96 suffix="se";;
97 uk)
98 suffix="ua";;
100 suffix="${lang%:*}";;
101 esac
102 rm *_${suffix}.dwr
103 done
107 doc_clean(){
108 for lang in ${LANGUAGES}; do
109 use l10n_${lang%:*} && continue
110 declare doc
111 case ${lang%:*} in
113 doc="dk";;
115 doc="gr";;
116 en-US)
117 doc="us";;
118 en-GB)
119 doc="uk";;
121 doc="ee";;
123 doc="jp";;
125 doc="kz";;
127 doc="kr";;
128 pt-BR)
129 doc="pb";;
131 doc="si";;
133 doc="se";;
135 doc="ua";;
137 doc="${lang%:*}";;
138 esac
139 rm inst/*_${doc}.zip
140 done
144 src_unpack() {
148 src_install(){
149 mkdir -p "${ED}/usr/lib64/${PN}"
150 cd "${ED}/usr/lib64/${PN}"
152 unpack ${A}
153 xz -d "freeoffice2021.tar.lzma" || die
154 tar x -f "freeoffice2021.tar" \
155 && rm "freeoffice2021.tar" || die
156 rm "installfreeoffice"
158 chrpath --delete "textmaker"
159 chrpath --delete "planmaker"
160 chrpath --delete "presentations"
162 font_clean
163 lang_clean
164 free_clean
165 doc_clean
167 for m in "${FILESDIR}"/*.desktop; do
168 domenu "${m}"
169 done
171 for size in 16 24 32 48 64 128 256 512; do
172 newicon -s ${size} icons/pml_${size}.png ${PN}-planmaker.png
173 newicon -s ${size} icons/prl_${size}.png ${PN}-presentations.png
174 newicon -s ${size} icons/tml_${size}.png ${PN}-textmaker.png
175 done
177 insinto /usr/share/mime/packages
178 doins mime/softmaker-freeoffice21.xml
180 pax-mark -m "${ED}"/usr/lib64/${PN}/planmaker
181 pax-mark -m "${ED}"/usr/lib64/${PN}/presentations
182 pax-mark -m "${ED}"/usr/lib64/${PN}/textmaker
185 pkg_postinst(){
186 einfo
187 elog "In order to use Softmaker Freeoffice, you need a serial number."
188 elog "To obtain a valid free serial number, please visit"
189 elog "https://www.freeoffice.com/en/download"
190 einfo
191 xdg_pkg_postinst