recipe 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. # Build recipe for libgphoto2.
  2. #
  3. # Copyright (c) 2022 Matias Fonzo, <selk@dragora.org>.
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License");
  6. # you may not use this file except in compliance with the License.
  7. # You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. # Exit immediately on any error
  17. set -e
  18. program=libgphoto2
  19. version=2.5.30
  20. release=1
  21. # Define a category for the output of the package name
  22. pkgcategory=media
  23. tarname=${program}-${version}.tar.bz2
  24. # Remote source(s)
  25. fetch=https://sourceforge.net/projects/gphoto/files/libgphoto/${version}/$tarname
  26. homepage=http://www.gphoto.org/
  27. description="
  28. Library to access digital cameras.
  29. libgphoto2 is a library that can be used by applications to
  30. access various digital cameras.
  31. For more information on gphoto, see $homepage
  32. "
  33. license="GPLv2+, LGPLv2.1"
  34. # Source documentation
  35. docs=""; # This build system already installs the documentation.
  36. docsdir="${docdir}/${program}-${version}"
  37. build()
  38. {
  39. unpack "${tardir}/$tarname"
  40. cd "$srcdir"
  41. # Set sane permissions
  42. chmod -R u+w,go-w,a+rX-s .
  43. ./configure CPPFLAGS="$QICPPFLAGS" \
  44. CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \
  45. $configure_args \
  46. --libdir=/usr/lib${libSuffix} \
  47. --mandir=$mandir \
  48. --docdir=$docsdir \
  49. --enable-static=no \
  50. --enable-shared=yes \
  51. --with-libcurl=auto \
  52. --with-libexif=auto \
  53. --build="$(gcc -dumpmachine)" \
  54. utilsdir=/usr/bin \
  55. udevscriptdir=/lib/udev
  56. make -j${jobs} V=1
  57. make -j${jobs} DESTDIR="$destdir" install
  58. # Make and install udev rules
  59. mkdir -p "${destdir}/lib/udev/rules.d" "${destdir}/lib/udev/hwdb.d"
  60. cd packaging/generic
  61. LD_LIBRARY_PATH="${destdir}/usr/lib${libSuffix}"
  62. CAMLIBS="${destdir}/usr/lib${libSuffix}/${program}/${version}"
  63. LIBDIR="${destdir}/usr/lib${libSuffix}"
  64. export LD_LIBRARY_PATH CAMLIBS LIBDIR
  65. "${destdir}"/usr/bin/print-camera-list udev-rules version 201 mode 0660 owner root group plugdev \
  66. > "${destdir}/lib/udev/rules.d/40-libgphoto2.rules"
  67. "${destdir}"/usr/bin/print-camera-list hwdb \
  68. > "${destdir}/lib/udev/hwdb.d/20-libgphoto2.hwdb"
  69. unset -v LD_LIBRARY_PATH CAMLIBS LIBDIR
  70. # Compress and link man pages (if needed)
  71. if test -d "${destdir}/$mandir"
  72. then
  73. (
  74. cd "${destdir}/$mandir"
  75. find . -type f -exec lzip -9 {} +
  76. find . -type l | while read -r file
  77. do
  78. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  79. rm -- "$file"
  80. done
  81. )
  82. fi
  83. # Remove unwanted documentation
  84. (
  85. cd "${destdir}/$docsdir"
  86. rm -f RELEASE-HOWTO.md README.packaging ABOUT-NLS
  87. )
  88. }