source: npl/system/gpm/gpm.SlackBuild.orig @ a39aa4c

perl-5.22
Last change on this file since a39aa4c 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: 4.9 KB
Line 
1#!/bin/sh
2
3# Copyright 2008, 2009, 2010, 2013, 2014  Patrick J. Volkerding, Sebeka, Minnesota, 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# by: volkerdi@slackware.com
24
25VERSION=1.20.7
26BUILD=${BUILD:-3}
27
28# Automatically determine the architecture we're building on:
29if [ -z "$ARCH" ]; then
30  case "$( uname -m )" in
31    i?86) export ARCH=i486 ;;
32    arm*) export ARCH=arm ;;
33    # Unless $ARCH is already set, use uname -m for all other archs:
34       *) export ARCH=$( uname -m ) ;;
35  esac
36fi
37
38CWD=$(pwd)
39TMP=${TMP:-/tmp}
40PKG=$TMP/package-gpm
41
42if [ "$ARCH" = "i486" ]; then
43  SLKCFLAGS="-O2 -march=i486 -mtune=i686"
44  LIBDIRSUFFIX=""
45elif [ "$ARCH" = "s390" ]; then
46  SLKCFLAGS="-O2"
47  LIBDIRSUFFIX=""
48elif [ "$ARCH" = "x86_64" ]; then
49  SLKCFLAGS="-O2 -fPIC"
50  LIBDIRSUFFIX="64"
51fi
52
53rm -rf $PKG
54mkdir -p $TMP $PKG
55
56cd $TMP
57rm -rf gpm-$VERSION || exit 1
58tar xvf $CWD/gpm-$VERSION.tar.xz || exit 1
59cd gpm-$VERSION || exit 1
60
61chown -R root:root .
62find . \
63  \( -perm 700 -o -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
64  -exec chmod 755 {} \; -o \
65  \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
66  -exec chmod 644 {} \;
67
68zcat $CWD/gpm-1.20.1-lib-silent.patch.gz | patch -p1 --verbose || exit 1
69zcat $CWD/gpm-1.20.5-close-fds.patch.gz | patch -p1 --verbose || exit 1
70zcat $CWD/gpm-1.20.1-select-1.patch.gz | patch -p1 --verbose || exit 1
71
72sh autogen.sh
73
74# This is *supposed* to prevent linking libgpm.so with -lncurses,
75# but for some reason it doesn't have the desired effect here.
76# Any ideas?  The patch is supposed to resolve a circular dependency
77# between libgpm.so and libncurses.so.  I don't notice any ill effects
78# here, but perhaps the problem would occur if prelinking was used.
79# Also, ncurses has not shown an ldd link to libgpm for several releases,
80# so perhaps any problem that existed was fixed on their end.
81# NOTE:  Since this isn't preventing gpm from linking to ncurses, I'm
82# commenting this patch out until we understand better if it's even
83# useful for anything.  Half a patch seems worse than no patch.
84#zcat $CWD/gpm-1.20.1-weak-wgetch.patch.gz | patch -p1 --verbose || exit 1
85
86# Since we just patched configure.ac, run this again to carry the change
87# into configure:
88autoconf
89
90CFLAGS="$SLKCFLAGS" \
91./configure \
92  --prefix=/usr \
93  --sysconfdir=/etc \
94  --libdir=/usr/lib${LIBDIRSUFFIX} \
95  --build=$ARCH-slackware-linux
96
97make || exit 1
98make install DESTDIR=$PKG || exit 1
99
100# Emacs ships better versions of these:
101rm -rf $PKG/usr/share/emacs
102
103chmod 755 $PKG/usr/lib${LIBDIRSUFFIX}/libgpm.so.*
104mkdir $PKG/lib${LIBDIRSUFFIX}
105mv $PKG/usr/lib${LIBDIRSUFFIX}/libgpm.so.* $PKG/lib${LIBDIRSUFFIX}
106rm -f $PKG/usr/lib${LIBDIRSUFFIX}/libgpm.so
107( cd $PKG/usr/lib${LIBDIRSUFFIX}
108  ln -sf ../../lib${LIBDIRSUFFIX}/libgpm.so.? libgpm.so )
109
110zcat $CWD/inputattach.c.gz > inputattach.c
111gcc $SLKCFLAGS -o inputattach inputattach.c || exit
112cat inputattach > $PKG/usr/bin/inputattach
113
114mkdir -p $PKG/etc/rc.d
115
116( cd conf
117  cat gpm-root.conf > $PKG/etc/gpm-root.conf
118  cat gpm-syn.conf > $PKG/etc/gpm-syn.conf
119  cat gpm-twiddler.conf > $PKG/etc/gpm-twiddler.conf
120)
121
122mv $PKG/usr/share/{info,man} $PKG/usr
123gzip -9 $PKG/usr/man/man*/*.?
124gzip -9 $PKG/usr/info/*
125
126mkdir -p $PKG/usr/doc/gpm-$VERSION
127cp -a \
128  BUGS COPYING* Changelog Changes MANIFEST README* TODO \
129  doc/{Announce,FAQ,HACK_GPM,README*,changelog} \
130  $PKG/usr/doc/gpm-$VERSION
131
132zcat $CWD/mouseconfig.gz > $PKG/usr/sbin/mouseconfig
133chmod 755 $PKG/usr/bin/* $PKG/usr/sbin/*
134mkdir -p $PKG/var/log/setup
135zcat $CWD/setup.mouse.gz > $PKG/var/log/setup/setup.mouse
136chmod 755 $PKG/var/log/setup/setup.mouse
137
138( cd $PKG
139  find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
140  find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
141)
142
143mkdir -p $PKG/install
144cat $CWD/slack-desc > $PKG/install/slack-desc
145
146# Build the package:
147cd $PKG
148makepkg -l y -c n $TMP/gpm-$VERSION-$ARCH-$BUILD.txz
149
Note: See TracBrowser for help on using the repository browser.