Version 6.4.0.3, tag libreoffice-6.4.0.3
[LibreOffice.git] / sysui / desktop / share / create_tree.sh
blob36dc4ff7a0e69d19c9cd72cd59edb0c99e9d122f
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
34 if [ "${GNOMEDIR}" ]; then
35 for i in `cd "${ICON_SOURCE_DIR}/hicolor"; find ??x?? ???x??? scalable -name "*.png" -o -name "*.svg"`
37 targetdir=${DESTDIR}/${GNOMEDIR}/share/icons/gnome/`dirname ${i}`
38 mkdir -p "${targetdir}"
39 destfile=$targetdir/${ICON_PREFIX:-}${ICON_PREFIX:+-}`basename ${i}`
40 cp "${ICON_SOURCE_DIR}/hicolor/${i}" "${destfile}"
41 chmod 0644 "${destfile}"
42 done
43 unset targetdir destfile
45 mkdir -p "${DESTDIR}/${GNOMEDIR}/share/mime-info"
46 cp openoffice.mime "${DESTDIR}/${GNOMEDIR}/share/mime-info/${PREFIX}.mime"
47 cp openoffice.keys "${DESTDIR}/${GNOMEDIR}/share/mime-info/${PREFIX}.keys"
48 chmod 0644 "${DESTDIR}/${GNOMEDIR}/share/mime-info/${PREFIX}".*
50 mkdir -p "${DESTDIR}/${GNOMEDIR}/share/application-registry"
51 cp openoffice.applications "${DESTDIR}/${GNOMEDIR}/share/application-registry/${PREFIX}.applications"
52 chmod 0644 "${DESTDIR}/${GNOMEDIR}/share/application-registry/${PREFIX}".*
55 mkdir -p "${DESTDIR}/${BINDIR}"
57 test -n "${OFFICE_PREFIX}" && office_prefix="${OFFICE_PREFIX}" || office_prefix=/opt
58 office_root=${office_prefix}/${PREFIX}
60 #this symlink is needed to have the API bootstrap functions running right
61 ln -sf "${office_root}/program/soffice" "${DESTDIR}/${BINDIR}/${PREFIX}"
63 if test "${PREFIX}" != libreoffice${PRODUCTVERSION} -a "${PREFIX}" != libreofficedev${PRODUCTVERSION} ; then
64 # compat symlinks
65 mkdir -p "${DESTDIR}${office_prefix}"
66 ln -sf libreoffice${PRODUCTVERSION} "${DESTDIR}${office_root}"
67 ln -sf /${BINDIR}/${PREFIX} "${DESTDIR}/${BINDIR}/libreoffice${PRODUCTVERSION}"
70 test "${PREFIX}" = libreofficedev${PRODUCTVERSION} && mime_def_file="libreofficedev${PRODUCTVERSION}.xml" || mime_def_file="libreoffice${PRODUCTVERSION}.xml"
71 mkdir -p "${DESTDIR}/${PREFIXDIR}/share/mime/packages"
72 cp openoffice.org.xml "${DESTDIR}/${PREFIXDIR}/share/mime/packages/$mime_def_file"
73 chmod 0644 "${DESTDIR}/${PREFIXDIR}/share/mime/packages/$mime_def_file"
75 mkdir -p "${DESTDIR}/${PREFIXDIR}/share/applications"
76 for i in `cat launcherlist`; do
77 ln -sf "${office_root}/share/xdg/${i}" "${DESTDIR}/${PREFIXDIR}/share/applications/${PREFIX}-${i}"
78 done
80 mkdir -p "${DESTDIR}/${PREFIXDIR}/share/appdata"
81 for i in base calc draw impress writer; do
82 cp "${APPDATA_SOURCE_DIR}/libreoffice-${i}.appdata.xml" "${DESTDIR}/${PREFIXDIR}/share/appdata/${PREFIX}-${i}.appdata.xml"
83 done
84 cp "${APPDATA_SOURCE_DIR}/org.libreoffice.kde.metainfo.xml" "${DESTDIR}/${PREFIXDIR}/share/appdata/org.${PREFIX}.kde.metainfo.xml"