idesk.SlackBuild 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. #!/bin/bash
  2. # Slackware build script for idesk
  3. # Written by B. Watson (yalhcru@gmail.com)
  4. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  5. # Disclaimer:
  6. # idesk is old and unmaintained. I wrote this SlackBuild at the request
  7. # of someone on IRC, and decided "what the hell, I'll submit it". If
  8. # you're reading this because you want to change anything about it, you're
  9. # welcome to take over maintenance of this build (seriously, I don't use
  10. # idesk, beyond running it once and seeing that it worked). The only
  11. # maintenance I'll ever do for this build is to fix any build problems
  12. # on future versions of Slackware (unless upstream suddenly releases a
  13. # new version, but it's been a dead project for almost 10 years now).
  14. cd $(dirname $0) ; CWD=$(pwd)
  15. PRGNAM=idesk
  16. VERSION=${VERSION:-0.7.5}
  17. BUILD=${BUILD:-1}
  18. TAG=${TAG:-_SBo}
  19. PKGTYPE=${PKGTYPE:-tgz}
  20. if [ -z "$ARCH" ]; then
  21. case "$( uname -m )" in
  22. i?86) ARCH=i586 ;;
  23. arm*) ARCH=arm ;;
  24. *) ARCH=$( uname -m ) ;;
  25. esac
  26. fi
  27. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  28. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  29. exit 0
  30. fi
  31. TMP=${TMP:-/tmp/SBo}
  32. PKG=$TMP/package-$PRGNAM
  33. OUTPUT=${OUTPUT:-/tmp}
  34. if [ "$ARCH" = "i586" ]; then
  35. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  36. LIBDIRSUFFIX=""
  37. elif [ "$ARCH" = "i686" ]; then
  38. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  39. LIBDIRSUFFIX=""
  40. elif [ "$ARCH" = "x86_64" ]; then
  41. SLKCFLAGS="-O2 -fPIC"
  42. LIBDIRSUFFIX="64"
  43. else
  44. SLKCFLAGS="-O2"
  45. LIBDIRSUFFIX=""
  46. fi
  47. set -e
  48. rm -rf $PKG
  49. mkdir -p $TMP $PKG $OUTPUT
  50. cd $TMP
  51. rm -rf $PRGNAM-$VERSION
  52. tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
  53. cd $PRGNAM-$VERSION
  54. chown -R root:root .
  55. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  56. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  57. # missing #include files, newer g++ cares more than the ones from 2005.
  58. patch -p1 < $CWD/compilefix.diff
  59. # The next two stanzas allow the program to start up without the user
  60. # having to create or edit any config files. It won't *do* much but at
  61. # least we can tell if it works or not. This seems like a minor deviation
  62. # from the Slackware way, but in reality it lets me automate my testing
  63. # so it ultimately increases the amount of slack in the universe.
  64. # don't abort if ~/.idesktop/ dir doesn't exist (just create it). Seriously,
  65. # that almost belongs on thedailywtf.
  66. patch -p1 < $CWD/create_user_dir.diff
  67. # don't reference /usr/local in default.lnk (which gets installed in
  68. # /usr/share/idesk as well as /usr/doc). Also use kdialog for the
  69. # "about" icon, as Slackware doesn't ship Xdialog.
  70. sed -i \
  71. -e 's,/usr/local,/usr,g' \
  72. -e 's,Xdialog,kdialog,g' \
  73. examples/*
  74. CFLAGS="$SLKCFLAGS" \
  75. CXXFLAGS="$SLKCFLAGS" \
  76. ./configure \
  77. --prefix=/usr \
  78. --libdir=/usr/lib${LIBDIRSUFFIX} \
  79. --sysconfdir=/etc \
  80. --localstatedir=/var \
  81. --mandir=/usr/man \
  82. --build=$ARCH-slackware-linux
  83. make
  84. make install-strip DESTDIR=$PKG
  85. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  86. cp -a AUTHORS COPYING ChangeLog NEWS README TODO examples $PKG/usr/doc/$PRGNAM-$VERSION
  87. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  88. mkdir -p $PKG/install
  89. cat $CWD/slack-desc > $PKG/install/slack-desc
  90. cd $PKG
  91. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE