recipe 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. # Build recipe for hierarchyfs.
  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=hierarchyfs
  19. version=dragora
  20. pkgversion=3.0
  21. release=11
  22. # Define a category for the output of the package name
  23. pkgcategory=data
  24. description="
  25. Skeleton bases of Dragora GNU/Linux-Libre.
  26. It contains the main hierarchy of directories, symlinks,
  27. ownerships, and permissions for compose the basic structure
  28. of the file system.
  29. "
  30. homepage=https://www.dragora.org
  31. license=GPLv3+
  32. build()
  33. {
  34. mkdir -p "$destdir"
  35. cd "$destdir"
  36. # Directories
  37. mkdir -p \
  38. usr/bin \
  39. boot \
  40. dev \
  41. etc \
  42. home \
  43. lost+found \
  44. media \
  45. mnt \
  46. opt \
  47. proc \
  48. root \
  49. run \
  50. run/lock \
  51. usr/sbin \
  52. srv \
  53. sys \
  54. tmp \
  55. usr \
  56. var \
  57. dev/pts \
  58. etc/X11 \
  59. etc/opt \
  60. etc/skel \
  61. etc/xdg \
  62. media/cdrecorder \
  63. media/cdrom \
  64. media/floppy \
  65. media/zip \
  66. usr/bin \
  67. usr/games \
  68. usr/include \
  69. usr/libexec \
  70. usr/local/bin \
  71. usr/local/etc \
  72. usr/local/games \
  73. usr/local/include \
  74. usr/local/libexec \
  75. usr/local/sbin \
  76. usr/local/share/doc \
  77. usr/local/share/info \
  78. usr/local/share/man/man1 \
  79. usr/local/share/man/man2 \
  80. usr/local/share/man/man3 \
  81. usr/local/share/man/man4 \
  82. usr/local/share/man/man5 \
  83. usr/local/share/man/man6 \
  84. usr/local/share/man/man7 \
  85. usr/local/share/man/man8 \
  86. usr/local/src \
  87. usr/pkg \
  88. usr/share/doc \
  89. usr/share/games \
  90. usr/share/info \
  91. usr/share/man/man1 \
  92. usr/share/man/man2 \
  93. usr/share/man/man3 \
  94. usr/share/man/man4 \
  95. usr/share/man/man5 \
  96. usr/share/man/man6 \
  97. usr/share/man/man7 \
  98. usr/share/man/man8 \
  99. usr/src \
  100. var/cache/man \
  101. var/games \
  102. var/lib \
  103. var/local \
  104. var/log \
  105. var/mail \
  106. var/opt \
  107. var/spool/lpd \
  108. var/spool/news \
  109. var/tmp
  110. # Copy local files
  111. cp -p "${worktree}/archive/hierarchyfs/README.media" \
  112. "media/README"
  113. cp -p "${worktree}/archive/hierarchyfs/README.mnt" \
  114. "mnt/README"
  115. chmod 644 "media/README" "mnt/README"
  116. # Copy files for the already created root account
  117. cp -p "${worktree}"/archive/etc/skel/.*rc \
  118. "${worktree}"/archive/etc/skel/.profile \
  119. "${destdir}/root/"
  120. touch \
  121. "media/.graft-config" "mnt/.graft-config" "root/.graft-config"
  122. # Manually include the post-install file for the package
  123. mkdir -p "${destdir}/var/lib/qi"
  124. cp -p "${CWD}/post-install.multidir" "${destdir}/var/lib/qi/${full_pkgname}.sh"
  125. chmod 644 "${destdir}/var/lib/qi/${full_pkgname}.sh"
  126. # Handle lib<equal> for the multi directory support
  127. # Guess the suffix to compose the corresponding library directory
  128. if test -f /tools/etc/stage1_is-multi-directory
  129. then
  130. libSuffix="$(cat /tools/etc/stage1_is-multi-directory)"
  131. fi
  132. if test -n "$libSuffix"
  133. then
  134. echo "libSuffix detected."
  135. echo "Changing value for post-install '${libSuffix}'"
  136. sed -i s"/^libSuffix=X/libSuffix=${libSuffix}/" \
  137. "${destdir}/var/lib/qi/${full_pkgname}.sh"
  138. fi
  139. }