recipe 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. # Build recipe for iana-etc.
  2. #
  3. # Copyright (c) 2017, 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=iana-etc
  19. version=2.30
  20. update_version=20230217
  21. arch=noarch
  22. release=1
  23. # Define custom package version
  24. pkgversion=${version}_${update_version}
  25. # Define a category for the output of the package name
  26. pkgcategory=data
  27. tarname=${program}-${version}.tar.bz2
  28. # Remote source(s)
  29. fetch="
  30. http://sethwklein.net/$tarname
  31. https://github.com/Mic92/iana-etc/releases/download/${version}/$tarname
  32. "
  33. description="
  34. Provides /etc/services and /etc/protocols files.
  35. The iana-etc package provides the Unix/Linux /etc/services and
  36. /etc/protocols files. Using data from the Internet Assigned
  37. Numbers Authority <https://www.iana.org>.
  38. "
  39. homepage=https://www.iana.org/protocols
  40. license=OSLv3.0
  41. # Source documentation
  42. docs="COPYING CREDITS NEWS README VERSION"
  43. docsdir="${docdir}/${program}-${pkgversion}"
  44. build()
  45. {
  46. unpack "${tardir}/$tarname"
  47. unpack "${tardir}/${program}-${update_version}.tar.gz"
  48. cd "$srcdir"
  49. # Set sane permissions
  50. chmod -R u+w,go-w,a+rX-s .
  51. make all && make DESTDIR="$destdir" install
  52. # Update files from 'update_version' iana's variant
  53. cp -f -p "${TMPDIR}/${program}-${update_version}"/protocols \
  54. "${destdir}/etc"
  55. cp -f -p "${TMPDIR}/${program}-${update_version}"/services \
  56. "${destdir}/etc"
  57. # To handle config file(s)
  58. touch "${destdir}/etc/.graft-config"
  59. # Copy documentation
  60. mkdir -p "${destdir}/$docsdir"
  61. cp -p $docs "${destdir}/$docsdir"
  62. # Do not keep the update version source, unless --keep is passed in Qi
  63. if test -z "$keep_srcdir"
  64. then
  65. rm -rf -- "${TMPDIR}/${program}-${update_version}"
  66. fi
  67. unset -v update_version
  68. }