tuxpaint.SlackBuild 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. #!/bin/bash
  2. # Slackware build script for tuxpaint
  3. # Written by Pablo Santamaria (pablosantamaria@gmail.com)
  4. # Modified by Willy Sudiarto Raharjo <willysr@slackware-id.org>
  5. # Taken over maintenance (and some updates) by Tim Dickson (dickson.tim@googlemail.com)
  6. # added tuxpaint-config 2019-02-11
  7. # 20220222 bkw: Modified by SlackBuilds.org: fix build on 15.0.
  8. # - update for v0.9.27 and config v0.0.18.
  9. # - fix parallel builds.
  10. # - stop spamming the real /usr (ugh).
  11. # 20220610 tim dickson: updated to 0.9.28 . sticking with sdl1 version for now
  12. # 20220629 tim dickson: changed to the sdl2 version
  13. # 20220820 tim dickson: added patch to work with newer SDL2_Pango. should be fixed upstream in next release
  14. # 20230111 bkw: Modified by SlackBuilds.org: BUILD=4, just to force a
  15. # rebuild after libunibreak update to 5.1.
  16. cd $(dirname $0) ; CWD=$(pwd)
  17. PRGNAM=tuxpaint
  18. VERSION=${VERSION:-0.9.28}
  19. CONFVER=${CONFVER:-0.0.19}
  20. BUILD=${BUILD:-4}
  21. TAG=${TAG:-_SBo}
  22. PKGTYPE=${PKGTYPE:-tgz}
  23. if [ -z "$ARCH" ]; then
  24. case "$( uname -m )" in
  25. i?86) ARCH=i586 ;;
  26. arm*) ARCH=arm ;;
  27. *) ARCH=$( uname -m ) ;;
  28. esac
  29. fi
  30. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  31. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  32. exit 0
  33. fi
  34. TMP=${TMP:-/tmp/SBo}
  35. PKG=$TMP/package-$PRGNAM
  36. OUTPUT=${OUTPUT:-/tmp}
  37. if [ "$ARCH" = "i586" ]; then
  38. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  39. LIBDIRSUFFIX=""
  40. elif [ "$ARCH" = "i686" ]; then
  41. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  42. LIBDIRSUFFIX=""
  43. elif [ "$ARCH" = "x86_64" ]; then
  44. SLKCFLAGS="-O2 -fPIC"
  45. LIBDIRSUFFIX="64"
  46. else
  47. SLKCFLAGS="-O2"
  48. LIBDIRSUFFIX=""
  49. fi
  50. set -e
  51. rm -rf $PKG
  52. mkdir -p $TMP $PKG $OUTPUT
  53. cd $TMP
  54. rm -rf $PRGNAM-$VERSION-sdl2
  55. rm -rf $PRGNAM-config-$CONFVER
  56. tar xvf $CWD/$PRGNAM-$VERSION-sdl2.tar.gz
  57. cd $PRGNAM-$VERSION-sdl2
  58. #prevent out-of-tree file if inkscape is installed
  59. export INKSCAPE_PROFILE_DIR=${pwd}/.tmp.inkscape
  60. chown -R root:root .
  61. find -L . \
  62. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  63. -o -perm 511 \) -exec chmod 755 {} \+ -o \
  64. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  65. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
  66. # 20220226 bkw: fix parallel builds.
  67. mkdir trans
  68. # 20220226 bkw: FFS, do NOT attempt to install icons and .desktop
  69. # using the xdg-icon-resource and xdg-desktop-menu tools: these don't
  70. # support DESTDIR or any other way to control where the files get
  71. # installed (meaning they install to the real /usr, not $PKG/usr).
  72. #patch to fix working with newer SDL2_Pango. remove for next version update
  73. patch <$CWD/tuxpaint_SDL2_Pango.patch
  74. sed -i '/^linux_ARCH_INSTALL/s,install-xdg ,,' Makefile
  75. make PREFIX=/usr LIBDIRSUFFIX=$LIBDIRSUFFIX OPTFLAGS="$SLKCFLAGS"
  76. make \
  77. MAN_PREFIX=$PKG/usr/man \
  78. DEVMAN_PREFIX=$PKG/usr/man \
  79. DOC_PREFIX=$PKG/usr/doc/$PRGNAM-$VERSION \
  80. DEVDOC_PREFIX=$PKG/usr/doc/$PRGNAM-$VERSION \
  81. PREFIX=/usr \
  82. LIBDIRSUFFIX=$LIBDIRSUFFIX \
  83. DESTDIR=$PKG \
  84. install
  85. mv $PKG/etc/tuxpaint/tuxpaint.conf $PKG/etc/tuxpaint/tuxpaint.conf.new
  86. mkdir -p $PKG/usr/share/applications
  87. cp src/$PRGNAM.desktop $PKG/usr/share/applications/
  88. # 20220226 bkw: install the icons correctly, to $PKG. Not only were
  89. # they going to the real /usr, they were incorrectly named!
  90. for i in data/images/icon*x*.png; do
  91. px="$( basename $i | cut -dx -f2 | cut -d. -f1 )"
  92. size=${px}x${px}
  93. dir=$PKG/usr/share/icons/hicolor/$size/apps
  94. mkdir -p $dir
  95. cp -a $i $dir/$PRGNAM.png
  96. done
  97. #
  98. #now for tuxpaint-config
  99. #
  100. cd ..
  101. tar xvf $CWD/$PRGNAM-config-$CONFVER.tar.gz
  102. cd $PRGNAM-config-$CONFVER
  103. # 20220226 bkw: fix parallel builds.
  104. mkdir trans
  105. #fix X11 location
  106. sed -i 's_X11R6/i_/i_g' Makefile
  107. make PREFIX=/usr LIBDIRSUFFIX=$LIBDIRSUFFIX OPTFLAGS="$SLKCFLAGS"
  108. make \
  109. MAN_PREFIX=/usr/man \
  110. DEVMAN_PREFIX=/usr/man \
  111. DOC_PREFIX=/usr/doc/$PRGNAM-$VERSION \
  112. DEVDOC_PREFIX=/usr/doc/$PRGNAM-$VERSION \
  113. PREFIX=/usr \
  114. LIBDIRSUFFIX=$LIBDIRSUFFIX \
  115. DESTDIR=$PKG \
  116. install
  117. strip $PKG/usr/bin/tuxpaint{,-config} $PKG/usr/lib*/tuxpaint/plugins/*.so
  118. #fix permissions
  119. chmod 0644 $PKG/usr/man/*/*/tuxpaint.1.gz
  120. chmod 0644 $PKG/usr/man/man1/*.gz
  121. find $PKG/usr/doc/$PRGNAM-$VERSION/ -type f -exec chmod 644 {} \+
  122. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  123. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  124. mkdir -p $PKG/install
  125. cat $CWD/slack-desc > $PKG/install/slack-desc
  126. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  127. cd $PKG
  128. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE