recipes: tools/tar: do not limit package name since tarlz will be used for the packag...
[dragora.git] / recipes / tools / tar / recipe
blob4c750ad775acf9b6095c13096cf5e4afce93545e
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.31
20 release=3
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     # A regression for tar 1.31+:
60     # http://git.savannah.nongnu.org/cgit/tar.git/commit/?id=85c005ee1345c342f707f3c55317daf6cb050603
61     patch -p1 < "${worktree}/patches/tar/85c005ee1345c342f707f3c55317daf6cb050603"
63     ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \
64     FORCE_UNSAFE_CONFIGURE="1" \
65      $configure_args \
66      --libdir=/usr/lib${libSuffix} \
67      --infodir=$infodir \
68      --mandir=$mandir \
69      --docdir=$docsdir \
70      --enable-backup-scripts \
71      --enable-nls \
72      --build="$(cc -dumpmachine)"
74     make -j${jobs} V=1
75     make -j${jobs} DESTDIR="$destdir" install
77     # Remove generated charset.alias
78     rm -f "${destdir}/usr/lib${libSuffix}/charset.alias"
79     rmdir "${destdir}/usr/lib${libSuffix}" || true
81     # Compress info documents deleting index file for the package
82     if test -d "${destdir}/$infodir"
83     then
84         rm -f "${destdir}/${infodir}/dir"
85         lzip -9 "${destdir}/${infodir}"/*
86     fi
88     # Compress and link man pages (if needed)
89     if test -d "${destdir}/$mandir"
90     then
91         (
92             cd "${destdir}/$mandir"
93             find . -type f -exec lzip -9 '{}' +
94             find . -type l | while read -r file
95             do
96                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
97                 rm -- "$file"
98             done
99         )
100     fi
102     # Copy documentation
103     mkdir -p "${destdir}${docsdir}"
104     cp -p $docs "${destdir}${docsdir}"