recipes: Rename 'pkghashtag' variable to 'pkgcategory'
[dragora.git] / recipes / devel / git / recipe
blob9cffd7f7203eef47e95ca64858b6eac167b092d4
1 # Build recipe for git.
3 # Copyright (c) 2017-2019 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.23.0
19 release=1
21 # Define a category for the output of the package name
22 pkgcategory=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_SVN_TESTS=1
66 NO_REGEX=1
67 NO_NSEC=1
68 NO_PERL_CPAN_FALLBACKS=1
69 NEEDS_CRYPTO_WITH_SSL=1
70 INSTALL_SYMLINKS=1
71 EOF
73     ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
74      $configure_args \
75      --libdir=/usr/lib${libSuffix} \
76      --mandir=$mandir \
77      --docdir=$docsdir \
78      --with-libpcre1 \
79      --without-tcltk \
80      --build="$(cc -dumpmachine)"
82     make -j${jobs} V=1 INSTALLDIRS=vendor
83     make -j${jobs} V=1 INSTALLDIRS=vendor \
84      DESTDIR="$destdir" install
86     # Compress and link man pages (if needed)
87     if test -d "${destdir}/$mandir"
88     then
89         (
90             cd "${destdir}/$mandir"
92             # Unpack provided man-pages
93             tar xf "${tardir}/$tarname_manpages"
95             find . -type f -exec lzip -9 '{}' +
96             find . -type l | while read -r file
97             do
98                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
99                 rm -- "$file"
100             done
101         )
102     fi
103     unset tarname_manpages
105     # Clean up inventory file for Perl
107     # This line removes 'destdir' adding the suffix '.lz' for manpages
108     find "${destdir}/" -type f -name '.packlist' | while read -r file
109     do
110          sed -i \
111           -e "s|${destdir}||g" \
112           -e "s|\.[0-9][a-z]*|&.lz|g" \
113           $file
114     done
116     find "${destdir}/" -type f -name 'perllocal.pod' -exec rm -f {} +
118     # Copy documentation
119     mkdir -p "${destdir}${docsdir}"
120     cp -p $docs "${destdir}${docsdir}/"