1 # Build recipe for gpm.
3 # Copyright (c) 2018-2020 Matias Fonzo, <selk@dragora.org>.
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
9 # http://www.apache.org/licenses/LICENSE-2.0
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.
18 version=20200617_e82d1a6
21 # Define a category for the output of the package name
24 tarname=${program}-${version}.tar.lz
28 http://rsync.dragora.org/current/sources/$tarname
29 http://mirror.cedia.org.ec/dragora/current/sources/$tarname
33 Utility and mouse server for virtual consoles.
35 The gpm daemon tries to be a useful mouse server for applications
36 running on the GNU/Linux console. Its roots are in the "selection"
37 package, by Andrew Haylett, and the original code comes from
40 This package is intended as a replacement for selection, to provide
41 additional facilities.
44 homepage=http://www.nico.schottelius.org/software/gpm/
47 # Source documentation
48 docs="COPYING README* TODO"
49 docsdir="${docdir}/${program}-${version}"
55 unpack "${tardir}/$tarname"
59 # Set sane permissions
60 chmod -R u+w,go-w,a+rX-s .
62 ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
64 --libdir=/usr/lib${libSuffix} \
65 --sysconfdir=/etc/gpm \
70 --build="$(gcc -dumpmachine)"
73 make -j${jobs} DESTDIR="$destdir" install
74 strip --strip-debug "${destdir}/usr/lib${libSuffix}/libgpm.a"
76 # Emacs already cover this
77 rm -rf "${destdir}/usr/share/emacs"
79 # Make symlink for compatibility, just in case
80 ln -s libgpm.so.2.1.0 "${destdir}/usr/lib${libSuffix}/libgpm.so"
82 # Include configuration files for GPM
84 mkdir -p "${destdir}/etc/gpm"
85 cp -p conf/*.conf "${destdir}/etc/gpm"
86 chmod 644 "${destdir}/etc/gpm"/*.conf
87 touch "${destdir}/etc/gpm/.graft-config"
89 # Include menu-driven tool to configure the mouse
91 mkdir -p "${destdir}/usr/sbin"
92 cp -p "${worktree}/archive/dragora-tools/dragora-mouse" \
94 chmod 755 "${destdir}/usr/sbin/dragora-mouse"
96 # Make compatible symlinks for the invocation.
98 # gpmconfig was the name used for Dragora-2
99 ln -sf dragora-mouse "${destdir}/usr/sbin/gpmconfig"
101 # Perhaps, for Slackware users?
102 ln -sf dragora-mouse "${destdir}/usr/sbin/mouseconfig"
104 # Compress info documents deleting index file for the package
105 if test -d "${destdir}/$infodir"
107 rm -f "${destdir}/${infodir}/dir"
108 lzip -9 "${destdir}/${infodir}"/*
111 # Compress and link man pages (if needed)
112 if test -d "${destdir}/$mandir"
115 cd "${destdir}/$mandir"
116 find . -type f -exec lzip -9 '{}' +
117 find . -type l | while read -r file
119 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
126 mkdir -p "${destdir}${docsdir}"
127 cp -p $docs "${destdir}${docsdir}"