recipe 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. # Build recipe for pmount.
  2. #
  3. # Copyright (c) 2020 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=pmount
  19. version=0.9.23
  20. release=1
  21. # Define a category for the output of the package name
  22. pkgcategory=tools
  23. tarname=${program}_${version}.orig.tar.bz2
  24. # Remote source(s)
  25. fetch=https://deb.debian.org/debian/pool/main/p/pmount/$tarname
  26. description="
  27. Mount removable devices like a normal user.
  28. pmount is a wrapper around the standard mount program which permits normal
  29. users to mount removable devices without a matching /etc/fstab entry.
  30. This provides a robust basis for automounting frameworks like GNOME's
  31. Utopia project and confines the amount of code that runs as root to a
  32. minimum.
  33. "
  34. homepage=https://launchpad.net/pmount
  35. license=GPLv3+
  36. # Source documentation
  37. docs="AUTHORS COPYING ChangeLog NEWS README"
  38. docsdir="${docdir}/${program}-${version}"
  39. build()
  40. {
  41. unpack "${tardir}/$tarname"
  42. cd "$srcdir"
  43. # Apply a patch from Dragora
  44. patch -Np1 -i "${worktree}/patches/pmount/pmount-missing_header.diff"
  45. # Update for hosts based on musl
  46. cp -f "${worktree}/archive/common/config.guess" config.guess
  47. cp -f "${worktree}/archive/common/config.sub" config.sub
  48. # Set sane permissions
  49. chmod -R u+w,go-w,a+rX-s .
  50. ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
  51. $configure_args \
  52. --libdir=/usr/lib${libSuffix} \
  53. --mandir=$mandir \
  54. --docdir=$docsdir \
  55. --disable-hal \
  56. --build="$(gcc -dumpmachine)"
  57. make -j${jobs} V=1
  58. make -j${jobs} DESTDIR="$destdir" install
  59. # To handle dot (.new) files via graft(1)
  60. touch "${destdir}/etc/.graft-config"
  61. # Set permissions and ownerships for pmount
  62. (
  63. cd "${destdir}/usr/bin"
  64. for file in pmount pumount
  65. do
  66. chown :plugdev "$file"
  67. chmod 6710 "$file" # SetUID+SetGID
  68. done
  69. )
  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. # Copy documentation
  84. mkdir -p "${destdir}${docsdir}"
  85. cp -p $docs "${destdir}${docsdir}"
  86. }