recipes: Adjust 'docsdir' variable to be consistent with the current recipe format
[dragora.git] / recipes / x-libs / shared-mime-info / recipe
blob29502e0430e43b179cfd2d6ff1ccb9af1b558d36
1 # Build recipe for Shared Mime Info.
3 # Copyright (C) 2018, MMPG <mmpg@vp.pl>
4 # Copyright (C) 2018-2022 Matias Fonzo, <selk@dragora.org>.
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 #    http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
18 # Exit immediately on any error
19 set -e
21 program=shared-mime-info
22 version=20210729_3c064c8
23 release=1
25 # Define a category for the output of the package name
26 pkgcategory=x-libs
28 tarname=${program}-${version}.tar.lz
30 # Remote source(s)
31 #fetch=https://gitlab.freedesktop.org/xdg/shared-mime-info/uploads/b27eb88e4155d8fccb8bb3cd12025d5b/$tarname
32 fetch="
33  https://dragora.mirror.garr.it/current/sources/$tarname
34  rsync://rsync.dragora.org/current/sources/$tarname
37 description="
38 A MIME database.
40 The shared-mime-info package contains a MIME database.
42 This allows central updates of MIME information for all
43 supporting applications.
46 homepage=https://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec/
47 license=GPLv2+
49 # Source documentation
50 docs="COPYING HACKING.md MAINTAINERS NEWS README.md"
51 docsdir="${docdir}/${program}-${version}"
53 # Limit parallel jobs for this build
54 jobs=1
56 build()
58     unpack "${tardir}/$tarname"
60     cd "$srcdir"
62     # Set sane permissions
63     chmod -R u+w,go-w,a+rX-s .
65     rm -rf BUILD
66     mkdir BUILD
67     cd BUILD
69     CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \
70     meson setup $configure_args \
71      --libdir /usr/lib${libSuffix} \
72      --mandir $mandir \
73      --buildtype=release \
74      --strip \
75      -Dupdate-mimedb=false \
76      ..
78     ninja -j${jobs}
79     DESTDIR="$destdir" ninja -j${jobs} install
81     cd ..
83     # Compress and link man pages (if needed)
84     if test -d "${destdir}/$mandir"
85     then
86         (
87             cd "${destdir}/$mandir"
88             find . -type f -exec lzip -9 {} +
89             find . -type l | while read -r file
90             do
91                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
92                 rm -- "$file"
93             done
94         )
95     fi
97     # Copy documentation
98     mkdir -p "${destdir}/$docsdir"
99     cp -p $docs "${destdir}/$docsdir"