recipe 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. # Build recipe for gpm.
  2. #
  3. # Copyright (c) 2018-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=gpm
  19. version=20200617_e82d1a6
  20. release=1
  21. # Define a category for the output of the package name
  22. pkgcategory=tools
  23. tarname=${program}-${version}.tar.lz
  24. # Remote source(s)
  25. fetch="
  26. https://dragora.mirror.garr.it/current/sources/$tarname
  27. rsync://rsync.dragora.org/current/sources/$tarname
  28. "
  29. description="
  30. Utility and mouse server for virtual consoles.
  31. The gpm daemon tries to be a useful mouse server for applications
  32. running on the GNU/Linux console. Its roots are in the "selection"
  33. package, by Andrew Haylett, and the original code comes from
  34. selection itself.
  35. This package is intended as a replacement for selection, to provide
  36. additional facilities.
  37. "
  38. homepage=https://www.nico.schottelius.org/software/gpm/
  39. license=GPLv2+
  40. # Source documentation
  41. docs="COPYING README* TODO"
  42. docsdir="${docdir}/${program}-${version}"
  43. build()
  44. {
  45. unpack "${tardir}/$tarname"
  46. cd "$srcdir"
  47. # Set sane permissions
  48. chmod -R u+w,go-w,a+rX-s .
  49. ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
  50. $configure_args \
  51. --libdir=/usr/lib${libSuffix} \
  52. --sysconfdir=/etc/gpm \
  53. --infodir=$infodir \
  54. --mandir=$mandir \
  55. --docdir=$docsdir \
  56. --without-curses \
  57. --build="$(gcc -dumpmachine)"
  58. make -j${jobs} V=1
  59. make -j${jobs} DESTDIR="$destdir" install
  60. strip --strip-debug "${destdir}/usr/lib${libSuffix}/libgpm.a"
  61. # Emacs already cover this
  62. rm -rf "${destdir}/usr/share/emacs"
  63. # Make symlink for compatibility, just in case
  64. ln -s libgpm.so.2.1.0 "${destdir}/usr/lib${libSuffix}/libgpm.so"
  65. # Include configuration files for GPM
  66. mkdir -p "${destdir}/etc/gpm"
  67. cp -p conf/*.conf "${destdir}/etc/gpm"
  68. chmod 644 "${destdir}/etc/gpm"/*.conf
  69. touch "${destdir}/etc/gpm/.graft-config"
  70. # Include menu-driven tool to configure the mouse
  71. mkdir -p "${destdir}/usr/sbin"
  72. cp -p "${worktree}/archive/dragora-tools/dragora-mouse" \
  73. "${destdir}/usr/sbin"
  74. chmod 755 "${destdir}/usr/sbin/dragora-mouse"
  75. # Make compatible symlinks for the invocation.
  76. #
  77. # gpmconfig was the name used for Dragora-2
  78. ln -sf dragora-mouse "${destdir}/usr/sbin/gpmconfig"
  79. # Perhaps, for Slackware users?
  80. ln -sf dragora-mouse "${destdir}/usr/sbin/mouseconfig"
  81. # Compress info documents deleting index file for the package
  82. if test -d "${destdir}/$infodir"
  83. then
  84. rm -f "${destdir}/${infodir}/dir"
  85. lzip -9 "${destdir}/${infodir}"/*
  86. fi
  87. # Compress and link man pages (if needed)
  88. if test -d "${destdir}/$mandir"
  89. then
  90. (
  91. cd "${destdir}/$mandir"
  92. find . -type f -exec lzip -9 {} +
  93. find . -type l | while read -r file
  94. do
  95. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  96. rm -- "$file"
  97. done
  98. )
  99. fi
  100. # Copy documentation
  101. mkdir -p "${destdir}/$docsdir"
  102. cp -p $docs "${destdir}/$docsdir"
  103. }