recipes: Adjust 'docsdir' variable to be consistent with the current recipe format
[dragora.git] / recipes / tools / isapnptools / recipe
blobef5b13eac4862409a420751e065019c1c0397bff
1 # Build recipe for isapnptools.
3 # Copyright (c) 2017-2018, 2021 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 # Exit immediately on any error
18 set -e
20 program=isapnptools
21 version=1.27
22 release=5
24 # Define a category for the output of the package name
25 pkgcategory=tools
27 tarname=${program}-${version}.tgz
29 # Remote source(s)
30 fetch=http://www.roestockfox.co.uk/files/isapnptools/$tarname
32 description="
33 ISA plug and play configuration utility.
35 Two programs, one allows the dumping of resource data and generation of
36 a skeleton configuration file, the other configures ISA PnP hardware
37 using a configuration file.
40 homepage=https://www.roestockfox.co.uk/isapnptools/index.html
41 license=GPLv2+
43 # Source documentation
44 docs="AUTHORS COPYING ChangeLog NEWS README"
45 docsdir="${docdir}/${program}-${version}"
47 build()
50     # Check architecture
51     case $arch in
52     i?86)
53         true
54         ;;
55     *)
56         echo "isapnptools is for the x86 platform-only ..." 1>&2
57         return 0
58         ;;
59     esac
61     unpack "${tardir}/$tarname"
63     cd "$srcdir"
65     # Set sane permissions
66     chmod -R u+w,go-w,a+rX-s .
68     # Fix compilation on musl
69     patch -p1 < "${worktree}/patches/isapnptools/isapnptools-musl-2.patch"
71     # Update for hosts based on musl
72     cp -f "${worktree}/archive/common/config.guess" config.guess
73     cp -f "${worktree}/archive/common/config.sub" config.sub
75     ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS -fcommon" LDFLAGS="$QILDFLAGS -static" \
76      $configure_args \
77      --libdir=/usr/lib${libSuffix} \
78      --mandir=$mandir \
79      --disable-realtime \
80      --disable-pci \
81      --build="$(gcc -dumpmachine)"
83     make -j${jobs} V=1
84     make -j${jobs} DESTDIR="$destdir" install
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
100     # Copy documentation
101     mkdir -p "${destdir}/$docsdir"
102     cp -p $docs "${destdir}/$docsdir"