paleta.SlackBuild 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #!/bin/sh
  2. #
  3. # Slackware build script for paleta
  4. #
  5. # Copyright (C) 2023-2024 Ricardo García Jiménez <ricardogj08@riseup.net>
  6. #
  7. # This program is free software: you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation, either version 3 of the License, or
  10. # (at your option) any later version.
  11. #
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with this program. If not, see <https://www.gnu.org/licenses/>.
  19. #
  20. PRGNAM=paleta
  21. VERSION=${VERSION:-git}
  22. SOURCE="https://github.com/dylanaraps/${PRGNAM}.${VERSION}"
  23. BUILD=${BUILD:-1}
  24. TAG=${TAG:-_rgj}
  25. PKGTYPE=${PKGTYPE:-tgz}
  26. if [ -z "${ARCH}" ]; then
  27. case "$(uname -m)" in
  28. i?86) ARCH=i586 ;;
  29. arm*) ARCH=arm ;;
  30. *) ARCH=$(uname -m) ;;
  31. esac
  32. fi
  33. CWD=$(pwd)
  34. TMP=${TMP:-/tmp/build}
  35. PKG="${TMP}/package-${PRGNAM}"
  36. OUTPUT=${OUTPUT:-/tmp}
  37. set -e
  38. rm -rf "${PKG}"
  39. mkdir -p "${TMP}" "${PKG}" "${OUTPUT}"
  40. cd "${TMP}"
  41. rm -rf "${PRGNAM}"
  42. git clone "${SOURCE}"
  43. cd "${PRGNAM}"
  44. chown -R root:root .
  45. find -L . \
  46. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  47. -o -perm 511 \) -exec chmod 755 {} \; -o \
  48. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  49. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  50. make install \
  51. PREFIX=/usr \
  52. DESTDIR="${PKG}"
  53. find "${PKG}" -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  54. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  55. # Copy palettes,
  56. mkdir -p "${PKG}/usr/share/paleta"
  57. cp -a palettes "${PKG}/usr/share/paleta"
  58. mkdir -p "${PKG}/usr/doc/${PRGNAM}-${VERSION}"
  59. cp -a \
  60. LICENSE README \
  61. "${PKG}/usr/doc/${PRGNAM}-${VERSION}"
  62. cat "${CWD}/${PRGNAM}.SlackBuild" > "${PKG}/usr/doc/${PRGNAM}-${VERSION}/${PRGNAM}.SlackBuild"
  63. mkdir -p "${PKG}/install"
  64. cat "${CWD}/slack-desc" > "${PKG}/install/slack-desc"
  65. cd "${PKG}"
  66. /sbin/makepkg -l y -c n "${OUTPUT}/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.${PKGTYPE}"