recipe 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. # Build recipe for gpm.
  2. #
  3. # Copyright (c) 2018 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=54651a0_dragora; # Snapshot from http://github.com/selkfoster/gpm
  18. release=3
  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=http://rsync.dragora.org/current/sources/$tarname
  24. description="
  25. Utility and mouse server for virtual consoles.
  26. The gpm daemon tries to be a useful mouse server for applications
  27. running on the GNU/Linux console. Its roots are in the "selection"
  28. package, by Andrew Haylett, and the original code comes from
  29. selection itself.
  30. This package is intended as a replacement for selection, to provide
  31. additional facilities.
  32. "
  33. homepage=http://www.nico.schottelius.org/software/gpm/
  34. license=GPLv2+
  35. # Source documentation
  36. docs="COPYING README* TODO"
  37. docsdir="${docdir}/${program}-${version}"
  38. build()
  39. {
  40. set -e
  41. unpack "${tardir}/$tarname"
  42. cd "$srcdir"
  43. # Set sane permissions
  44. chmod -R u+w,go-w,a+rX-s .
  45. # Nope. This was already generated using
  46. # current versions of the autotools (D3)
  47. #sh ./autogen.sh
  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. # Not really needed
  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/gpm/dragora-mouse" "${destdir}/usr/sbin"
  72. chmod 755 "${destdir}/usr/sbin/dragora-mouse"
  73. # Make compatible symlinks for the invocation.
  74. #
  75. # gpmconfig was the name used for Dragora-2
  76. ln -sf dragora-mouse "${destdir}/usr/sbin/gpmconfig"
  77. # Perhaps, for Slackware users?
  78. ln -sf dragora-mouse "${destdir}/usr/sbin/mouseconfig"
  79. # Compress info documents deleting index file for the package
  80. if test -d "${destdir}/$infodir"
  81. then
  82. rm -f "${destdir}/${infodir}/dir"
  83. lzip -9 "${destdir}/${infodir}"/*
  84. fi
  85. # Compress and link man pages (if needed)
  86. if test -d "${destdir}/$mandir"
  87. then
  88. (
  89. cd "${destdir}/$mandir"
  90. find . -type f -exec lzip -9 '{}' +
  91. find . -type l | while read -r file
  92. do
  93. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  94. rm -- "$file"
  95. done
  96. )
  97. fi
  98. # Copy documentation
  99. mkdir -p "${destdir}${docsdir}"
  100. cp -p $docs "${destdir}${docsdir}"
  101. }