Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / sysui / desktop / share / create_tree.sh
blob19a5ce38f924503fdcbcd3b4f7499ef85b9b2a8c
2 # This file is part of the LibreOffice project.
4 # This Source Code Form is subject to the terms of the Mozilla Public
5 # License, v. 2.0. If a copy of the MPL was not distributed with this
6 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 # This file incorporates work covered by the following license notice:
10 # Licensed to the Apache Software Foundation (ASF) under one or more
11 # contributor license agreements. See the NOTICE file distributed
12 # with this work for additional information regarding copyright
13 # ownership. The ASF licenses this file to you under the Apache
14 # License, Version 2.0 (the "License"); you may not use this file
15 # except in compliance with the License. You may obtain a copy of
16 # the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 umask 022
21 if [ "${KDEMAINDIR}" ]; then
22 for i in `cd "${ICON_SOURCE_DIR}"; find ${ICON_THEMES:-hicolor/???x??? hicolor/??x?? hicolor/scalable locolor} -name "*.png" -o -name "*.svg"`
24 targetdir=${DESTDIR}/${KDEMAINDIR}/share/icons/`dirname ${i}`
25 mkdir -p "${targetdir}"
26 destfile=$targetdir/${ICON_PREFIX:-}${ICON_PREFIX:+-}`basename ${i}`
27 cp "${ICON_SOURCE_DIR}/${i}" "${destfile}"
28 chmod 0644 "${destfile}"
29 done
30 unset targetdir destfile
32 mkdir -p "${DESTDIR}/${KDEMAINDIR}/share/mimelnk/application"
33 for i in `cat mimelnklist`; do
34 cp "${i}" "${DESTDIR}/${KDEMAINDIR}/share/mimelnk/application/${PREFIX}-`basename ${i}`"
35 done
36 chmod 0644 "${DESTDIR}/${KDEMAINDIR}/share/mimelnk/application/"*
39 if [ "${GNOMEDIR}" ]; then
40 for i in `cd "${ICON_SOURCE_DIR}/hicolor"; find ??x?? ???x??? scalable -name "*.png" -o -name "*.svg"`
42 targetdir=${DESTDIR}/${GNOMEDIR}/share/icons/gnome/`dirname ${i}`
43 mkdir -p "${targetdir}"
44 destfile=$targetdir/${ICON_PREFIX:-}${ICON_PREFIX:+-}`basename ${i}`
45 cp "${ICON_SOURCE_DIR}/hicolor/${i}" "${destfile}"
46 chmod 0644 "${destfile}"
47 done
48 unset targetdir destfile
50 mkdir -p "${DESTDIR}/${GNOMEDIR}/share/mime-info"
51 cp openoffice.mime "${DESTDIR}/${GNOMEDIR}/share/mime-info/${PREFIX}.mime"
52 cp openoffice.keys "${DESTDIR}/${GNOMEDIR}/share/mime-info/${PREFIX}.keys"
53 chmod 0644 "${DESTDIR}/${GNOMEDIR}/share/mime-info/${PREFIX}".*
55 mkdir -p "${DESTDIR}/${GNOMEDIR}/share/application-registry"
56 cp openoffice.applications "${DESTDIR}/${GNOMEDIR}/share/application-registry/${PREFIX}.applications"
57 chmod 0644 "${DESTDIR}/${GNOMEDIR}/share/application-registry/${PREFIX}".*
60 mkdir -p "${DESTDIR}/${PREFIXDIR}/bin"
62 test -n "${OFFICE_PREFIX}" && office_prefix="${OFFICE_PREFIX}" || office_prefix=/opt
63 office_root=${office_prefix}/${PREFIX}
65 #this symlink is needed to have the API boostrap functions running right
66 ln -sf "${office_root}/program/soffice" "${DESTDIR}/${PREFIXDIR}/bin/${PREFIX}"
68 if test "${PREFIX}" != libreoffice${PRODUCTVERSION} -a "${PREFIX}" != libreofficedev${PRODUCTVERSION} ; then
69 # compat symlinks
70 mkdir -p "${DESTDIR}${office_prefix}"
71 ln -sf libreoffice${PRODUCTVERSION} "${DESTDIR}${office_root}"
72 ln -sf /${PREFIXDIR}/bin/${PREFIX} "${DESTDIR}/${PREFIXDIR}/bin/libreoffice${PRODUCTVERSION}"
75 test "${PREFIX}" = libreofficedev${PRODUCTVERSION} && mime_def_file="libreofficedev${PRODUCTVERSION}.xml" || mime_def_file="libreoffice${PRODUCTVERSION}.xml"
76 mkdir -p "${DESTDIR}/${PREFIXDIR}/share/mime/packages"
77 cp openoffice.org.xml "${DESTDIR}/${PREFIXDIR}/share/mime/packages/$mime_def_file"
78 chmod 0644 "${DESTDIR}/${PREFIXDIR}/share/mime/packages/$mime_def_file"
80 mkdir -p "${DESTDIR}/${PREFIXDIR}/share/applications"
81 for i in `cat launcherlist`; do
82 ln -sf "${office_root}/share/xdg/${i}" "${DESTDIR}/${PREFIXDIR}/share/applications/${PREFIX}-${i}"
83 done
85 mkdir -p "${DESTDIR}/${PREFIXDIR}/share/appdata"
86 for i in base calc draw impress writer; do
87 cp "${APPDATA_SOURCE_DIR}/libreoffice-${i}.appdata.xml" "${DESTDIR}/${PREFIXDIR}/share/appdata/${PREFIX}-${i}.appdata.xml"
88 done
89 cp "${APPDATA_SOURCE_DIR}/org.libreoffice.kde.metainfo.xml" "${DESTDIR}/${PREFIXDIR}/share/appdata/org.${PREFIX}.kde.metainfo.xml"
91 # Generate gobject-introspection files
92 if [ -n "$INTROSPECTION_SCANNER" ]; then
93 mkdir -p "${DESTDIR}/${PREFIXDIR}/share/gir-1.0"
94 g-ir-scanner "${SRCDIR}/include/LibreOfficeKit/LibreOfficeKitGtk.h" "${SRCDIR}/libreofficekit/source/gtk/lokdocview.cxx" \
95 `${PKG_CONFIG} --cflags gobject-introspection-1.0 gtk+-3.0` -I"${SRCDIR}/include/" \
96 --include=GLib-2.0 --include=GObject-2.0 --include=Gio-2.0 \
97 --library=libreofficekitgtk --library-path="${INSTDIR}/program" \
98 --include=Gdk-3.0 --include=GdkPixbuf-2.0 --include=Gtk-3.0 \
99 --namespace=LOKDocView --nsversion=0.1 --identifier-prefix=LOKDoc --symbol-prefix=lok_doc \
100 --output="${DESTDIR}/${PREFIXDIR}/share/gir-1.0/LOKDocView-0.1.gir" --warn-all --no-libtool
102 mkdir -p "${DESTDIR}/${LIBDIR}/girepository-1.0"
103 g-ir-compiler "${DESTDIR}/${PREFIXDIR}/share/gir-1.0/LOKDocView-0.1.gir" \
104 --output="${DESTDIR}/${LIBDIR}/girepository-1.0/LOKDocView-0.1.typelib"