recipe 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. # Build recipe for qi.
  2. #
  3. # Copyright (c) 2017-2022 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=qi
  19. version=2.9-rc1
  20. arch=noarch
  21. release=1
  22. # Define a category for the output of the package name
  23. pkgcategory=tools
  24. tarname=${program}-${version}.tar.lz
  25. # Remote source(s)
  26. fetch="
  27. https://dragora.mirror.garr.it/current/sources/$tarname
  28. rsync://rsync.dragora.org/current/sources/$tarname
  29. "
  30. description="
  31. A user-friendly package manager (version $version).
  32. Qi is a simple but well-integrated package manager. It can create,
  33. install, remove, and upgrade software packages. Qi produces binary
  34. packages using recipes, which are files containing specific instructions
  35. to build each package from source. Qi can manage multiple packages
  36. under a single directory hierarchy. This method allows to maintain a
  37. set of packages and multiple versions of them. This means that Qi could
  38. be used as the main package manager or complement the existing one.
  39. Qi offers a friendly command line interface, a global configuration
  40. file, a simple recipe layout to deploy software packages; also works
  41. with binary packages in parallel, speeding up installations and packages
  42. in production. The format used for packages is a simplified and safer
  43. variant of POSIX pax archive compressed in lzip format.
  44. Qi is a modern (POSIX-compliant) shell script released under the
  45. terms of the GNU General Public License. There are only two major
  46. dependencies for the magic: graft(1) and tarlz(1), the rest is expected
  47. to be found in any Unix-like system.
  48. "
  49. homepage=https://www.dragora.org
  50. license=GPLv3+
  51. # Source documentation
  52. docs="AUTHORS COPYING CREDITS NEWS README.md doc/example.order doc/recipe*"
  53. docsdir="${docdir}/${program}"
  54. # Limit package name to the program name
  55. full_pkgname="${program}@${pkgcategory}"
  56. build()
  57. {
  58. # Figure out architecture name for default package names in Dragora 3+
  59. #
  60. # See git_tree/targets/ for 'package_arch' on it.
  61. #
  62. case $(gcc -dumpmachine) in
  63. aarch64-*)
  64. package_arch=arm64
  65. ;;
  66. arm-*-musleabi)
  67. package_arch=armfp
  68. ;;
  69. arm-*-musleabihf)
  70. package_arch=armhf
  71. ;;
  72. armv7hl-*-musleabihf)
  73. package_arch=armhl
  74. ;;
  75. *x32-*)
  76. package_arch=x32
  77. ;;
  78. x86_64-*)
  79. package_arch=amd64
  80. ;;
  81. powerpc64le-*)
  82. package_arch=ppc64le
  83. ;;
  84. esac
  85. unpack "${tardir}/$tarname"
  86. cd "$srcdir"
  87. # Set sane permissions
  88. chmod -R u+w,go-w,a+rX-s .
  89. ./configure \
  90. --prefix=/usr \
  91. --libexecdir=/usr/libexec \
  92. --bindir=/usr/bin \
  93. --sbindir=/usr/sbin \
  94. --sysconfdir=/etc \
  95. --localstatedir=/var \
  96. --infodir=/usr/share/info \
  97. --mandir=/usr/share/man \
  98. --docdir=/usr/share/doc \
  99. --packagedir=/usr/pkg \
  100. --targetdir=/ \
  101. --arch="${package_arch:-$(uname -m)}"
  102. unset -v package_arch
  103. make -j${jobs} DESTDIR="$destdir" install
  104. ln -s qi "${destdir}/usr/bin/dragora-qi"
  105. # Copy the config file used in the temporary system
  106. if test -r /tools/etc/qirc && test ! -e /etc/qirc
  107. then
  108. cp -p /tools/etc/qirc "${destdir}/etc/"
  109. cp -p /tools/etc/qirc "${destdir}/etc/qirc.bak"
  110. chmod 644 "${destdir}"/etc/qirc*
  111. fi
  112. # Manage dot new file(s)
  113. touch "${destdir}/etc/.graft-config"
  114. # Compress and copy source documents
  115. rm -f "${destdir}/${infodir}/dir"
  116. lzip -9 "${destdir}/${infodir}/qi.info" \
  117. "${destdir}/${mandir}/man1/qi.1"
  118. mkdir -p "${destdir}/$docsdir"
  119. cp -p $docs "${destdir}/$docsdir"
  120. }