recipes: Rename 'pkghashtag' variable to 'pkgcategory'
[dragora.git] / recipes / tools / mlocate / recipe
blob5abda58b7bef0197580f2cd0a1223759c700a592
1 # Build recipe for mlocate.
3 # Copyright (c) 2017 Alan Beadle, <ab.beadle@gmail.com>.
4 # Copyright (c) 2017 Matias Fonzo, <selk@dragora.org>.
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 #    http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
18 program=mlocate
19 version=0.26
20 release=1
22 # Define a category for the output of the package name
23 pkgcategory=tools
25 tarname=${program}-${version}.tar.xz
27 # Remote source(s)
28 fetch=http://releases.pagure.org/${program}/$tarname
30 description="
31 mlocate is a locate/updatedb implementation.
33 The 'm' stands for 'merging': updatedb reuses the existing database to
34 avoid rereading most of the file system, which makes updatedb faster
35 and does not trash the system caches as much.
38 homepage=http://pagure.io/mlocate
39 license=GPLv2+
41 # Source documentation
42 docs="AUTHORS ChangeLog COPYING NEWS README"
43 docsdir="${docdir}/${program}-${version}"
45 build()
47     set -e
49     unpack "${tardir}/$tarname"
51     cd "$srcdir"
53     # Set sane permissions
54     chmod -R u+w,go-w,a+rX-s .
56     # Update for hosts based on musl
57     cp -f "${worktree}/archive/common/config.guess" admin/config.guess
58     cp -f "${worktree}/archive/common/config.sub" admin/config.sub
60     ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \
61      $configure_args \
62      --libdir=/usr/lib${libSuffix} \
63      --localstatedir=/var/lib \
64      --mandir=$mandir \
65      --docdir=$docsdir \
66      --build="$(cc -dumpmachine)"
68     make -j${jobs} groupname=locate
69     make -j${jobs} groupname=locate DESTDIR="$destdir" install
71     mv "${destdir}/usr/bin/locate" "${destdir}/usr/bin/mlocate"
72     ln -s mlocate "${destdir}/usr/bin/locate"
74     # To increase security changing the default 2755
75     chmod 2711 "${destdir}/usr/bin/mlocate"
77     # Remove generated charset.alias
78     rm -f "${destdir}/usr/lib${libSuffix}/charset.alias"
79     rmdir "${destdir}/usr/lib${libSuffix}" || true
81     # Copy custom files
83     mkdir -p "${destdir}/etc/cron.daily/"
84     cp -p "${worktree}/archive/mlocate/etc/cron.daily/mlocate" \
85           "${destdir}/etc/cron.daily/"
86     chmod 0755 "${destdir}/etc/cron.daily/mlocate"
87     cp -p "${worktree}/archive/mlocate/etc/updatedb.conf" \
88           "${destdir}/etc/"
89     chmod 0644 "${destdir}/etc/updatedb.conf"
91     # To handle config file(s)
92     touch "${destdir}/etc/.graft-config"
94     # Compress man pages
95     lzip -9 "${destdir}/${mandir}"/man?/*
97     # A symbolic link if someone requests locate(1)
98     ln -s locate.1.lz "${destdir}/${mandir}/man1/mlocate.1.lz"
100     # Copy documentation
101     mkdir -p "${destdir}${docsdir}"
103     for file in $docs
104     do
105         cp -p $file "${destdir}${docsdir}"
106     done