lxlauncher.SlackBuild 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. #!/bin/bash
  2. # $Id: lxlauncher.SlackBuild,v 1.3 2009/09/11 20:45:23 root Exp root $
  3. # Copyright (c) 2008-2009 Eric Hameleers, Eindhoven, NL
  4. # Copyright 2010-2016 Matteo Bernardini <ponce@slackbuilds.org, Pisa, Italy
  5. # All rights reserved.
  6. #
  7. # Permission to use, copy, modify, and distribute this software for
  8. # any purpose with or without fee is hereby granted, provided that
  9. # the above copyright notice and this permission notice appear in all
  10. # copies.
  11. #
  12. # THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  13. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  15. # IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  16. # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  18. # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19. # USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  20. # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  21. # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  22. # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  23. # SUCH DAMAGE.
  24. # -----------------------------------------------------------------------------
  25. #
  26. # Slackware SlackBuild script
  27. # ===========================
  28. # By: Eric Hameleers <alien@slackware.com>
  29. # For: lxlauncher
  30. # Descr: Application launcher for Asus Eee pc
  31. # URL: http://lxde.sourceforge.net/
  32. # Needs: lxmenu-data
  33. # Changelog:
  34. # 0.2-1: 29/jun/2008 by Eric Hameleers <alien@slackware.com>
  35. # * Initial build.
  36. # 0.2.1-1: 11/sep/2009 by Eric Hameleers <alien@slackware.com>
  37. # * Update.
  38. # 20100903_3480629: 12/sep/2010 by Matteo Bernardini <ponce@slackbuilds.org>
  39. # * Adapted to slackbuilds.org's autotools template.
  40. # * updated to git snapshot.
  41. # 0.2.2-1: 26/dec/2011 by Matteo Bernardini <ponce@slackbuilds.org>
  42. # * update.
  43. # 0.2.3-1: 03/sep/2014 by Matteo Bernardini <ponce@slackbuilds.org>
  44. # * update.
  45. # 0.2.5-1: 10/jul/2016 by Matteo Bernardini <ponce@slackbuilds.org>
  46. # * update.
  47. #
  48. # Run 'sh lxlauncher.SlackBuild' to build a Slackware package.
  49. # The package is created in /tmp .
  50. # Install using 'installpkg'.
  51. #
  52. # -----------------------------------------------------------------------------
  53. cd $(dirname $0) ; CWD=$(pwd)
  54. PRGNAM=lxlauncher
  55. VERSION=${VERSION:-0.2.5}
  56. BUILD=${BUILD:-1}
  57. TAG=${TAG:-_SBo}
  58. PKGTYPE=${PKGTYPE:-tgz}
  59. if [ -z "$ARCH" ]; then
  60. case "$( uname -m )" in
  61. i?86) ARCH=i586 ;;
  62. arm*) ARCH=arm ;;
  63. *) ARCH=$( uname -m ) ;;
  64. esac
  65. fi
  66. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  67. # the name of the created package would be, and then exit. This information
  68. # could be useful to other scripts.
  69. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  70. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  71. exit 0
  72. fi
  73. TMP=${TMP:-/tmp/SBo}
  74. PKG=$TMP/package-$PRGNAM
  75. OUTPUT=${OUTPUT:-/tmp}
  76. if [ "$ARCH" = "i586" ]; then
  77. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  78. LIBDIRSUFFIX=""
  79. elif [ "$ARCH" = "i686" ]; then
  80. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  81. LIBDIRSUFFIX=""
  82. elif [ "$ARCH" = "x86_64" ]; then
  83. SLKCFLAGS="-O2 -fPIC"
  84. LIBDIRSUFFIX="64"
  85. else
  86. SLKCFLAGS="-O2"
  87. LIBDIRSUFFIX=""
  88. fi
  89. DOCS="AUTHORS COPYING NEWS README"
  90. set -e
  91. rm -rf $PKG
  92. mkdir -p $TMP $PKG $OUTPUT
  93. cd $TMP
  94. rm -rf $PRGNAM-$VERSION
  95. tar xvf $CWD/$PRGNAM-$VERSION.tar.?z
  96. cd $PRGNAM-$VERSION
  97. chown -R root:root .
  98. find -L . \
  99. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  100. -o -perm 511 \) -exec chmod 755 {} \; -o \
  101. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  102. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  103. sh autogen.sh || true
  104. CXXFLAGS="$SLKCFLAGS" \
  105. CFLAGS="$SLKCFLAGS" \
  106. ./configure \
  107. --prefix=/usr \
  108. --libdir=/usr/lib${LIBDIRSUFFIX} \
  109. --localstatedir=/var \
  110. --sysconfdir=/etc \
  111. --program-prefix= \
  112. --program-suffix= \
  113. --mandir=/usr/man \
  114. --build=$ARCH-slackware-linux
  115. make
  116. make install-strip DESTDIR=$PKG
  117. find $PKG/usr/man -type f -exec gzip -9 {} \;
  118. for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  119. # Don't clobber configuration files
  120. ( cd $PKG/etc/xdg
  121. for i in lxlauncher/gtkrc lxlauncher/settings.conf menus/lxlauncher-applications.menu; do
  122. mv $i $i.new
  123. done )
  124. # Add documentation:
  125. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  126. cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION || true
  127. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  128. chown -R root:root $PKG/usr/doc/$PRGNAM-$VERSION
  129. find $PKG/usr/doc -type f -exec chmod 644 {} \;
  130. mkdir -p $PKG/install
  131. cat $CWD/slack-desc > $PKG/install/slack-desc
  132. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  133. cd $PKG
  134. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE