recipe 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. # Build recipe for barelibs (dragora).
  2. #
  3. # Copyright (c) 2021 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=barelibs
  19. version=dragora
  20. pkgversion=20211101
  21. release=1
  22. # Define a category for the output of the package name
  23. pkgcategory=libs
  24. description="
  25. Set of various libraries that will be required by many programs.
  26. This package is composed of many (shared) libraries from different
  27. packages, which will be used by many programs. That is, in case you
  28. have not installed or do not have installed the package containing the
  29. required library; once the package containing the library included here
  30. is installed, your part will be replaced by the installed package.
  31. "
  32. homepage=https://www.dragora.org
  33. license=Custom
  34. build()
  35. {
  36. rm -rf "$destdir"
  37. mkdir -p "$destdir"
  38. cd "$destdir"
  39. # Read list of file names declared on the 'tracked-names' list.
  40. #
  41. # This list is intended to be general, and is based on the
  42. # "Slackware Linux" list(s), which is now a big distribution.
  43. # It makes sense, since we do not want to be missing a shared
  44. # library necessary for the execution of some program within
  45. # the system. Thanks. :^)
  46. #
  47. while read -r name
  48. do
  49. for file in $(find /usr/lib${libSuffix} -name "${name}*")
  50. do
  51. # We are looking for a file, not for a directory
  52. if test -d "$file"
  53. then
  54. continue;
  55. fi
  56. # Ignore libtool, static libraries and other extensions
  57. case "${file##*.}" in
  58. a | la | pc | spec )
  59. continue;;
  60. esac
  61. if test ! -e "$file"
  62. then
  63. printf '%s\n' "" \
  64. "WARNING: \`${file##*/}' is not found on the distro installation." \
  65. " This means that the package providing the *shared library* may" \
  66. " not yet be available for the distro, so it will be ignored" \
  67. " for inclusion in the creation of this package." 1>&2
  68. continue;
  69. fi
  70. # Get the real location and real directory of the file
  71. real_location="$(readlink -- "$file")"
  72. real_directory="$(dirname -- "$real_location")"
  73. destination="${real_directory##*@}"
  74. destination="${destination#*/}"
  75. # Create directory in destination if needed
  76. if test ! -d "${destdir}/${destination}"
  77. then
  78. mkdir -v -p "${destdir}/${destination}"
  79. fi
  80. # Now copy the file as it is (without traverse the path)
  81. cp -v -p -P "$real_location" "${destdir}/${destination}"
  82. unset -v real_location real_directory destination
  83. done
  84. done < "${worktree}"/archive/barelibs/tracked-names
  85. # Do not include the following (non-essential) libraries
  86. rm -f \
  87. "${destdir}/usr/lib${libSuffix}"/libdbus-?-tqt* \
  88. "${destdir}/usr/lib${libSuffix}"/libdbus-tqt*
  89. }