wmix.SlackBuild 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. #!/bin/bash
  2. # Slackware build script for <wmix>
  3. # Copyright <2018> <Michael Heras>
  4. # All rights reserved.
  5. #
  6. # Redistribution and use of this script, with or without modification, is
  7. # permitted provided that the following conditions are met:
  8. #
  9. # 1. Redistributions of this script must retain the above copyright
  10. # notice, this list of conditions and the following disclaimer.
  11. #
  12. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  13. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  15. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  17. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  18. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  19. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  20. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  21. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  22. # Now maintained by B. Watson <urchlay@slackware.uk>
  23. # 20221229 bkw: BUILD=2, fix icon size (was 33x32, d'oh!)
  24. # 20220208 bkw:
  25. # - take over maintenance.
  26. # - update for v3.5.
  27. # - add an icon and doinst.sh
  28. # - don't install useless INSTALL in doc dir.
  29. # - do install sample.wmixrc in doc dir.
  30. # - add missing option to the man page.
  31. cd $(dirname $0) ; CWD=$(pwd)
  32. PRGNAM=wmix
  33. VERSION=${VERSION:-3.5}
  34. BUILD=${BUILD:-2}
  35. TAG=${TAG:-_SBo}
  36. PKGTYPE=${PKGTYPE:-tgz}
  37. if [ -z "$ARCH" ]; then
  38. case "$( uname -m )" in
  39. i?86) ARCH=i586 ;;
  40. arm*) ARCH=arm ;;
  41. *) ARCH=$( uname -m ) ;;
  42. esac
  43. fi
  44. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  45. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  46. exit 0
  47. fi
  48. TMP=${TMP:-/tmp/SBo}
  49. PKG=$TMP/package-$PRGNAM
  50. OUTPUT=${OUTPUT:-/tmp}
  51. if [ "$ARCH" = "i586" ]; then
  52. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  53. LIBDIRSUFFIX=""
  54. elif [ "$ARCH" = "i686" ]; then
  55. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  56. LIBDIRSUFFIX=""
  57. elif [ "$ARCH" = "x86_64" ]; then
  58. SLKCFLAGS="-O2 -fPIC"
  59. LIBDIRSUFFIX="64"
  60. else
  61. SLKCFLAGS="-O2"
  62. LIBDIRSUFFIX=""
  63. fi
  64. set -e
  65. rm -rf $PKG
  66. mkdir -p $TMP $PKG $OUTPUT
  67. cd $TMP
  68. rm -rf $PRGNAM-$VERSION
  69. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  70. cd $PRGNAM-$VERSION
  71. chown -R root:root .
  72. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  73. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  74. # 20220208 bkw: make the .desktop validate, clean up the description,
  75. # and add the icon.
  76. sed -i -e '/^Categories/s|$|;AudioVideo|' \
  77. -e 's/using the.*/for ALSA or OSS/' \
  78. -e '$aIcon=wmix' \
  79. $PRGNAM.desktop
  80. # 20220208 bkw: document the -a option and api= config command.
  81. patch -p1 < $CWD/manpage.diff
  82. CFLAGS="$SLKCFLAGS" \
  83. CXXFLAGS="$SLKCFLAGS" \
  84. ./configure \
  85. --prefix=/usr \
  86. --libdir=/usr/lib${LIBDIRSUFFIX} \
  87. --sysconfdir=/etc \
  88. --localstatedir=/var \
  89. --mandir=/usr/man \
  90. --docdir=/usr/doc/$PRGNAM-$VERSION \
  91. --build=$ARCH-slackware-linux
  92. make
  93. make install-strip DESTDIR=$PKG
  94. gzip -9 $PKG/usr/man/man?/*
  95. # 20220208 bkw: icon made by editing a screenshot of the dockapp.
  96. mkdir -p $PKG/usr/share/icons/hicolor/32x32/apps $PKG/usr/share/pixmaps
  97. cat $CWD/$PRGNAM.png > $PKG/usr/share/icons/hicolor/32x32/apps/$PRGNAM.png
  98. ln -s ../icons/hicolor/32x32/apps/$PRGNAM.png $PKG/usr/share/pixmaps/$PRGNAM.png
  99. PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
  100. mkdir -p $PKGDOC
  101. cp -a AUTHORS BUGS COPYING NEWS README sample.wmixrc $PKGDOC
  102. cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild
  103. mkdir -p $PKG/install
  104. cat $CWD/slack-desc > $PKG/install/slack-desc
  105. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  106. cd $PKG
  107. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE