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-nx/softmaker-office-nx-1200.ebuild @ 255:3c90d8644fec

[sync] imported 5fd794d..e0462cd from upstream commit e0462cd710b265e96775b0c1b2a595338010243e Author: Daniel Neugebauer <dneuge@energiequant.de> Date: Tue Jun 20 23:36:12 2023 +0200 app-office/softmaker-office[-nx]: added (2024.)1200 revision; subscription product NX is now a separate installation
author Migration Sync <gentoo-overlay@megacoffee.net>
date Tue, 20 Jun 2023 21:45:02 +0000
parents
children
comparison
equal deleted inserted replaced
254:f8f6e50d5c79 255:3c90d8644fec
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 NX - 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-nx-${PV//\./-}-amd64.tgz"
12
13 LICENSE="SoftMakerOffice"
14 SLOT="0"
15 KEYWORDS="~amd64"
16
17 # .deb dependencies as of 20 Jun 2023, version 1200:
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 # libglib2.0-0 (>= 2.12.0) => dev-libs/glib *
26 # libgstreamer1.0-0 (>= 1.0.0) => media-libs/gstreamer *
27 # libgstreamer-plugins-base1.0-0 (>= 1.0.0) => media-libs/gst-plugins-base
28 # libstdc++6 (>= 5.2) => sys-devel/gcc
29 # libx11-6 => x11-libs/libX11
30 # libxext6 => x11-libs/libXext
31 # libxmu6 => x11-libs/libXmu
32 # libxrandr2 (>= 2:1.2.99.3) => x11-libs/libXrandr
33 # libxrender1 => x11-libs/libXrender
34
35 DEPEND="
36 !app-office/softmaker-office
37
38 app-arch/tar
39 app-arch/xz-utils
40 "
41 RDEPEND="${DEPEND}
42 net-misc/curl
43 sys-libs/glibc
44 sys-devel/gcc
45 virtual/opengl
46 dev-libs/glib
47 media-libs/gstreamer
48 media-libs/gst-plugins-base
49 x11-libs/libX11
50 x11-libs/libXext
51 x11-libs/libXmu
52 x11-libs/libXrandr
53 x11-libs/libXrender
54 "
55
56 S="${WORKDIR}"
57
58 INNER_ARCHIVE="officenx.tar.lzma"
59 EXTRACTED_INNER_ARCHIVE="${WORKDIR}/extracted"
60
61 FINAL_INSTALL_DIR="/opt/softmaker-office-nx"
62 INSTALL_DIR="${D}${FINAL_INSTALL_DIR}"
63
64 # disable QA check for pre-stripped binaries
65 QA_PRESTRIPPED="
66 ${FINAL_INSTALL_DIR}/dpf3/libCSegmentation.so
67 ${FINAL_INSTALL_DIR}/dpf3/libCTokenizer.so
68 ${FINAL_INSTALL_DIR}/dpf3/libDpfDict.so
69 ${FINAL_INSTALL_DIR}/dpf3/libgamorphDpf.so
70 ${FINAL_INSTALL_DIR}/dpf3/libSGAnalyseSP.so
71 ${FINAL_INSTALL_DIR}/dpf3/libsprt4-7-0-instance-01.so
72 ${FINAL_INSTALL_DIR}/dpf3/libsprt4-7-0-instance-02.so
73 ${FINAL_INSTALL_DIR}/dpf3/libsprt4-7-0-instance-03.so
74 ${FINAL_INSTALL_DIR}/dpf3/libsprt4-7-0.so
75 ${FINAL_INSTALL_DIR}/dpf3/libsx.so
76 ${FINAL_INSTALL_DIR}/textmaker
77 ${FINAL_INSTALL_DIR}/presentations
78 ${FINAL_INSTALL_DIR}/planmaker
79 "
80
81 # disable QA checks for upstream .desktop files
82 QA_DESKTOP_FILE="
83 usr/share/applications/planmaker-nx.desktop
84 usr/share/applications/presentations-nx.desktop
85 usr/share/applications/textmaker-nx.desktop
86 "
87
88 src_unpack() {
89 unpack ${A} || "Failed to unpack outer archive"
90
91 mkdir ${EXTRACTED_INNER_ARCHIVE}
92 cd ${EXTRACTED_INNER_ARCHIVE} || die "Failed to switch to extraction directory"
93
94 tar xJf ${WORKDIR}/${INNER_ARCHIVE} || die "Failed to extract ${INNER_ARCHIVE}"
95 }
96
97 src_prepare() {
98 ## extract all lines defining functions from original install script so we can import it
99 # first make sure we actually have the expected revision
100 expected_hash="c8311d35ff044ec05386050eb053af30"
101 actual_hash=$(md5sum "${WORKDIR}/installofficenx" | cut -c'-32')
102 [[ "${actual_hash}" == "${expected_hash}" ]] || die "Unexpected file hash on install script, unable to extract functions. Expected MD5 ${expected_hash}, got: ${actual_hash}"
103
104 # extract
105 tail -n 1592 ${WORKDIR}/installofficenx | head -n 1354 >${WORKDIR}/smoffice-install-functions.sh
106
107 # mandatory since EAPI 6
108 eapply_user
109 }
110
111 src_compile() {
112 . ${WORKDIR}/smoffice-install-functions.sh
113
114 # set variables needed by original install script
115 APPBINPATH="${WORKDIR}" # install script function will write there during installation
116 SRCPATH="${EXTRACTED_INNER_ARCHIVE}" # install script function will read from there during installation
117 APPPATH="${FINAL_INSTALL_DIR}" # generated script will run files from there after installation
118
119 ## create_script
120 UNINSTALLSCRIPT="${APPBINPATH}/uninstall_smofficenx" # irrelevant but function will generate that file nevertheless
121 REMOVEICONSSCRIPT="${APPBINPATH}/remove_icons.sh" # also irrelevant but needed
122
123 # somehow the base file for the (irrelevant) uninstall script does not exist after unpacking, replace by dummy
124 echo '#dummy' >$SRCPATH/mime/uninst1
125
126 # run original create_script function
127 # arg 1 = version
128 # arg 2 = fixed to "1" by original install script
129 # arg 3 = empty to indicate global installation
130 (set -e; create_script nx "1" "") || die "Failed to run original create_script"
131
132 ## create_desktop1 to create .desktop files
133 # run original create_desktop functions
134 # arg 1 = version
135 # arg 2 = "0" assumes /usr/bin for installation, "1" uses APPBINPATH which would be wrong for this ebuild
136 (set -e; create_desktop1 nx "0") || die "Failed to run original create_desktop1"
137
138 ## do not run create_desktop2 as it would install the files (this will be done separately by this ebuild)
139 }
140
141 src_install() {
142 # all pre-built binaries should go into /opt and be symlinked to usr/bin etc.
143
144 # copy everything from inner archive to /opt install dir
145 insinto ${FINAL_INSTALL_DIR}
146 doins -r ${EXTRACTED_INNER_ARCHIVE}/*
147
148 # redo the executables (otherwise they miss permission)
149 exeinto ${FINAL_INSTALL_DIR}
150 doexe ${EXTRACTED_INNER_ARCHIVE}/planmaker
151 doexe ${EXTRACTED_INNER_ARCHIVE}/presentations
152 doexe ${EXTRACTED_INNER_ARCHIVE}/textmaker
153
154 # install the original wrapper scripts to /usr/bin
155 dobin ${WORKDIR}/planmakernx
156 dobin ${WORKDIR}/presentationsnx
157 dobin ${WORKDIR}/textmakernx
158
159 # symlink .desktop entries
160 for app in planmaker presentations textmaker; do
161 dosym ${FINAL_INSTALL_DIR}/mime/${app}-nx.desktop /usr/share/applications/${app}-nx.desktop
162 done
163
164 # MIME definition
165 # TODO: split to separate files?
166 # TODO: separate SoftMaker Office's own from generic definitions? (generic = MS Office etc.)
167 insinto /usr/share/mime/application/
168 doins ${EXTRACTED_INNER_ARCHIVE}/mime/softmaker-office-nx.xml
169
170 ## icons (see original copy_icons function)
171 # TODO: do not install what we do not need when separated
172
173 # app icons
174 for app in prl tml pml; do
175 for size in 16 24 32 48 64 128 256 512 1024; do
176 newicon -s ${size} "${EXTRACTED_INNER_ARCHIVE}/icons/${app}_${size}.png" "application-x-${app}nx.png"
177 done
178 done
179
180 # MIME icons
181 for size in 16 24 32 48 64 128 256 512 1024; do
182 ## text documents
183 # SoftOffice => tmd icon
184 for mime in application-x-tmd application-x-tmv; do
185 newicon -c mimetypes -s ${size} "${EXTRACTED_INNER_ARCHIVE}/icons/tmd_${size}.png" ${mime}.png
186 done
187
188 # MS Office => tmd_mso icon
189 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
190 newicon -c mimetypes -s ${size} "${EXTRACTED_INNER_ARCHIVE}/icons/tmd_mso_${size}.png" ${mime}.png
191 done
192
193 # OpenDocument => tmd_oth icon
194 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
195 newicon -c mimetypes -s ${size} "${EXTRACTED_INNER_ARCHIVE}/icons/tmd_oth_${size}.png" ${mime}.png
196 done
197
198 ## spreadsheet documents
199 # SoftOffice? => pmd icon
200 for mime in application-x-pmd application-x-pmv application-x-pmdx application-x-pagemaker; do
201 newicon -c mimetypes -s ${size} "${EXTRACTED_INNER_ARCHIVE}/icons/pmd_${size}.png" ${mime}.png
202 done
203
204 # MS Office => pmd_mso icon
205 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
206 newicon -c mimetypes -s ${size} "${EXTRACTED_INNER_ARCHIVE}/icons/pmd_mso_${size}.png" ${mime}.png
207 done
208
209 # OpenDocument and generic? => pmd_oth icon
210 for mime in text-csv application-x-dif application-x-prn application-vnd.stardivision.calc; do
211 newicon -c mimetypes -s ${size} "${EXTRACTED_INNER_ARCHIVE}/icons/pmd_oth_${size}.png" ${mime}.png
212 done
213
214 ## presentations
215 # SoftOffice => prd icon
216 for mime in application-x-prd application-x-prs application-x-prv; do
217 newicon -c mimetypes -s ${size} "${EXTRACTED_INNER_ARCHIVE}/icons/prd_${size}.png" ${mime}.png
218 done
219
220 # MS Office => prd_mso icon
221 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
222 newicon -c mimetypes -s ${size} "${EXTRACTED_INNER_ARCHIVE}/icons/prd_mso_${size}.png" ${mime}.png
223 done
224
225 ## trailing in original function
226 newicon -c mimetypes -s ${size} "${EXTRACTED_INNER_ARCHIVE}/icons/tmd_${size}.png" application-x-tmd.png
227 newicon -c mimetypes -s ${size} "${EXTRACTED_INNER_ARCHIVE}/icons/tmd_mso_${size}.png" application-x-tmd-mso.png
228 newicon -c mimetypes -s ${size} "${EXTRACTED_INNER_ARCHIVE}/icons/tmd_oth_${size}.png" application-x-tmd-oth.png
229
230 newicon -c mimetypes -s ${size} "${EXTRACTED_INNER_ARCHIVE}/icons/pmd_${size}.png" application-x-pmd.png
231 newicon -c mimetypes -s ${size} "${EXTRACTED_INNER_ARCHIVE}/icons/pmd_mso_${size}.png" application-x-pmd-mso.png
232 newicon -c mimetypes -s ${size} "${EXTRACTED_INNER_ARCHIVE}/icons/pmd_oth_${size}.png" application-x-pmd-oth.png
233
234 newicon -c mimetypes -s ${size} "${EXTRACTED_INNER_ARCHIVE}/icons/prd_${size}.png" application-x-prd.png
235 newicon -c mimetypes -s ${size} "${EXTRACTED_INNER_ARCHIVE}/icons/prd_mso_${size}.png" application-x-prd-mso.png
236 newicon -c mimetypes -s ${size} "${EXTRACTED_INNER_ARCHIVE}/icons/prd_oth_${size}.png" application-x-prd-oth.png
237 done
238
239 # TODO: what about the provided fonts, theres no global registration in the original install script?
240 }
241
242 pkg_postinst() {
243 xdg_icon_cache_update
244 xdg_desktop_database_update
245 xdg_mimeinfo_database_update
246 }
247
248 pkg_postrm() {
249 xdg_icon_cache_update
250 xdg_desktop_database_update
251 xdg_mimeinfo_database_update
252 }
253