recipes: tools/qi: just a minor change for a clean installation
[dragora.git] / recipes / tools / isapnptools / recipe
blobfc44660fa3dbf1a1c0eafd14ed43c08e657a77ee
1 # Build recipe for isapnptools.
3 # Copyright (c) 2017-2018 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=isapnptools
18 version=1.27
19 release=3
21 # Set 'outdir' for a nice and well-organized output directory
22 outdir="${outdir}/${arch}/tools"
24 tarname=${program}-${version}.tgz
26 # Remote source(s)
27 fetch=http://www.roestockfox.co.uk/files/isapnptools/$tarname
29 description="
30 ISA plug and play configuration utility.
32 Two programs, one allows the dumping of resource data and generation of
33 a skeleton configuration file, the other configures ISA PnP hardware
34 using a configuration file.
37 homepage=http://www.roestockfox.co.uk/isapnptools/index.html
38 license=GPLv2+
40 # Source documentation
41 docs="AUTHORS COPYING ChangeLog NEWS README"
42 docsdir="${docdir}/${program}-${version}"
44 build()
47     # Check architecture
48     case $arch in
49     i?86)
50         true
51         ;;
52     *)
53         echo "isapnptools is for the x86 platform-only ..." 1>&2
54         return 0
55         ;;
56     esac
58     set -e
60     unpack "${tardir}/$tarname"
62     cd "$srcdir"
64     # Set sane permissions
65     chmod -R u+w,go-w,a+rX-s .
67     # Fix compilation on musl
68     patch -p0 < "${worktree}/patches/isapnptools/isapnptools-musl.patch"
70     # Apply fixes from NetBSD (thanks!)
71     # ftp://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/sysutils/isapnptools/patches/
72     for file in patch-aa patch-ab patch-ac patch-ad patch-ae
73     do
74         patch -p0 < "${worktree}/patches/isapnptools/$file"
75     done
77     # Update for hosts based on musl
78     cp -f "${worktree}/archive/common/config.guess" config.guess
79     cp -f "${worktree}/archive/common/config.sub" config.sub
81     ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \
82      $configure_args \
83      --libdir=/usr/lib${libSuffix} \
84      --mandir=$mandir \
85      --disable-realtime \
86      --disable-pci \
87      --build="$(cc -dumpmachine)"
89     make -j${jobs} V=1
90     make -j${jobs} DESTDIR="$destdir" install
92     # Compress and link man pages (if needed)
93     if test -d "${destdir}/$mandir"
94     then
95         (
96             cd "${destdir}/$mandir"
97             find . -type f -exec lzip -9 '{}' +
98             find . -type l | while read -r file
99             do
100                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
101                 rm -- "$file"
102             done
103         )
104     fi
106     # Copy documentation
107     mkdir -p "${destdir}${docsdir}"
108     cp -p $docs "${destdir}${docsdir}"