wmii.SlackBuild 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. #!/bin/bash
  2. # Slackware build script for wmii
  3. # Now maintained by Dave Woodfall <dave@slackbuilds.org>
  4. # Copyright (c) 2011, Marco Bonetti <sid77@slackware.it>
  5. # All rights reserved.
  6. # Maintenance adopted 11.02.2015 Glenn Becker <glenn.becker@gmail.com>
  7. #
  8. # Redistribution and use in source and binary forms, with or without
  9. # modification, are permitted provided that the following conditions are met:
  10. # 1.- Redistributions of source code must retain the above copyright
  11. # notice, this list of conditions and the following disclaimer.
  12. #
  13. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY
  14. # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  15. # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  16. # DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
  17. # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  18. # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  19. # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  20. # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  21. # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  22. # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  23. # Thanks to selkfoster <selkfoster@gmail.com>
  24. cd $(dirname $0) ; CWD=$(pwd)
  25. PRGNAM=wmii
  26. SRCNAM=wmii+ixp
  27. VERSION=${VERSION:-3.9.2}
  28. BUILD=${BUILD:-4}
  29. TAG=${TAG:-_SBo}
  30. PKGTYPE=${PKGTYPE:-tgz}
  31. if [ -z "$ARCH" ]; then
  32. case "$( uname -m )" in
  33. i?86) ARCH=i586 ;;
  34. arm*) ARCH=arm ;;
  35. *) ARCH=$( uname -m ) ;;
  36. esac
  37. fi
  38. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  39. # the name of the created package would be, and then exit. This information
  40. # could be useful to other scripts.
  41. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  42. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  43. exit 0
  44. fi
  45. TMP=${TMP:-/tmp/SBo}
  46. PKG=$TMP/package-$PRGNAM
  47. OUTPUT=${OUTPUT:-/tmp}
  48. if [ "$ARCH" = "i586" ]; then
  49. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  50. LIBDIRSUFFIX=""
  51. elif [ "$ARCH" = "i686" ]; then
  52. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  53. LIBDIRSUFFIX=""
  54. elif [ "$ARCH" = "x86_64" ]; then
  55. SLKCFLAGS="-O2 -fPIC"
  56. LIBDIRSUFFIX="64"
  57. else
  58. SLKCFLAGS="-O2"
  59. LIBDIRSUFFIX=""
  60. fi
  61. set -e
  62. rm -rf $PKG
  63. mkdir -p $TMP $PKG $OUTPUT
  64. cd $TMP
  65. rm -rf $SRCNAM-$VERSION
  66. tar xvf $CWD/$SRCNAM-$VERSION.tbz
  67. cd $SRCNAM-$VERSION
  68. chown -R root:root .
  69. find -L . \
  70. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  71. -exec chmod 755 {} \; -o \
  72. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  73. -exec chmod 644 {} \;
  74. # Fixup config.mk
  75. patch -p1 < $CWD/wmii-3.9.2-config_mk.diff
  76. # Fixup mk/hdr.mk
  77. patch -p1 < $CWD/wmii-3.9.2-mk_hdr_mk.diff
  78. # Fix the man pages
  79. sed -zi 's,\.P[^@]@DOCDIR@/wmii\.pdf,,' man/wmii.1
  80. sed -i "s,@DOCDIR@,/usr/doc/$PRGNAM-$VERSION,g" man/wmii.1
  81. sed -i "s,@CONFPREFIX@,/etc,g" man/wmii.1
  82. export CFLAGS="$SLKCFLAGS -fcommon"
  83. LDFLAGS="-lX11 -lXrender" \
  84. make \
  85. OPT="$SLKCFLAGS" \
  86. PREFIX=/usr \
  87. MAN=/usr/man \
  88. ETC=/etc \
  89. DOC=/usr/doc/$PRGNAM-$VERSION \
  90. LIBDIRSUFFIX=${LIBDIRSUFFIX}
  91. make install \
  92. OPT="$SLKCFLAGS" \
  93. PREFIX=$PKG/usr \
  94. MAN=$PKG/usr/man \
  95. ETC=$PKG/etc \
  96. DOC=$PKG/usr/doc/$PRGNAM-$VERSION \
  97. LIBDIRSUFFIX=${LIBDIRSUFFIX}
  98. # Add wmii to xwmconfig's list...
  99. install -D -m 0755 $CWD/xinitrc.wmii $PKG/etc/X11/xinit/xinitrc.wmii
  100. # ...and the required startup script
  101. install -D -m 0755 $CWD/wmii.xinit $PKG/usr/bin/wmii.xinit
  102. # Add a simple wmii.desktop so it can be started from kdm
  103. install -D -m 0644 $CWD/wmii.desktop $PKG/usr/share/apps/kdm/sessions/wmii.desktop
  104. # Don't clobber config files
  105. mv $PKG/etc/wmii/welcome $PKG/etc/wmii/welcome.new
  106. mv $PKG/etc/wmii/wmiirc $PKG/etc/wmii/wmiirc.new
  107. mv $PKG/etc/wmii/plan9port/wmiirc $PKG/etc/wmii/plan9port/wmiirc.new
  108. mv $PKG/etc/wmii/python/wmiirc $PKG/etc/wmii/python/wmiirc.new
  109. mv $PKG/etc/wmii/ruby/wmiirc $PKG/etc/wmii/ruby/wmiirc.new
  110. find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
  111. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  112. find $PKG/usr/man -type f -exec gzip -9 {} \;
  113. cp -a LICENSE README $PKG/usr/doc/$PRGNAM-$VERSION
  114. # The directories were there, but no files
  115. cp -r alternative_wmiircs $PKG/usr/doc/$PRGNAM-$VERSION
  116. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  117. # hmm?
  118. #( cd $PKG/usr/doc ; ln -s $PRGNAM-$VERSION $PRGNAM )
  119. mkdir -p $PKG/install
  120. cat $CWD/slack-desc > $PKG/install/slack-desc
  121. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  122. cd $PKG
  123. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE