exaile.SlackBuild 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. #!/bin/bash
  2. # Slackware build script for exaile
  3. # Written by Marco Cecchetti (mrc.ildp@gmail.com)
  4. # Update by Diogo Leal (diogo@diogoleal.com)
  5. # Copyright 2017 Ekin Akoglu, Erdemli, Mersin, Turkey | ekinakoglu@gmail.com
  6. # Ryan P.C. McQuen | Everett, WA | ryanpcmcquen@member.fsf.org
  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 2 of the License, or
  10. # (at your option) any later version, with the following exception:
  11. # the text of the GPL license may be omitted.
  12. # This program is distributed in the hope that it will be useful, but
  13. # without any warranty; without even the implied warranty of
  14. # merchantability or fitness for a particular purpose. Compiling,
  15. # interpreting, executing or merely reading the text of the program
  16. # may result in lapses of consciousness and/or very being, up to and
  17. # including the end of all existence and the Universe as we know it.
  18. # See the GNU General Public License for more details.
  19. # You may have received a copy of the GNU General Public License
  20. # along with this program (most likely, a file named COPYING). If
  21. # not, see <http://www.gnu.org/licenses/>.
  22. cd $(dirname $0) ; CWD=$(pwd)
  23. PRGNAM=exaile
  24. VERSION=${VERSION:-3.4.5}
  25. BUILD=${BUILD:-1}
  26. TAG=${TAG:-_SBo}
  27. PKGTYPE=${PKGTYPE:-tgz}
  28. if [ -z "$ARCH" ]; then
  29. case "$( uname -m )" in
  30. i?86) ARCH=i586 ;;
  31. arm*) ARCH=arm ;;
  32. *) ARCH=$( uname -m ) ;;
  33. esac
  34. fi
  35. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  36. # the name of the created package would be, and then exit. This information
  37. # could be useful to other scripts.
  38. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  39. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  40. exit 0
  41. fi
  42. TMP=${TMP:-/tmp/SBo}
  43. PKG=$TMP/package-$PRGNAM
  44. OUTPUT=${OUTPUT:-/tmp}
  45. if [ "$ARCH" = "i586" ]; then
  46. LIBDIRSUFFIX=""
  47. elif [ "$ARCH" = "i686" ]; then
  48. LIBDIRSUFFIX=""
  49. elif [ "$ARCH" = "x86_64" ]; then
  50. LIBDIRSUFFIX="64"
  51. else
  52. LIBDIRSUFFIX=""
  53. fi
  54. set -e
  55. rm -rf $PKG
  56. mkdir -p $TMP $PKG $OUTPUT
  57. cd $TMP
  58. rm -rf $PRGNAM-$VERSION
  59. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  60. cd $PRGNAM-$VERSION
  61. chown -R root:root .
  62. find -L . \
  63. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  64. -o -perm 511 \) -exec chmod 755 {} \; -o \
  65. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  66. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  67. ## Fix manpage location.
  68. sed -i -e 's|share/man|man|g' Makefile
  69. make
  70. PREFIX=/usr \
  71. LIBINSTALLDIR=/lib${LIBDIRSUFFIX} \
  72. make install DESTDIR=$PKG
  73. mv $PKG/etc/xdg/exaile/settings.ini $PKG/etc/xdg/exaile/settings.ini.new
  74. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  75. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  76. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  77. cp -a \
  78. COPYING DEPS INSTALL README \
  79. $PKG/usr/doc/$PRGNAM-$VERSION
  80. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  81. mkdir -p $PKG/install
  82. cat $CWD/slack-desc > $PKG/install/slack-desc
  83. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  84. cd $PKG
  85. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE