recipes: tools/tar: upgraded to version 1.32
[dragora.git] / recipes / tools / tar / recipe
blobd4eaad7377bfc935aaeaac27fda3d9c3cfb0968f
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.
18 program=tar
19 version=1.32
20 release=1
22 # Set 'outdir' for a nice and well-organized output directory
23 outdir="${outdir}/${arch}/tools"
25 tarname=${program}-${version}.tar.bz2
27 # Remote source(s)
28 fetch=http://ftp.gnu.org/gnu/tar/$tarname
30 description="
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
42 license=GPLv3+
44 # Source documentation
45 docs="AUTHORS COPYING ChangeLog NEWS README THANKS TODO"
46 docsdir="${docdir}/${program}-${version}"
48 build()
50     set -e
52     unpack "${tardir}/$tarname"
54     cd "$srcdir"
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" \
61      $configure_args \
62      --libdir=/usr/lib${libSuffix} \
63      --infodir=$infodir \
64      --mandir=$mandir \
65      --docdir=$docsdir \
66      --enable-backup-scripts \
67      --enable-nls \
68      --build="$(cc -dumpmachine)"
70     make -j${jobs} V=1
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"
79     then
80         rm -f "${destdir}/${infodir}/dir"
81         lzip -9 "${destdir}/${infodir}"/*
82     fi
84     # Compress and link man pages (if needed)
85     if test -d "${destdir}/$mandir"
86     then
87         (
88             cd "${destdir}/$mandir"
89             find . -type f -exec lzip -9 '{}' +
90             find . -type l | while read -r file
91             do
92                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
93                 rm -- "$file"
94             done
95         )
96     fi
98     # Copy documentation
99     mkdir -p "${destdir}${docsdir}"
100     cp -p $docs "${destdir}${docsdir}"