recipe 3.2 KB

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