recipe 2.3 KB

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