template 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. # Template file for 'your-freedom'
  2. pkgname=your-freedom
  3. version=20200919
  4. revision=1
  5. _gitver=295467175d405848f02ee7c98661ee8097528c3c
  6. create_wrksrc=yes
  7. build_style=meta
  8. short_desc="Conflicts with nonfree packages to ensure your system is free"
  9. maintainer="reback00 <reback00@protonmail.com>"
  10. license="GPL-3.0-or-later"
  11. homepage="https://git.parabola.nu/blacklist.git"
  12. distfiles="https://git.parabola.nu/blacklist.git/plain/blacklist.txt?id=${_gitver}>blacklist.txt"
  13. checksum=c0c90cb0f8939cbad725861ca26fb2b1f79e49b920b8e1e5f48d6fb8366a010e
  14. # Set this below to yes to allow some packages that have minor issues
  15. # (like branding, suggesting optional dependencies etc.). But it should
  16. # be used with caution because if you're not careful, some nonfree
  17. # packages may come through.
  18. _allow_semifree=no
  19. # Set this below to yes to allow some packages listed on allowlist.txt.
  20. # allowlist.txt should list each package name that should be allowed on each
  21. # line. In case some package is already libre on default repo and should be
  22. # indicated, enter the package name twice adding a ":" between them. If you
  23. # change the file, remember to clear cache according to the note below in the
  24. # comment.
  25. _use_allowlist=yes
  26. # Set this below to yes to enable denying packages listed on denylist.txt.
  27. # Packages listed on that file will be added to the conflicts list. Useful for
  28. # packages not listed on Parabola's blacklist.txt but present on Void. List
  29. # each package name on each line of that file.
  30. _use_denylist=yes
  31. # Note 1: This package is still under testing. It is inspired by the Parabola's
  32. # your-freedom package. However, libretools is not explored yet.
  33. # Note 2: If you are building this package locally and have built it in the
  34. # past it is a good idea to clean cache to remove any history of it's conflict
  35. # data from past versions:
  36. # $ rm hostdir/binpkgs/{*-repodata,your-freedom-*.xbps}
  37. # Commands outside functions run multiple times.
  38. # Setting $conflicts once does not work (it forgets it next time).
  39. # There is no way to determine which run will set the conflict correctly.
  40. # This is a workaround to set it when the $conflicts is found as being empty.
  41. if [ -z "$conflicts" ] && [ -f "$XBPS_SRCDISTDIR/${pkgname}-${version}/blacklist.txt" ]; then
  42. cd "$XBPS_SRCDISTDIR/${pkgname}-${version}"
  43. if [ "$_allow_semifree" == "yes" ]; then
  44. conflicts=$(awk -F ':' '{ if ( $1 != $2) {print $1} }' "blacklist.txt" | awk '{print}' ORS=' ')
  45. else
  46. conflicts=$(awk -F ':' '{print $1}' "blacklist.txt" | awk '{print}' ORS=' ')
  47. fi
  48. if [ "$_use_denylist" == "yes" ] && [ -f "${XBPS_SRCPKGDIR}/${pkgname}/denylist.txt" ]; then
  49. while read package; do
  50. if [ "$package" != "" ]; then
  51. conflicts="$conflicts $package"
  52. fi
  53. done < "${XBPS_SRCPKGDIR}/${pkgname}/denylist.txt"
  54. fi
  55. if [ "$_use_allowlist" == "yes" ] && [ -f "${XBPS_SRCPKGDIR}/${pkgname}/allowlist.txt" ]; then
  56. while read linedata; do
  57. if [ "$linedata" != "" ]; then
  58. package=$( echo "$linedata" | awk -F ':' '{print $1}' )
  59. if [ "$expr" == "" ]; then
  60. expr="$package\s*"
  61. else
  62. expr="$expr\|$package\s*"
  63. fi
  64. fi
  65. done < "${XBPS_SRCPKGDIR}/${pkgname}/allowlist.txt"
  66. conflicts=$(echo "${conflicts}" | sed "s/\($expr\)//g")
  67. fi
  68. fi