source: npl/X/blackbox/blackbox.SlackBuild.orig @ c5c522c

gcc484ntopperl-5.22
Last change on this file since c5c522c was c5c522c, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

initial commit, transferred from cleaned syn3 svn tree

  • Property mode set to 100755
File size: 6.2 KB
Line 
1#!/bin/sh
2
3# Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012  Patrick J. Volkerding, Sebeka, MN, USA
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
23# http://downloads.sourceforge.net/project/blackboxwm/blackboxwm/Blackbox%200.70.1/blackbox-0.70.1.tar.bz2
24# http://downloads.sourceforge.net/project/bbkeys/bbkeys/0.9.1/bbkeys-0.9.1.tar.gz
25
26PKGNAM=blackbox
27VERSION=${VERSION:-0.70.1}
28BBKEYSVER=${BBKEYSVER:-0.9.1}
29BUILD=${BUILD:-7}
30NUMJOBS=${NUMJOBS:-" -j7 "}
31
32# Automatically determine the architecture we're building on:
33if [ -z "$ARCH" ]; then
34  case "$( uname -m )" in
35    i?86) export ARCH=i486 ;;
36    arm*) export ARCH=arm ;;
37    # Unless $ARCH is already set, use uname -m for all other archs:
38       *) export ARCH=$( uname -m ) ;;
39  esac
40fi
41
42# Determine the CFLAGS for the known architectures:
43case $ARCH in
44  i486)   export SLKCFLAGS="-O2 -march=i486 -mtune=i686"
45          export LIBDIRSUFFIX=""
46          export ARCHQUADLET="" ;;
47  i686)   export SLKCFLAGS="-O2 -march=i686 -mtune=i686"
48          export LIBDIRSUFFIX=""
49          export ARCHQUADLET="" ;;
50  x86_64) export SLKCFLAGS="-O2 -fPIC"
51          export LIBDIRSUFFIX="64"
52          export ARCHQUADLET="" ;;
53  s390)   export SLKCFLAGS="-O2"
54          export LIBDIRSUFFIX=""
55          export ARCHQUADLET="" ;;
56  arm)    export SLKCFLAGS="-O2 -march=armv4t"
57          export LIBDIRSUFFIX=""
58          export ARCHQUADLET="-gnueabi" ;;
59  *)      export SLKCFLAGS="-O2"
60          export LIBDIRSUFFIX=""
61          export ARCHQUADLET="" ;;
62esac
63
64
65CWD=$(pwd)
66TMP=${TMP:-/tmp}
67PKG=$TMP/package-${PKGNAM}
68rm -rf $PKG
69mkdir -p $TMP $PKG
70
71cd $TMP
72rm -rf ${PKGNAM}-${VERSION}
73tar xvf $CWD/${PKGNAM}-$VERSION.tar.xz || exit 1
74cd ${PKGNAM}-$VERSION || exit 1
75
76# Make sure ownerships and permissions are sane:
77chown -R root:root .
78find . \
79  \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
80  -exec chmod 755 {} \; -o \
81  \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
82  -exec chmod 644 {} \;
83
84# Build fix for gcc-4:
85zcat $CWD/blackbox-0.70.1-gcc-4.3.patch.gz | patch --verbose -p1 || exit 1
86
87# Build fix for libX11-1.5+
88zcat $CWD/textpropertytostring-unconditional.diff.gz | patch --verbose -p1 || exit 1
89
90# Configure:
91CFLAGS="$SLKCFLAGS" \
92CPPFLAGS="-I/usr/include/freetype2 " \
93./configure \
94  --prefix=/usr \
95  --libdir=/usr/lib${LIBDIRSUFFIX} \
96  --enable-shape \
97  --enable-slit \
98  --enable-interlace \
99  --enable-nls \
100  --enable-shared=yes \
101  --enable-static=no \
102  --enable-timed-cache \
103  --infodir=/usr/info \
104  --mandir=/usr/man \
105  --build=$ARCH-slackware-linux$ARCHQUADLET || exit 1
106
107# Build:
108make $NUMJOBS || make || exit 1
109
110# Install onto filesystem - needed for bbkeys to find libbt:
111make install || exit 1
112
113# Install into package:
114make install DESTDIR=$PKG || exit 1
115mkdir -p $PKG/etc/X11/xinit
116zcat $CWD/xinitrc.blackbox.gz > $PKG/etc/X11/xinit/xinitrc.blackbox
117chmod 755 $PKG/etc/X11/xinit/xinitrc.blackbox
118zcat $CWD/startblackbox.gz > $PKG/usr/bin/startblackbox
119chmod 755 $PKG/usr/bin/startblackbox
120
121# Add a documentation directory:
122mkdir -p $PKG/usr/doc/${PKGNAM}-$VERSION
123cp -a \
124  AUTHORS INSTALL LICENSE README* TODO \
125  $PKG/usr/doc/${PKGNAM}-$VERSION
126
127# If there's a ChangeLog, installing at least part of the recent history
128# is useful, but don't let it get totally out of control:
129if [ -r ChangeLog ]; then
130  DOCSDIR=$(echo $PKG/usr/doc/${PKGNAM}-$VERSION)
131  cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
132  touch -r ChangeLog $DOCSDIR/ChangeLog
133fi
134
135######################################
136# Compile bbkeys program for blackbox:
137cd $TMP
138rm -rf bbkeys-${BBKEYSVER}
139tar xvf $CWD/bbkeys-${BBKEYSVER}.tar.xz
140cd bbkeys-${BBKEYSVER} || exit 1
141
142# Make sure ownerships and permissions are sane:
143chown -R root:root .
144find . \
145  \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
146  -exec chmod 755 {} \; -o \
147  \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
148  -exec chmod 644 {} \;
149
150# Configure:
151CFLAGS="$SLKCFLAGS" \
152CPPFLAGS="-I/usr/include/bt" \
153./configure \
154  --prefix=/usr \
155  --infodir=/usr/info \
156  --libdir=/usr/lib${LIBDIRSUFFIX} \
157  --mandir=/usr/man \
158  --docdir=/usr/doc/bbkeys-$BBKEYSVER \
159  --build=$ARCH-slackware-linux$ARCHQUADLET || exit 1
160
161# --docdir isn't honoured:
162sed -i 's?^docdir.*=.*?docdir = /usr/doc/bbkeys-'"$BBKEYSVER"'?g' Makefile
163
164# If there's a ChangeLog, installing at least part of the recent history
165# is useful, but don't let it get totally out of control:
166
167# Build and install into package:
168make $NUMJOBS || make || exit 1
169make install DESTDIR=$PKG || exit 1
170
171# Strip binaries:
172find $PKG | xargs file | grep -e "executable" -e "shared object" \
173  | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
174
175# Compress and link manpages, if any:
176if [ -d $PKG/usr/man ]; then
177  ( cd $PKG/usr/man
178    for manpagedir in $(find . -type d -name "man*") ; do
179      ( cd $manpagedir
180        for eachpage in $( find . -type l -maxdepth 1) ; do
181          ln -s $( readlink $eachpage ).gz $eachpage.gz
182          rm $eachpage
183        done
184        gzip -9 *.?
185      )
186    done
187  )
188fi
189
190# Set doc permissions:
191find $PKG/usr/doc -type f -print0 | xargs -0 chmod 644
192find $PKG/usr/doc -type d -print0 | xargs -0 chmod 755
193
194mkdir -p $PKG/install
195install -vpm644 $CWD/slack-desc $PKG/install/
196
197cd $PKG
198/sbin/makepkg -l y -c n $TMP/${PKGNAM}-$VERSION-$ARCH-$BUILD.txz
Note: See TracBrowser for help on using the repository browser.