mhsetroot.SlackBuild 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. #!/bin/bash
  2. #
  3. # Slackware build script for mhsetroot
  4. #
  5. # Copyright 2017 Michael Heras USA
  6. # All rights reserved.
  7. #
  8. # Redistribution and use of this script, with or without modification, is
  9. # permitted provided that the following conditions are met:
  10. #
  11. # 1. Redistributions of this script must retain the above copyright
  12. # notice, this list of conditions and the following disclaimer.
  13. #
  14. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
  15. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  16. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  17. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  18. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  19. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  20. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  21. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  22. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  23. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  24. # Now maintained by B. Watson <yalhcru@gmail.com>.
  25. # 20220208 bkw: BUILD=2
  26. # - take over maintenance.
  27. # - install AUTHORS and COPYING to doc dir.
  28. # 20220208 bkw: There is a mhsetroot-2.0 on the sourceforge page,
  29. # but it has issues. There is no documentatation at all (not even a
  30. # README), it aborts with a double-free error every time it exits,
  31. # it creates a "~/mhsetrootimage" when it runs (not in a dot dir), and
  32. # its options are totally incompatible with 1.6.2's. Not updating to
  33. # 2.0, but possibly the 2.x branch will mature someday.
  34. cd $(dirname $0) ; CWD=$(pwd)
  35. PRGNAM=mhsetroot
  36. VERSION=${VERSION:-1.6.2}
  37. BUILD=${BUILD:-1}
  38. TAG=${TAG:-_SBo}
  39. PKGTYPE=${PKGTYPE:-tgz}
  40. if [ -z "$ARCH" ]; then
  41. case "$( uname -m )" in
  42. i?86) ARCH=i586 ;;
  43. arm*) ARCH=arm ;;
  44. *) ARCH=$( uname -m ) ;;
  45. esac
  46. fi
  47. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  48. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  49. exit 0
  50. fi
  51. TMP=${TMP:-/tmp/SBo}
  52. PKG=$TMP/package-$PRGNAM
  53. OUTPUT=${OUTPUT:-/tmp}
  54. if [ "$ARCH" = "i586" ]; then
  55. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  56. LIBDIRSUFFIX=""
  57. elif [ "$ARCH" = "i686" ]; then
  58. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  59. LIBDIRSUFFIX=""
  60. elif [ "$ARCH" = "x86_64" ]; then
  61. SLKCFLAGS="-O2 -fPIC"
  62. LIBDIRSUFFIX="64"
  63. else
  64. SLKCFLAGS="-O2"
  65. LIBDIRSUFFIX=""
  66. fi
  67. set -ue
  68. rm -rf $PKG
  69. mkdir -p $TMP $PKG $OUTPUT
  70. cd $TMP
  71. rm -rf $PRGNAM-$VERSION
  72. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  73. cd $PRGNAM-$VERSION
  74. chown -R root:root .
  75. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  76. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  77. CFLAGS="$SLKCFLAGS" \
  78. CXXFLAGS="$SLKCFLAGS -std=c++11" \
  79. ./configure \
  80. --prefix=/usr \
  81. --build=$ARCH-slackware-linux
  82. make
  83. make install-strip DESTDIR=$PKG
  84. PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
  85. mkdir -p $PKGDOC
  86. cp -a AUTHORS COPYING ChangeLog README $PKGDOC
  87. cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$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