recipe 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. # Build recipe for udevil.
  2. #
  3. # Copyright (c) 2019-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. program=udevil
  17. version=20150504_ce9f1c5
  18. release=2
  19. # Set 'outdir' for a nice and well-organized output directory
  20. outdir="${outdir}/${arch}/tools"
  21. tarname=${program}-${version}.tar.lz
  22. # Remote source(s)
  23. fetch="
  24. http://rsync.dragora.org/current/sources/$tarname
  25. http://mirror.cedia.org.ec/dragora/current/sources/$tarname
  26. "
  27. description="
  28. Mounts and unmounts devices without password.
  29. udevil is a command line GNU/Linux program which mounts and unmounts
  30. removable devices without a password, shows device info, and monitors
  31. device changes. It can also mount ISO files, nfs://, smb://,
  32. ftp://, ssh:// and WebDAV URLs, and tmpfs/ramfs filesystems.
  33. "
  34. homepage=http://ignorantguru.github.com/udevil/
  35. license=GPLv3+
  36. # Source documentation
  37. docs="AUTHORS COPYING ChangeLog NEWS README"
  38. docsdir="${docdir}/${program}-${version}"
  39. build()
  40. {
  41. set -e
  42. unpack "${tardir}/$tarname"
  43. cd "$srcdir"
  44. # Update for hosts based on musl
  45. cp -f "${worktree}/archive/common/config.guess" config.guess
  46. cp -f "${worktree}/archive/common/config.sub" config.sub
  47. # Set sane permissions
  48. chmod -R u+w,go-w,a+rX-s .
  49. ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
  50. $configure_args \
  51. --libdir=/usr/lib${libSuffix} \
  52. --mandir=$mandir \
  53. --docdir=$docsdir \
  54. --disable-systemd \
  55. --build="$(cc -dumpmachine)"
  56. make -j${jobs} V=1
  57. make -j${jobs} libdir=/usr/lib${libSuffix} \
  58. DESTDIR="$destdir" install-strip
  59. # To handle (dot) .new files via graft(1)
  60. touch "${destdir}/etc/udevil/.graft-config"
  61. # Restrict execution of udevil to the 'plugdev' group
  62. chown root:plugdev "${destdir}/usr/bin/udevil"
  63. chmod u+s,go-s,o-x "${destdir}/usr/bin/udevil"
  64. # Install devmon (udevil) perp service
  65. mkdir -p "${destdir}/etc/perp/devmon"
  66. cp -p "${worktree}/archive/udevil/rc.log" \
  67. "${worktree}/archive/udevil/rc.main" \
  68. "${destdir}/etc/perp/devmon/"
  69. chmod 755 "${destdir}"/etc/perp/devmon/rc.*
  70. # Be an active service by default
  71. chmod +t "${destdir}/etc/perp/devmon"
  72. # To handle config file(s)
  73. touch "${destdir}/etc/perp/devmon/.graft-config"
  74. # Compress and link man pages (if needed)
  75. if test -d "${destdir}/$mandir"
  76. then
  77. (
  78. cd "${destdir}/$mandir"
  79. find . -type f -exec lzip -9 '{}' +
  80. find . -type l | while read -r file
  81. do
  82. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  83. rm -- "$file"
  84. done
  85. )
  86. fi
  87. # Copy documentation
  88. mkdir -p "${destdir}${docsdir}"
  89. cp -p $docs "${destdir}${docsdir}"
  90. }