recipe 3.6 KB

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