recipe 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. # Build recipe for dragora-installer.
  2. #
  3. # Copyright (c) 2019-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=dragora-installer
  19. version=20220213
  20. release=1
  21. # Define a category for the output of the package name
  22. pkgcategory=tools
  23. description="
  24. Installer of Dragora GNU/Linux-Libre.
  25. It contains the installer, help files and parts to perform
  26. a complete installation of Dragora GNU/Linux-Libre.
  27. "
  28. homepage=https://www.dragora.org
  29. license=GPLv3+
  30. build()
  31. {
  32. # Define package location according to supported architectures
  33. case $arch in
  34. amd64 | x32 )
  35. installer_arch=amd64
  36. ;;
  37. i586)
  38. installer_arch=i586
  39. ;;
  40. armhf)
  41. installer_arch=armhf
  42. ;;
  43. *)
  44. printf '%s\n' "" \
  45. "The Dragora installer will not be available for the architecture in" \
  46. "which it is being compiled. This package will not be produced." \
  47. "Please contact the developers at <dragora-users@nongnu.org>." \
  48. "" 1>&2
  49. sleep 7
  50. return 0
  51. ;;
  52. esac
  53. mkdir -p "${destdir}"/usr/sbin \
  54. "${destdir}"/usr/libexec/dragora-installer
  55. cp -p "${worktree}"/archive/dragora-installer/dragora-installer \
  56. "${destdir}"/usr/sbin/
  57. cp -p "${worktree}"/archive/dragora-installer/parts/* \
  58. "${destdir}"/usr/libexec/dragora-installer/
  59. for file in "${destdir}"/usr/sbin/* \
  60. "${destdir}"/usr/libexec/dragora-installer/*
  61. do
  62. sed -e "s|@PARTS@|/usr/libexec/dragora-installer/|g" \
  63. -e "s|@ARCH@|${installer_arch}|g" \
  64. -i "$file"
  65. done
  66. unset -v file
  67. chmod 755 "${destdir}"/usr/sbin/dragora-installer
  68. chmod 644 "${destdir}"/usr/libexec/dragora-installer/*
  69. unset -v installer_arch
  70. }