recipe 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. # Build recipe for Shared Mime Info.
  2. #
  3. # Copyright (C) 2018, MMPG <mmpg@vp.pl>
  4. # Copyright (C) 2018-2022 Matias Fonzo, <selk@dragora.org>.
  5. #
  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
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  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.
  17. # Exit immediately on any error
  18. set -e
  19. program=shared-mime-info
  20. version=20210729_3c064c8
  21. release=1
  22. # Define a category for the output of the package name
  23. pkgcategory=x-libs
  24. tarname=${program}-${version}.tar.lz
  25. # Remote source(s)
  26. #fetch=https://gitlab.freedesktop.org/xdg/shared-mime-info/uploads/b27eb88e4155d8fccb8bb3cd12025d5b/$tarname
  27. fetch="
  28. https://dragora.mirror.garr.it/current/sources/$tarname
  29. rsync://rsync.dragora.org/current/sources/$tarname
  30. "
  31. description="
  32. A MIME database.
  33. The shared-mime-info package contains a MIME database.
  34. This allows central updates of MIME information for all
  35. supporting applications.
  36. "
  37. homepage=https://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec/
  38. license=GPLv2+
  39. # Source documentation
  40. docs="COPYING HACKING.md MAINTAINERS NEWS README.md"
  41. docsdir="${docdir}/${program}-${version}"
  42. # Limit parallel jobs for this build
  43. jobs=1
  44. build()
  45. {
  46. unpack "${tardir}/$tarname"
  47. cd "$srcdir"
  48. # Set sane permissions
  49. chmod -R u+w,go-w,a+rX-s .
  50. rm -rf BUILD
  51. mkdir BUILD
  52. cd BUILD
  53. CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \
  54. meson setup $configure_args \
  55. --libdir /usr/lib${libSuffix} \
  56. --mandir $mandir \
  57. --buildtype=release \
  58. --strip \
  59. -Dupdate-mimedb=false \
  60. ..
  61. ninja -j${jobs}
  62. DESTDIR="$destdir" ninja -j${jobs} install
  63. cd ..
  64. # Compress and link man pages (if needed)
  65. if test -d "${destdir}/$mandir"
  66. then
  67. (
  68. cd "${destdir}/$mandir"
  69. find . -type f -exec lzip -9 {} +
  70. find . -type l | while read -r file
  71. do
  72. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  73. rm -- "$file"
  74. done
  75. )
  76. fi
  77. # Copy documentation
  78. mkdir -p "${destdir}/$docsdir"
  79. cp -p $docs "${destdir}/$docsdir"
  80. }