python3-cached-property.SlackBuild 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #!/bin/sh
  2. #
  3. # Slackware build script for cached-property
  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=python3-cached-property
  21. SRCNAM=${PRGNAM#*-}
  22. VERSION=${VERSION:-1.5.2}
  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 "${SRCNAM}-${VERSION}"
  42. tar xvf "${CWD}/${SRCNAM}-${VERSION}.tar.gz"
  43. cd "${SRCNAM}-${VERSION}"
  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. python3 setup.py build
  51. python3 setup.py install \
  52. --prefix=/usr \
  53. --root="${PKG}" \
  54. --optimize=1 \
  55. --skip-build
  56. find "${PKG}" -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  57. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  58. mkdir -p "${PKG}/usr/doc/${PRGNAM}-${VERSION}"
  59. cp -a \
  60. AUTHORS.rst CONTRIBUTING.rst HISTORY.rst LICENSE README.rst requirements.txt \
  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}"