midillo.SlackBuild 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. #!/bin/bash
  2. # Slackware build script for midillo
  3. # Written by B. Watson (urchlay@slackware.uk)
  4. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  5. # 20211202 bkw: BUILD=2, remove .la files.
  6. cd $(dirname $0) ; CWD=$(pwd)
  7. PRGNAM=midillo
  8. VERSION=${VERSION:-0.0}
  9. BUILD=${BUILD:-2}
  10. TAG=${TAG:-_SBo}
  11. PKGTYPE=${PKGTYPE:-tgz}
  12. if [ -z "$ARCH" ]; then
  13. case "$( uname -m )" in
  14. i?86) ARCH=i586 ;;
  15. arm*) ARCH=arm ;;
  16. *) ARCH=$( uname -m ) ;;
  17. esac
  18. fi
  19. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  20. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  21. exit 0
  22. fi
  23. TMP=${TMP:-/tmp/SBo}
  24. PKG=$TMP/package-$PRGNAM
  25. OUTPUT=${OUTPUT:-/tmp}
  26. if [ "$ARCH" = "i586" ]; then
  27. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  28. LIBDIRSUFFIX=""
  29. elif [ "$ARCH" = "i686" ]; then
  30. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  31. LIBDIRSUFFIX=""
  32. elif [ "$ARCH" = "x86_64" ]; then
  33. SLKCFLAGS="-O2 -fPIC"
  34. LIBDIRSUFFIX="64"
  35. else
  36. SLKCFLAGS="-O2"
  37. LIBDIRSUFFIX=""
  38. fi
  39. set -e
  40. # The konforka library is the midillo author's "convenience library",
  41. # required by all his projects. Since I only plan to submit midillo,
  42. # I don't see any value in having a separate konforka package.
  43. LIBNAM=konforka
  44. LIBVER=0.0
  45. rm -rf $PKG
  46. mkdir -p $TMP $PKG $OUTPUT
  47. cd $TMP
  48. rm -rf $LIBNAM-$LIBVER
  49. tar xvf $CWD/$LIBNAM-$LIBVER.tar.bz2
  50. cd $LIBNAM-$LIBVER
  51. chown -R root:root .
  52. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  53. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  54. patch -p1 < $CWD/${LIBNAM}_compile_fix.diff
  55. # the shipped autoconf stuff is broken
  56. autoreconf -fi
  57. CFLAGS="$SLKCFLAGS" \
  58. CXXFLAGS="$SLKCFLAGS" \
  59. ./configure \
  60. --prefix=/usr \
  61. --libdir=/usr/lib${LIBDIRSUFFIX} \
  62. --sysconfdir=/etc \
  63. --localstatedir=/var \
  64. --mandir=/usr/man \
  65. --enable-shared \
  66. --disable-static \
  67. --build=$ARCH-slackware-linux
  68. make
  69. make install-strip DESTDIR=$PKG
  70. cd $TMP
  71. rm -rf $PRGNAM-$VERSION
  72. tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
  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. patch -p1 < $CWD/${PRGNAM}_compile_fix.diff
  78. KONFORKA_CFLAGS=-I$PKG/usr/include \
  79. KONFORKA_LIBS="-L$PKG/usr/lib$LIBDIRSUFFIX -l$LIBNAM" \
  80. CFLAGS="$SLKCFLAGS" \
  81. CXXFLAGS="$SLKCFLAGS" \
  82. ./configure \
  83. --prefix=/usr \
  84. --libdir=/usr/lib${LIBDIRSUFFIX} \
  85. --sysconfdir=/etc \
  86. --localstatedir=/var \
  87. --mandir=/usr/man \
  88. --disable-static \
  89. --enable-shared \
  90. --build=$ARCH-slackware-linux
  91. make
  92. make install-strip DESTDIR=$PKG
  93. gzip -9 $PKG/usr/man/man*/*
  94. rm -f $PKG/usr/lib*/*.la
  95. # README and ChangeLog are 0-byte placeholders
  96. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  97. cp -a AUTHORS COPYING NEWS $PKG/usr/doc/$PRGNAM-$VERSION
  98. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  99. mkdir -p $PKG/install
  100. cat $CWD/slack-desc > $PKG/install/slack-desc
  101. cd $PKG
  102. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE