recipe 5.5 KB

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