megacoffee.net Gentoo overlay - legacy mirror
We have moved to Git. This repository is only provided for compatibility with old installations. Learn how to migrate your installation here.
comparison app-office/softmaker-office/softmaker-office-2021.1064.ebuild @ 254:f8f6e50d5c79
[sync] imported e4e9400..5fd794d from upstream
commit 5fd794d1280cc60ce24c73cb6ca552274d628f8a
Author: Daniel Neugebauer <dneuge@energiequant.de>
Date: Sun Jun 4 23:49:41 2023 +0200
app-office/softmaker-office: version bump 2021.1064
commit a9f78aa008575f6d894a735d0992b1d897751509
Author: Daniel Neugebauer <dneuge@energiequant.de>
Date: Sun Jun 4 23:47:16 2023 +0200
app-office/softmaker-office: fixed typo
commit 31d0d432a5cc3c0a5e62cb5274d163f81f96d5c5
Author: Daniel Neugebauer <dneuge@energiequant.de>
Date: Sun Jun 4 23:29:34 2023 +0200
app-office/softmaker-office: fix MIME installation
author | Migration Sync <gentoo-overlay@megacoffee.net> |
---|---|
date | Sun, 04 Jun 2023 22:00:02 +0000 |
parents | |
children | 3c90d8644fec |
comparison
equal
deleted
inserted
replaced
253:c328bdc3e047 | 254:f8f6e50d5c79 |
---|---|
1 # Copyright 1999-2023 Gentoo Foundation | |
2 # Distributed under the terms of the GNU General Public License v2 | |
3 | |
4 EAPI=8 | |
5 | |
6 inherit desktop xdg-utils | |
7 | |
8 DESCRIPTION="SoftMaker Office - an office suite featuring a word processor (TextMaker), spreadsheets (PlanMaker) and slides software (Presentations)" | |
9 HOMEPAGE="https://www.softmaker.com/en/softmaker-office" | |
10 | |
11 SRC_URI="https://www.softmaker.net/down/softmaker-office-${PV//\./-}-amd64.tgz" | |
12 | |
13 LICENSE="SoftMakerOffice" | |
14 SLOT="0" | |
15 KEYWORDS="~amd64" | |
16 | |
17 # .deb dependencies as of 4 Jun 2023, version 2021-1064: | |
18 # | |
19 # DEBIAN GENTOO | |
20 # | |
21 # libcurl4 | libcurl3 (>= 7.16.2) => net-misc/curl | |
22 # libc6 (>= 2.17) => sys-libs/glibc | |
23 # libgcc1 (>= 1:4.2) => sys-devel/gcc | |
24 # libgl1-mesa-glx | libgl1 => virtual/opengl | |
25 # libstdc++6 (>= 5.2) => sys-devel/gcc | |
26 # libx11-6 => x11-libs/libX11 | |
27 # libxext6 => x11-libs/libXext | |
28 # libxmu6 => x11-libs/libXmu | |
29 # libxrandr2 (>= 2:1.2.99.3) => x11-libs/libXrandr | |
30 # libxrender1 => x11-libs/libXrender | |
31 | |
32 DEPEND=" | |
33 app-arch/tar | |
34 app-arch/xz-utils | |
35 " | |
36 RDEPEND="${DEPEND} | |
37 net-misc/curl | |
38 sys-libs/glibc | |
39 sys-devel/gcc | |
40 virtual/opengl | |
41 x11-libs/libX11 | |
42 x11-libs/libXext | |
43 x11-libs/libXmu | |
44 x11-libs/libXrandr | |
45 x11-libs/libXrender | |
46 " | |
47 | |
48 S="${WORKDIR}" | |
49 | |
50 INNER_ARCHIVE="office2021.tar.lzma" | |
51 EXTRACTED_INNER_ARCHIVE="${WORKDIR}/extracted" | |
52 | |
53 FINAL_INSTALL_DIR="/opt/softmaker-office" | |
54 INSTALL_DIR="${D}${FINAL_INSTALL_DIR}" | |
55 | |
56 # disable QA check for pre-stripped binaries | |
57 QA_PRESTRIPPED=" | |
58 ${FINAL_INSTALL_DIR}/dpf3/libgamorphDpf.so | |
59 ${FINAL_INSTALL_DIR}/dpf3/libsprt4-5-1.so | |
60 ${FINAL_INSTALL_DIR}/dpf3/libdpf.so.3 | |
61 ${FINAL_INSTALL_DIR}/dpf3/libsx.so | |
62 ${FINAL_INSTALL_DIR}/dpf3/libsprt4-5-1-instance-03.so | |
63 ${FINAL_INSTALL_DIR}/dpf3/libCTokenizer.so | |
64 ${FINAL_INSTALL_DIR}/dpf3/libSGAnalyseSP.so | |
65 ${FINAL_INSTALL_DIR}/dpf3/libsprt4-5-1-instance-01.so | |
66 ${FINAL_INSTALL_DIR}/dpf3/libDpfDict.so | |
67 ${FINAL_INSTALL_DIR}/dpf3/libsprt4-5-1-instance-02.so | |
68 ${FINAL_INSTALL_DIR}/dpf3/libCSegmentation.so | |
69 ${FINAL_INSTALL_DIR}/textmaker | |
70 ${FINAL_INSTALL_DIR}/presentations | |
71 ${FINAL_INSTALL_DIR}/planmaker | |
72 " | |
73 | |
74 # disable QA checks for upstream .desktop files | |
75 QA_DESKTOP_FILE=" | |
76 usr/share/applications/planmaker-2021.desktop | |
77 usr/share/applications/presentations-2021.desktop | |
78 usr/share/applications/textmaker-2021.desktop | |
79 " | |
80 | |
81 src_unpack() { | |
82 unpack ${A} || "Failed to unpack outer archive" | |
83 | |
84 mkdir ${EXTRACTED_INNER_ARCHIVE} | |
85 cd ${EXTRACTED_INNER_ARCHIVE} || die "Failed to switch to extraction directory" | |
86 | |
87 tar xJf ${WORKDIR}/${INNER_ARCHIVE} || die "Failed to extract ${INNER_ARCHIVE}" | |
88 } | |
89 | |
90 src_prepare() { | |
91 ## extract all lines defining functions from original install script so we can import it | |
92 # first make sure we actually have the expected revision | |
93 expected_hash="d9a7f0e21b15d226f203c3e74e42bdb3" | |
94 actual_hash=$(md5sum "${WORKDIR}/installsmoffice" | cut -c'-32') | |
95 [[ "${actual_hash}" == "${expected_hash}" ]] || die "Unexpected file hash on install script, unable to extract functions. Expected MD5 ${expected_hash}, got: ${actual_hash}" | |
96 | |
97 # extract | |
98 tail -n 1566 ${WORKDIR}/installsmoffice | head -n 1328 >${WORKDIR}/smoffice-install-functions.sh | |
99 | |
100 # mandatory since EAPI 6 | |
101 eapply_user | |
102 } | |
103 | |
104 src_compile() { | |
105 . ${WORKDIR}/smoffice-install-functions.sh | |
106 | |
107 # set variables needed by original install script | |
108 APPBINPATH="${WORKDIR}" # install script function will write there during installation | |
109 SRCPATH="${EXTRACTED_INNER_ARCHIVE}" # install script function will read from there during installation | |
110 APPPATH="${FINAL_INSTALL_DIR}" # generated script will run files from there after installation | |
111 | |
112 ## create_script | |
113 UNINSTALLSCRIPT="${APPBINPATH}/uninstall_smoffice2021" # irrelevant but function will generate that file nevertheless | |
114 REMOVEICONSSCRIPT="${APPBINPATH}/remove_icons.sh" # also irrelevant but needed | |
115 | |
116 # somehow the base file for the (irrelevant) uninstall script does not exist after unpacking, replace by dummy | |
117 echo '#dummy' >$SRCPATH/mime/uninst1 | |
118 | |
119 # run original create_script function | |
120 # arg 1 = version | |
121 # arg 2 = fixed to "1" by original install script | |
122 # arg 3 = empty to indicate global installation | |
123 (set -e; create_script 2021 "1" "") || die "Failed to run original create_script" | |
124 | |
125 ## create_desktop1 to create .desktop files | |
126 # run original create_desktop functions | |
127 # arg 1 = version | |
128 # arg 2 = "0" assumes /usr/bin for installation, "1" uses APPBINPATH which would be wrong for this ebuild | |
129 (set -e; create_desktop1 2021 "0") || die "Failed to run original create_desktop1" | |
130 | |
131 ## do not run create_desktop2 as it would install the files (this will be done separately by this ebuild) | |
132 } | |
133 | |
134 src_install() { | |
135 # all pre-built binaries should go into /opt and be symlinked to usr/bin etc. | |
136 | |
137 # copy everything from inner archive to /opt install dir | |
138 insinto ${FINAL_INSTALL_DIR} | |
139 doins -r ${EXTRACTED_INNER_ARCHIVE}/* | |
140 | |
141 # redo the executables (otherwise they miss permission) | |
142 exeinto ${FINAL_INSTALL_DIR} | |
143 doexe ${EXTRACTED_INNER_ARCHIVE}/planmaker | |
144 doexe ${EXTRACTED_INNER_ARCHIVE}/presentations | |
145 doexe ${EXTRACTED_INNER_ARCHIVE}/textmaker | |
146 | |
147 # install the original wrapper scripts to /usr/bin | |
148 dobin ${WORKDIR}/planmaker21 | |
149 dobin ${WORKDIR}/presentations21 | |
150 dobin ${WORKDIR}/textmaker21 | |
151 | |
152 # symlink .desktop entries | |
153 for app in planmaker presentations textmaker; do | |
154 dosym ${FINAL_INSTALL_DIR}/mime/${app}-2021.desktop /usr/share/applications/${app}-2021.desktop | |
155 done | |
156 | |
157 # MIME definition | |
158 # TODO: split to separate files? | |
159 # TODO: separate SoftMaker Office's own from generic definitions? (generic = MS Office etc.) | |
160 insinto /usr/share/mime/application/ | |
161 doins ${EXTRACTED_INNER_ARCHIVE}/mime/softmaker-office-2021.xml | |
162 | |
163 ## icons (see original copy_icons function) | |
164 # TODO: don't install what we don't need when separated | |
165 # 1024 is not supported by desktop eclass yet | |
166 | |
167 # app icons | |
168 for app in prl tml pml; do | |
169 for size in 16 24 32 48 64 128 256 512; do | |
170 newicon -s ${size} "${EXTRACTED_INNER_ARCHIVE}/icons/${app}_${size}.png" "application-x-${app}21.png" | |
171 done | |
172 done | |
173 | |
174 # MIME icons | |
175 for size in 16 24 32 48 64 128 256 512; do | |
176 ## text documents | |
177 # SoftOffice => tmd icon | |
178 for mime in application-x-tmd application-x-tmv; do | |
179 newicon -c mimetypes -s ${size} "${EXTRACTED_INNER_ARCHIVE}/icons/tmd_${size}.png" ${mime}.png | |
180 done | |
181 | |
182 # MS Office => tmd_mso icon | |
183 for mime in application-rtf text-rtf application-msword application-msword-template application-vnd.ms-word application-x-doc application-x-pocket-word application-vnd.openxmlformats-officedocument.wordprocessingml.document application-vnd.openxmlformats-officedocument.wordprocessingml.template application-vnd.ms-word.document.macroenabled.12 application-vnd.ms-word.template.macroenabled.12; do | |
184 newicon -c mimetypes -s ${size} "${EXTRACTED_INNER_ARCHIVE}/icons/tmd_mso_${size}.png" ${mime}.png | |
185 done | |
186 | |
187 # OpenDocument => tmd_oth icon | |
188 for mime in application-x-pocket-word application-vnd.oasis.opendocument.text text-rtf application-vnd.sun.xml.writer application-vnd.sun.xml.writer.template application-vnd.wordperfect application-vnd.oasis.opendocument.text-template application-vnd.oasis.opendocument.text application-vnd.sun.xml.writer application-vnd.sun.xml.writer.template application-x-dbf; do | |
189 newicon -c mimetypes -s ${size} "${EXTRACTED_INNER_ARCHIVE}/icons/tmd_oth_${size}.png" ${mime}.png | |
190 done | |
191 | |
192 ## spreadsheet documents | |
193 # SoftOffice? => pmd icon | |
194 for mime in application-x-pmd application-x-pmv application-x-pmdx application-x-pagemaker; do | |
195 newicon -c mimetypes -s ${size} "${EXTRACTED_INNER_ARCHIVE}/icons/pmd_${size}.png" ${mime}.png | |
196 done | |
197 | |
198 # MS Office => pmd_mso icon | |
199 for mime in application-x-sylk application-excel application-x-excel application-x-ms-excel application-x-msexcel application-x-xls application-xls application-vnd.ms-excel application-vnd.openxmlformats-officedocument.spreadsheetml.sheet application-vnd.openxmlformats-officedocument.spreadsheetml.template application-vnd.ms-excel.sheet.macroenabled.12 application-vnd.ms-excel.template.macroenabled.12 text-spreadsheet; do | |
200 newicon -c mimetypes -s ${size} "${EXTRACTED_INNER_ARCHIVE}/icons/pmd_mso_${size}.png" ${mime}.png | |
201 done | |
202 | |
203 # OpenDocument and generic? => pmd_oth icon | |
204 for mime in text-csv application-x-dif application-x-prn application-vnd.stardivision.calc; do | |
205 newicon -c mimetypes -s ${size} "${EXTRACTED_INNER_ARCHIVE}/icons/pmd_oth_${size}.png" ${mime}.png | |
206 done | |
207 | |
208 ## presentations | |
209 # SoftOffice => prd icon | |
210 for mime in application-x-prd application-x-prs application-x-prv; do | |
211 newicon -c mimetypes -s ${size} "${EXTRACTED_INNER_ARCHIVE}/icons/prd_${size}.png" ${mime}.png | |
212 done | |
213 | |
214 # MS Office => prd_mso icon | |
215 for mime in application-ppt application-mspowerpoint application-vnd.ms-powerpoint application-vnd.ms-powerpoint.presentation.macroenabled.12 application-vnd.ms-powerpoint.slideshow.macroEnabled.12 application-vnd.openxmlformats-officedocument.presentationml.presentation application-vnd.openxmlformats-officedocument.presentationml.template application-vnd.openxmlformats-officedocument.presentationml.slideshow; do | |
216 newicon -c mimetypes -s ${size} "${EXTRACTED_INNER_ARCHIVE}/icons/prd_mso_${size}.png" ${mime}.png | |
217 done | |
218 | |
219 ## trailing in original function | |
220 newicon -c mimetypes -s ${size} "${EXTRACTED_INNER_ARCHIVE}/icons/tmd_${size}.png" application-x-tmd.png | |
221 newicon -c mimetypes -s ${size} "${EXTRACTED_INNER_ARCHIVE}/icons/tmd_mso_${size}.png" application-x-tmd-mso.png | |
222 newicon -c mimetypes -s ${size} "${EXTRACTED_INNER_ARCHIVE}/icons/tmd_oth_${size}.png" application-x-tmd-oth.png | |
223 | |
224 newicon -c mimetypes -s ${size} "${EXTRACTED_INNER_ARCHIVE}/icons/pmd_${size}.png" application-x-pmd.png | |
225 newicon -c mimetypes -s ${size} "${EXTRACTED_INNER_ARCHIVE}/icons/pmd_mso_${size}.png" application-x-pmd-mso.png | |
226 newicon -c mimetypes -s ${size} "${EXTRACTED_INNER_ARCHIVE}/icons/pmd_oth_${size}.png" application-x-pmd-oth.png | |
227 | |
228 newicon -c mimetypes -s ${size} "${EXTRACTED_INNER_ARCHIVE}/icons/prd_${size}.png" application-x-prd.png | |
229 newicon -c mimetypes -s ${size} "${EXTRACTED_INNER_ARCHIVE}/icons/prd_mso_${size}.png" application-x-prd-mso.png | |
230 newicon -c mimetypes -s ${size} "${EXTRACTED_INNER_ARCHIVE}/icons/prd_oth_${size}.png" application-x-prd-oth.png | |
231 done | |
232 | |
233 # TODO: what about the provided fonts, theres no global registration in the original install script? | |
234 } | |
235 | |
236 pkg_postinst() { | |
237 xdg_icon_cache_update | |
238 xdg_desktop_database_update | |
239 xdg_mimeinfo_database_update | |
240 } | |
241 | |
242 pkg_postrm() { | |
243 xdg_icon_cache_update | |
244 xdg_desktop_database_update | |
245 xdg_mimeinfo_database_update | |
246 } | |
247 |