recipes: libs/readline: downgraded to the version 7.0. Some programs are expecting...
[dragora.git] / recipes / devel / git / recipe
blob34366a6ff992420d2f49a678bcdb694fe211025b
1 # Build recipe for git.
3 # Copyright (c) 2017-2018 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 program=git
18 version=2.20.1
19 release=1
21 # Set 'outdir' for a nice and well-organized output directory
22 outdir="${outdir}/${arch}/devel"
24 tarname=${program}-${version}.tar.gz
25 tarname_manpages=${program}-manpages-${version}.tar.gz
27 # Remote source(s)
28 fetch="
29   http://mirrors.edge.kernel.org/pub/software/scm/git/$tarname
30   http://mirrors.edge.kernel.org/pub/software/scm/git/$tarname_manpages
33 description="
34 A fast, scalable, distributed revision control system.
36 Git is a fast, scalable, distributed revision control system with an
37 unusually rich command set that provides both high-level operations
38 and full access to internals.
40 Git is an Open Source project covered by the GNU General Public
41 License version 2 (some parts of it are under different licenses,
42 compatible with the GPLv2). It was originally written by Linus
43 Torvalds with help of a group of hackers around the net.
46 homepage=http://www.git-scm.org
47 license="GPLv2 only, LGPLv2.1"
49 # Source documentation
50 docs="COPYING LGPL-2.1 README*"
51 docsdir="${docdir}/${program}-${version}"
53 build()
55     set -e
57     unpack "${tardir}/$tarname"
59     cd "$srcdir"
61     # Set sane permissions
62     chmod -R u+w,go-w,a+rX-s .
64     cat << EOF >> config.mak
65 NO_GETTEXT=1
66 NO_SVN_TESTS=1
67 NO_REGEX=1
68 NO_NSEC=1
69 NO_PERL_CPAN_FALLBACKS=1
70 NEEDS_CRYPTO_WITH_SSL=1
71 INSTALL_SYMLINKS=1
72 EOF
74     ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
75      $configure_args \
76      --libdir=/usr/lib${libSuffix} \
77      --mandir=$mandir \
78      --docdir=$docsdir \
79      --with-libpcre1 \
80      --without-tcltk \
81      --build="$(cc -dumpmachine)"
83     make -j${jobs} V=1 INSTALLDIRS=vendor
84     make -j${jobs} V=1 INSTALLDIRS=vendor \
85      DESTDIR="$destdir" install
87     # Compress and link man pages (if needed)
88     if test -d "${destdir}/$mandir"
89     then
90         (
91             cd "${destdir}/$mandir"
93             # Unpack provided man-pages
94             tar xf "${tardir}/$tarname_manpages"
96             find . -type f -exec lzip -9 '{}' +
97             find . -type l | while read -r file
98             do
99                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
100                 rm -- "$file"
101             done
102         )
103     fi
104     unset tarname_manpages
106     # Clean up inventory file for Perl
108     # This line removes 'destdir' adding the suffix '.lz' for manpages
109     find "${destdir}/" -type f -name '.packlist' | while read -r file
110     do
111          sed -i \
112           -e "s|${destdir}||g" \
113           -e "s|\.[0-9][a-z]*|&.lz|g" \
114           $file
115     done
117     find "${destdir}/" -type f -name 'perllocal.pod' -exec rm -f {} +
119     # Copy documentation
120     mkdir -p "${destdir}${docsdir}"
121     cp -p $docs "${destdir}${docsdir}/"