recipe 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. # Build recipe for git.
  2. #
  3. # Copyright (c) 2017-2019, 2021-2023 Matias Fonzo, <selk@dragora.org>.
  4. #
  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
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  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.
  16. # Exit immediately on any error
  17. set -e
  18. program=git
  19. version=2.40.0
  20. release=1
  21. # Define a category for the output of the package name
  22. pkgcategory=devel
  23. tarname=${program}-${version}.tar.gz
  24. tarname_manpages=${program}-manpages-${version}.tar.gz
  25. # Remote source(s)
  26. fetch="
  27. https://mirrors.edge.kernel.org/pub/software/scm/git/$tarname
  28. https://mirrors.edge.kernel.org/pub/software/scm/git/$tarname_manpages
  29. "
  30. description="
  31. A fast, scalable, distributed revision control system.
  32. Git is a fast, scalable, distributed revision control system with an
  33. unusually rich command set that provides both high-level operations
  34. and full access to internals.
  35. Git is an Open Source project covered by the GNU General Public
  36. License version 2 (some parts of it are under different licenses,
  37. compatible with the GPLv2). It was originally written by Linus
  38. Torvalds with help of a group of hackers around the net.
  39. "
  40. homepage=https://www.git-scm.org
  41. license="GPLv2 only, LGPLv2.1"
  42. # Source documentation
  43. docs="COPYING LGPL-2.1 README*"
  44. docsdir="${docdir}/${program}-${version}"
  45. build()
  46. {
  47. unpack "${tardir}/$tarname"
  48. cd "$srcdir"
  49. # Set sane permissions
  50. chmod -R u+w,go-w,a+rX-s .
  51. cat << EOF >> config.mak
  52. NEEDS_CRYPTO_WITH_SSL=1
  53. INSTALL_SYMLINKS=1
  54. EOF
  55. ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" \
  56. LDFLAGS="$QILDFLAGS" \
  57. $configure_args \
  58. --libdir=/usr/lib${libSuffix} \
  59. --mandir=$mandir \
  60. --docdir=$docsdir \
  61. --with-libpcre2 \
  62. --with-tcltk \
  63. --with-python=python3 \
  64. --build="$(gcc -dumpmachine)"
  65. make -j${jobs} V=1 INSTALLDIRS=vendor
  66. make -j${jobs} V=1 INSTALLDIRS=vendor \
  67. DESTDIR="$destdir" install
  68. # Compress and link man pages (if needed)
  69. if test -d "${destdir}/$mandir"
  70. then
  71. (
  72. cd "${destdir}/$mandir"
  73. # Unpack provided man-pages
  74. tar xf "${tardir}/$tarname_manpages"
  75. find . -type f -exec lzip -9 {} +
  76. find . -type l | while read -r file
  77. do
  78. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  79. rm -- "$file"
  80. done
  81. )
  82. fi
  83. unset -v tarname_manpages
  84. # Clean up inventory file for Perl
  85. # This line removes 'destdir' adding the suffix '.lz' for manpages
  86. find "${destdir}/" -type f -name '.packlist' | while read -r file
  87. do
  88. sed -i \
  89. -e "s|${destdir}||g" \
  90. -e "s|\.[0-9][a-z]*|&.lz|g" \
  91. $file
  92. done
  93. find "${destdir}/" -type f -name 'perllocal.pod' -exec rm -f {} +
  94. # Copy documentation
  95. mkdir -p "${destdir}/$docsdir"
  96. cp -p $docs "${destdir}/$docsdir"
  97. }