1 # Build recipe for tar.
3 # Copyright (c) 2016-2017 Matias Fonzo, <selk@dragora.org>.
4 # Copyright (c) 2019 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 # Set 'outdir' for a nice and well-organized output directory
23 outdir="${outdir}/${arch}/tools"
25 tarname=${program}-${version}.tar.bz2
28 fetch=http://ftp.gnu.org/gnu/tar/$tarname
31 Tool to package and manipulate files.
33 The tar program provides the ability to create tar archives, as well as
34 various other kinds of manipulation. For example, you can use tar on
35 previously created archives to extract files, to store additional
36 files, or to update or list files which were already stored.
38 The name of tar comes from \"Tape ARchiver\".
41 homepage=http://www.gnu.org/software/tar
44 # Source documentation
45 docs="AUTHORS COPYING ChangeLog NEWS README THANKS TODO"
46 docsdir="${docdir}/${program}-${version}"
52 unpack "${tardir}/$tarname"
56 # Set sane permissions
57 chmod -R u+w,go-w,a+rX-s .
59 ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \
60 FORCE_UNSAFE_CONFIGURE="1" \
62 --libdir=/usr/lib${libSuffix} \
66 --enable-backup-scripts \
68 --build="$(cc -dumpmachine)"
71 make -j${jobs} DESTDIR="$destdir" install
73 # Remove generated charset.alias
74 rm -f "${destdir}/usr/lib${libSuffix}/charset.alias"
75 rmdir "${destdir}/usr/lib${libSuffix}" || true
77 # Compress info documents deleting index file for the package
78 if test -d "${destdir}/$infodir"
80 rm -f "${destdir}/${infodir}/dir"
81 lzip -9 "${destdir}/${infodir}"/*
84 # Compress and link man pages (if needed)
85 if test -d "${destdir}/$mandir"
88 cd "${destdir}/$mandir"
89 find . -type f -exec lzip -9 '{}' +
90 find . -type l | while read -r file
92 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
99 mkdir -p "${destdir}${docsdir}"
100 cp -p $docs "${destdir}${docsdir}"