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.
22 # Define hash tag to categorize the package name output
25 tarname=${program}-${version}.tar.xz
28 fetch=http://releases.pagure.org/${program}/$tarname
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
41 # Source documentation
42 docs="AUTHORS ChangeLog COPYING NEWS README"
43 docsdir="${docdir}/${program}-${version}"
49 unpack "${tardir}/$tarname"
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" \
62 --libdir=/usr/lib${libSuffix} \
63 --localstatedir=/var/lib \
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
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" \
89 chmod 0644 "${destdir}/etc/updatedb.conf"
91 # To handle config file(s)
92 touch "${destdir}/etc/.graft-config"
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"
101 mkdir -p "${destdir}${docsdir}"
105 cp -p $file "${destdir}${docsdir}"