Start mass upgrade
[dragora.git] / recipes / devel / git / recipe
bloba039d0c223489c904dbd49daa398f15db3ccaf50
1 # Build recipe for git.
3 # Copyright (c) 2017-2019, 2021-2022 Matias Fonzo, <selk@dragora.org>.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 #    http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 # Exit immediately on any error
18 set -e
20 program=git
21 version=2.34.1
22 release=1
24 # Define a category for the output of the package name
25 pkgcategory=devel
27 tarname=${program}-${version}.tar.gz
28 tarname_manpages=${program}-manpages-${version}.tar.gz
30 # Remote source(s)
31 fetch="
32   https://mirrors.edge.kernel.org/pub/software/scm/git/$tarname
33   https://mirrors.edge.kernel.org/pub/software/scm/git/$tarname_manpages
36 description="
37 A fast, scalable, distributed revision control system.
39 Git is a fast, scalable, distributed revision control system with an
40 unusually rich command set that provides both high-level operations
41 and full access to internals.
43 Git is an Open Source project covered by the GNU General Public
44 License version 2 (some parts of it are under different licenses,
45 compatible with the GPLv2). It was originally written by Linus
46 Torvalds with help of a group of hackers around the net.
49 homepage=https://www.git-scm.org
50 license="GPLv2 only, LGPLv2.1"
52 # Source documentation
53 docs="COPYING LGPL-2.1 README*"
54 docsdir="${docdir}/${program}-${version}"
56 build()
58     unpack "${tardir}/$tarname"
60     cd "$srcdir"
62     # Set sane permissions
63     chmod -R u+w,go-w,a+rX-s .
65     cat << EOF >> config.mak
66 NEEDS_CRYPTO_WITH_SSL=1
67 INSTALL_SYMLINKS=1
68 EOF
70     ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" \
71     LDFLAGS="$QILDFLAGS" \
72      $configure_args \
73      --libdir=/usr/lib${libSuffix} \
74      --mandir=$mandir \
75      --docdir=$docsdir \
76      --with-libpcre2 \
77      --with-tcltk \
78      --with-python=python3 \
79      --build="$(gcc -dumpmachine)"
81     make -j${jobs} V=1 INSTALLDIRS=vendor
82     make -j${jobs} V=1 INSTALLDIRS=vendor \
83      DESTDIR="$destdir" install
85     # Compress and link man pages (if needed)
86     if test -d "${destdir}/$mandir"
87     then
88         (
89             cd "${destdir}/$mandir"
91             # Unpack provided man-pages
92             tar xf "${tardir}/$tarname_manpages"
94             find . -type f -exec lzip -9 {} +
95             find . -type l | while read -r file
96             do
97                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
98                 rm -- "$file"
99             done
100         )
101     fi
102     unset -v tarname_manpages
104     # Clean up inventory file for Perl
106     # This line removes 'destdir' adding the suffix '.lz' for manpages
107     find "${destdir}/" -type f -name '.packlist' | while read -r file
108     do
109          sed -i \
110           -e "s|${destdir}||g" \
111           -e "s|\.[0-9][a-z]*|&.lz|g" \
112           $file
113     done
115     find "${destdir}/" -type f -name 'perllocal.pod' -exec rm -f {} +
117     # Copy documentation
118     mkdir -p "${destdir}${docsdir}"
119     cp -p $docs "${destdir}${docsdir}"