move the dragora-mouse tool to archive/dragora-tools/ directory
[dragora.git] / recipes / tools / gpm / recipe
blob02afe9be5a10dd20d610f8e4e36bd04fc525824c
1 # Build recipe for gpm.
3 # Copyright (c) 2018-2019 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.
17 program=gpm
18 version=54651a0_dragora; # Snapshot from http://github.com/selkfoster/gpm
19 release=4
21 # Set 'outdir' for a nice and well-organized output directory
22 outdir="${outdir}/${arch}/tools"
24 tarname=${program}-${version}.tar.lz
26 # Remote source(s)
27 fetch=http://rsync.dragora.org/current/sources/$tarname
29 description="
30 Utility and mouse server for virtual consoles.
32 The gpm daemon tries to be a useful mouse server for applications
33 running on the GNU/Linux console.  Its roots are in the "selection"
34 package, by Andrew Haylett, and the original code comes from
35 selection itself.
37 This package is intended as a replacement for selection, to provide
38 additional facilities.
41 homepage=http://www.nico.schottelius.org/software/gpm/
42 license=GPLv2+
44 # Source documentation
45 docs="COPYING README* TODO"
46 docsdir="${docdir}/${program}-${version}"
48 build()
50     set -e
52     unpack "${tardir}/$tarname"
54     cd "$srcdir"
56     # Set sane permissions
57     chmod -R u+w,go-w,a+rX-s .
59     # Nope.  This was already generated using
60     # current versions of the autotools (D3)
61     #sh ./autogen.sh
63     ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
64      $configure_args \
65      --libdir=/usr/lib${libSuffix} \
66      --sysconfdir=/etc/gpm \
67      --infodir=$infodir \
68      --mandir=$mandir \
69      --docdir=$docsdir \
70      --without-curses \
71      --build="$(cc -dumpmachine)"
73     make -j${jobs} V=1
74     make -j${jobs} DESTDIR="$destdir" install
75     strip --strip-debug "${destdir}/usr/lib${libSuffix}/libgpm.a"
77     # Not really needed
78     rm -rf "${destdir}/usr/share/emacs"
80     # Make symlink for compatibility, just in case
81     ln -s libgpm.so.2.1.0 "${destdir}/usr/lib${libSuffix}/libgpm.so"
83     # Include configuration files for GPM
85     mkdir -p "${destdir}/etc/gpm"
86     cp -p conf/*.conf "${destdir}/etc/gpm"
87     chmod 644 "${destdir}/etc/gpm"/*.conf
88     touch "${destdir}/etc/gpm/.graft-config"
90     # Include menu-driven tool to configure the mouse
92     mkdir -p "${destdir}/usr/sbin"
93     cp -p "${worktree}/archive/dragora-tools/dragora-mouse" \
94           "${destdir}/usr/sbin"
95     chmod 755 "${destdir}/usr/sbin/dragora-mouse"
97     # Make compatible symlinks for the invocation.
98     #
99     # gpmconfig was the name used for Dragora-2
100     ln -sf dragora-mouse "${destdir}/usr/sbin/gpmconfig"
102     # Perhaps, for Slackware users?
103     ln -sf dragora-mouse "${destdir}/usr/sbin/mouseconfig"
105     # Compress info documents deleting index file for the package
106     if test -d "${destdir}/$infodir"
107     then
108         rm -f "${destdir}/${infodir}/dir"
109         lzip -9 "${destdir}/${infodir}"/*
110     fi
112     # Compress and link man pages (if needed)
113     if test -d "${destdir}/$mandir"
114     then
115         (
116             cd "${destdir}/$mandir"
117             find . -type f -exec lzip -9 '{}' +
118             find . -type l | while read -r file
119             do
120                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
121                 rm -- "$file"
122             done
123         )
124     fi
126     # Copy documentation
127     mkdir -p "${destdir}${docsdir}"
128     cp -p $docs "${destdir}${docsdir}"