recipes: Adjust 'docsdir' variable to be consistent with the current recipe format
[dragora.git] / recipes / networking / hldig / recipe
blob2cd763261b110f6570a3d25efca010aac6c25ba1
1 # Build recipe for hldig.
3 # Copyright (c) 2020, 2022 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=hldig
21 version=20210616_9427c9cd
22 release=2
24 # Define a category for the output of the package name
25 pkgcategory=networking
27 tarname=${program}-${version}.tar.lz
29 # Remote source(s)
30 fetch="
31  https://dragora.mirror.garr.it/current/sources/$tarname
32  rsync://rsync.dragora.org/current/sources/$tarname
35 homepage=https://github.com/solbu/hldig
37 description="
38 Internet search engine software (fork of htdig).
40 The ht://Dig system is a complete world wide web indexing and searching
41 system for a domain or intranet.  This system is not meant to replace
42 the need for powerful internet-wide search systems like Lycos, Infoseek,
43 Google and AltaVista.  Instead it is meant to cover the search needs for
44 a single company, campus, or even a particular sub section of a web site.
45 As opposed to some WAIS-based or web-server based search engines,
46 ht://Dig can easily span several web servers.  The type of these different
47 web servers doesn't matter as long as they understand common protocols
48 like HTTP.
50 ht://Dig was developed at San Diego State University as a way to search
51 the various web servers on the campus network.
53 hl://Dig is a fork of ht://Dig, a world-wide-web search system for an
54 intranet or small internet.  See:
56 $homepage
59 license=GPLv2+
61 # Source documentation
62 docs="AUTHORS.md CONDUCT.md CONTRIBUTING.md COPYING ChangeLog \
63  ChangeLog.md README.md STATUS TESTING.md TRANSLATING.md VERSION"
64 docsdir="${docdir}/${program}-${version}"
66 build()
68     unpack "${tardir}/$tarname"
70     cd "$srcdir"
72     # Set sane permissions
73     chmod -R u+w,go-w,a+rX-s .
75     #autoreconf -v
76     #rm -f libhtdigphp/config.log libhtdigphp/config.status
78     ./configure CPPFLAGS="$QICPPFLAGS" \
79     CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS -std=c++14" \
80     LDFLAGS="$QILDFLAGS" \
81      $configure_args \
82      --libdir=/usr/lib${libSuffix} \
83      --mandir=$mandir \
84      --with-gnu-ld \
85      --with-cgi-bin-dir=/usr/lib${libSuffix}/cgi-bin \
86      --with-search-dir=/usr/share/doc/${program}-${version}/examples \
87      --with-image-dir=/var/lib/hldig/www \
88      --with-config-dir=/etc/hldig \
89      --with-common-dir=/etc/hldig \
90      --with-database-dir=/var/lib/hldig \
91      --build="$(gcc -dumpmachine)"
93     make -j${jobs} V=1
94     make -j${jobs} DESTDIR="$destdir" install-strip
96     # Make symlink at usr/bin for hlsearch(1)
97     (
98         cd "${destdir}/usr/bin"
99         ln -sf /usr/lib${libSuffix}/cgi-bin/hlsearch .
100     )
102     # Make symlinks for compatibility with htdig commands
103     (
104         cd "${destdir}/usr/bin"
105         for name in hl*
106         do
107             name="${name#hl}"
108             ln -sf hl${name} ht${name}
109         done
110     )
112     # To handle config files (.new) via graft(1)
114     touch "${destdir}/etc/hldig/.graft-config"
116     # Compress manual pages, copy the documentation
118     lzip -9 "${destdir}/${mandir}"/man?/*.?
120     mkdir -p "${destdir}/$docsdir"
121     cp -p $docs "${destdir}/$docsdir"