recipe 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. # Build recipe for ca-certificates (a version from Alpine Linux).
  2. #
  3. # Copyright (c) 2018-2019 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=ca-certificates
  17. version=20190108_431b3fc
  18. release=1
  19. # Set 'outdir' for a nice and well-organized output directory
  20. outdir="${outdir}/${arch}/networking"
  21. tarname=${program}-${version}.tar.lz
  22. # Remote source(s)
  23. fetch="
  24. http://rsync.dragora.org/current/sources/$tarname
  25. http://mirror.cedia.org.ec/dragora/current/sources/$tarname
  26. "
  27. description="
  28. Common CA certificates PEM files.
  29. This package comes from the CA certificates version found in
  30. \"Alpine Linux\".
  31. "
  32. homepage=http://git.alpinelinux.org/cgit/ca-certificates/
  33. license="GPLv2+ | MPLv2.0"
  34. # Source documentation
  35. docs="VERSION"
  36. docsdir="${docdir}/${program}-${version}"
  37. # Limit parallel jobs for this build
  38. jobs=1
  39. build()
  40. {
  41. set -e
  42. unpack "${tardir}/$tarname"
  43. cd "$srcdir"
  44. # Add updated source file with the included root certificates
  45. # http://mxr.mozilla.org/mozilla-central/source/security/nss/lib/ckfw/builtins/certdata.txt
  46. cat "${worktree}/archive/ca-certificates/certdata.txt" > certdata.txt
  47. # Set sane permissions
  48. chmod -R u+w,go-w,a+rX-s .
  49. make -j${jobs} V=1
  50. make -j${jobs} V=1 DESTDIR="$destdir" install
  51. strip --strip-unneeded \
  52. "${destdir}/usr/bin/c_rehash" \
  53. "${destdir}/usr/sbin/update-ca-certificates"
  54. # Clean up broken symlinks, if any
  55. find "$destdir" -print | while read -r file
  56. do
  57. if test -L "$file" && test ! -e "$file"
  58. then
  59. echo "Deleting dangling symlink: $file"
  60. rm -f -- "$file"
  61. fi
  62. done
  63. mkdir -p "${destdir}"/etc/ca-certificates/update.d
  64. # To populate config file
  65. (
  66. echo "# Automatically generated by $full_pkgname"
  67. cd "${destdir}/usr/share/ca-certificates"
  68. find . -name '*.crt' | sort | cut -b3-
  69. ) > "${destdir}/etc/ca-certificates.conf"
  70. # Make run-parts script
  71. cat << "EOF" > "${destdir}/etc/ca-certificates/update.d/certhash"
  72. #! /bin/sh -
  73. exec /usr/bin/c_rehash /etc/ssl/certs
  74. EOF
  75. chmod 755 "${destdir}/etc/ca-certificates/update.d/certhash"
  76. # Compress and link man pages (if needed)
  77. if test -d "${destdir}/$mandir"
  78. then
  79. (
  80. cd "${destdir}/$mandir"
  81. find . -type f -exec lzip -9 '{}' +
  82. find . -type l | while read -r file
  83. do
  84. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  85. rm -- "$file"
  86. done
  87. )
  88. fi
  89. # Copy documentation
  90. mkdir -p "${destdir}${docsdir}"
  91. cp -p $docs "${destdir}${docsdir}"
  92. }