KXStudio Website https://kx.studio/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

120 lines
4.5KB

  1. #!/bin/bash
  2. set -e
  3. cd $(dirname $0)
  4. PACKAGES_ARCHS=("amd64" "arm64" "armhf" "i386")
  5. PACKAGES_BLACKLIST=("calf-ladspa" "distrho-src" "lv2vst")
  6. PACKAGES_BASE_URL="http://ppa.launchpad.net/kxstudio-debian/plugins/ubuntu/"
  7. # rm -f Packages.gz Packages
  8. #
  9. # wget -q http://ppa.launchpad.net/kxstudio-debian/plugins/ubuntu/dists/bionic/main/binary-amd64/Packages.gz
  10. # gzip -d Packages.gz
  11. PACKAGES=$(cat Packages | grep "Package: " | sed "s/Package: //g" | sort)
  12. function is_blacklisted() {
  13. local TEST="${1}"
  14. local PACKAGE
  15. for PACKAGE in ${PACKAGES_BLACKLIST[@]}; do
  16. if [ ${TEST} = ${PACKAGE} ]; then
  17. return 0
  18. fi
  19. done
  20. return 1
  21. }
  22. for PACKAGE in ${PACKAGES[@]}; do
  23. if is_blacklisted ${PACKAGE}; then
  24. continue
  25. fi
  26. PACKAGE_LINESTART=$(cat Packages | grep -x -n "Package: ${PACKAGE}" | cut -d ':' -f 1)
  27. PACKAGE_NUMLINES=$(cat Packages | tail -n +$((${PACKAGE_LINESTART} + 1)) | grep -n "Package: " | head -n 1 | cut -d ':' -f 1)
  28. if [ -n "${PACKAGE_NUMLINES}" ]; then
  29. PACKAGE_DETAILS=$(cat Packages | tail -n +${PACKAGE_LINESTART} | head -n ${PACKAGE_NUMLINES})
  30. else
  31. PACKAGE_DETAILS=$(cat Packages | tail -n +${PACKAGE_LINESTART})
  32. fi
  33. PACKAGE_FILENAME=$(echo "${PACKAGE_DETAILS}" | awk 'sub("Filename: ","")')
  34. if echo "${PACKAGE_FILENAME}" | grep -q "_all.deb"; then
  35. continue
  36. fi
  37. PACKAGE_DESCRIPTION=$(echo "${PACKAGE_DETAILS}" | awk 'sub("Description: ","")')
  38. PACKAGE_PROVIDES=$(echo "${PACKAGE_DETAILS}" | awk 'sub("Provides: ","")')
  39. PACKAGE_SIZE=$(echo "${PACKAGE_DETAILS}" | grep -v "Installed-Size:" | awk 'sub("Size: ","")')
  40. PACKAGE_VERSION=$(echo "${PACKAGE_DETAILS}" | awk 'sub("Version: ","")' | cut -d ':' -f 2 | cut -d '-' -f 1)
  41. echo "<div class=\"repository-package\">"
  42. # screenshot
  43. SCREENSHOT=${PACKAGE}
  44. if [ ! -f "./screenshots/${SCREENSHOT}.png" ]; then
  45. SCREENSHOT=$(echo "${SCREENSHOT}" | sed "s/-lv2//g" | sed "s/-vst//g")
  46. if [ ! -f "./screenshots/${SCREENSHOT}.png" ]; then
  47. SCREENSHOT=""
  48. fi
  49. fi
  50. if [ -n "${SCREENSHOT}" ]; then
  51. echo "<div><a href=\"/repo/screenshots/${SCREENSHOT}.png\"><img src=\"/repo/screenshots/${SCREENSHOT}.png\" alt=\"${PACKAGE}\" class=\"img_thumb_150\"/></a></div>"
  52. else
  53. echo "<div><img src=\"/repo/screenshots/nogui.png\" alt=\"${PACKAGE}\" class=\"img_thumb_150\"/></div>"
  54. fi
  55. # full table
  56. echo "<div><table>"
  57. echo "<tr><td>Package Name:</td><td>${PACKAGE}</td></tr>"
  58. echo "<tr><td>Description:</td><td>${PACKAGE_DESCRIPTION}</td></tr>"
  59. echo "<tr><td>Version:</td><td>${PACKAGE_VERSION}</td></tr>"
  60. if [ ${PACKAGE_SIZE} -gt 999999 ]; then
  61. echo "<tr><td>Expected size:</td><td>$((${PACKAGE_SIZE} / 1024 / 1024))Mb</td></tr>"
  62. else
  63. echo "<tr><td>Expected size:</td><td>$((${PACKAGE_SIZE} / 1024))Kb</td></tr>"
  64. fi
  65. if [ -z "${PACKAGE_PROVIDES}" ]; then
  66. echo "<tr><td>Provides:</td><td>??</td></tr>"
  67. else
  68. echo "<tr><td>Provides:</td><td>"
  69. if echo "${PACKAGE_PROVIDES}" | grep -q standalone-plugin; then
  70. echo "Standalone "
  71. fi
  72. if echo "${PACKAGE_PROVIDES}" | grep -q ladspa-plugin; then
  73. echo "LADSPA "
  74. fi
  75. if echo "${PACKAGE_PROVIDES}" | grep -q dssi-plugin; then
  76. echo "DSSI "
  77. fi
  78. if echo "${PACKAGE_PROVIDES}" | grep -q lv2-plugin; then
  79. echo "LV2 "
  80. fi
  81. if echo "${PACKAGE_PROVIDES}" | grep -q vst-plugin; then
  82. echo "VST2 "
  83. fi
  84. if echo "${PACKAGE_PROVIDES}" | grep -q vst3-plugin; then
  85. echo "VST3 "
  86. fi
  87. echo "</td></tr>"
  88. fi
  89. echo "<tr><td>Downloads:</td><td>"
  90. for ARCH in ${PACKAGES_ARCHS[@]}; do
  91. PACKAGE_FILENAME_ARCHED=$(echo "${PACKAGE_FILENAME}" | sed "s/_amd64.deb/_${ARCH}.deb/g")
  92. echo "<a href=\"${PACKAGES_BASE_URL}${PACKAGE_FILENAME_ARCHED}\" target=\"_blank\">${ARCH}</a>&nbsp;&nbsp;"
  93. done
  94. echo "</tr>"
  95. echo "</table></div></div>"
  96. # separator
  97. echo "<br/>"
  98. echo
  99. done
  100. # print_plugin("add64", "add64", "Add64", "Standalone", ARRAY(
  101. # 'Add64 is the result of experiments around additive synthesis and is intended for research purposes only.',
  102. # 'The spectral drawing scheme for the harmonics and envelopes has been inspired by the virtual pipe organ Aeolus by Fons Adriaensen.',
  103. # 'Project Page: <a href="https://sourceforge.net/projects/add64/" class="external text" rel="nofollow" target="_blank">https://sourceforge.net/projects/add64/</a>'
  104. # ));