2010-05-13 00:58:15 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Slackware build script for LDView:
|
|
|
|
# a program to visualize LDraw files
|
|
|
|
|
2013-11-21 02:22:19 +01:00
|
|
|
# Copyright 2009-2010, 2012-2013 Niels Horn, Rio de Janeiro, Brazil
|
2016-08-06 20:02:44 +02:00
|
|
|
# Copyright 2015-2016 Philip van der Hoeven, Almere, The Netherlands
|
2012-09-13 21:22:49 +02:00
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# Redistribution and use of this script, with or without modification, is
|
|
|
|
# permitted provided that the following conditions are met:
|
|
|
|
#
|
|
|
|
# 1. Redistributions of this script must retain the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer.
|
|
|
|
#
|
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
|
|
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
|
|
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
|
|
|
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
|
|
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
|
|
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
|
|
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
|
|
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
|
|
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
2010-05-13 00:58:15 +02:00
|
|
|
PRGNAM=LDView
|
2016-08-06 20:02:44 +02:00
|
|
|
VERSION=${VERSION:-4.2}
|
|
|
|
BUILD=${BUILD:-1}
|
2010-05-13 00:58:15 +02:00
|
|
|
TAG=${TAG:-_SBo}
|
2016-08-06 20:02:44 +02:00
|
|
|
SRCVER=$(echo $VERSION|tr . _)
|
|
|
|
SRCNAM=$(echo $PRGNAM|tr '[A-Z]' '[a-z]')
|
2010-05-13 00:58:15 +02:00
|
|
|
|
2010-06-12 21:29:29 +02:00
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
2016-08-06 20:02:44 +02:00
|
|
|
i?86) ARCH=i586 ;;
|
2010-06-12 21:29:29 +02:00
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2010-05-13 00:58:15 +02:00
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
2013-11-21 02:22:19 +01:00
|
|
|
PKG=$TMP/package-$PRGNAM
|
2010-05-13 00:58:15 +02:00
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
2016-08-06 20:02:44 +02:00
|
|
|
if [ "$ARCH" = "i586" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
|
2013-11-21 02:22:19 +01:00
|
|
|
LIBDIRSUFFIX=""
|
2010-05-13 00:58:15 +02:00
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
2013-11-21 02:22:19 +01:00
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-13 00:58:15 +02:00
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
2013-11-21 02:22:19 +01:00
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
|
|
|
LIBDIRSUFFIX="64"
|
2010-06-12 21:29:29 +02:00
|
|
|
else
|
2013-11-21 02:22:19 +01:00
|
|
|
SLKCFLAGS="-O2"
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-13 00:58:15 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2016-08-06 20:02:44 +02:00
|
|
|
rm -rf $PKG
|
2013-11-21 02:22:19 +01:00
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
2010-05-13 00:58:15 +02:00
|
|
|
cd $TMP
|
2016-08-06 20:02:44 +02:00
|
|
|
rm -rf $SRCNAM-$SRCVER
|
|
|
|
tar xvf $CWD/$SRCNAM-$SRCVER.tar.gz || tar xvf $CWD/v$SRCVER.tar.gz
|
|
|
|
cd $SRCNAM-$SRCVER
|
2010-05-13 00:58:15 +02:00
|
|
|
chown -R root:root .
|
2013-11-25 12:23:31 +01:00
|
|
|
find -L . \
|
|
|
|
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
|
|
|
|
-o -perm 511 \) -exec chmod 755 {} \; -o \
|
|
|
|
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
|
|
|
|
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
|
2013-11-21 02:22:19 +01:00
|
|
|
|
|
|
|
cd QT
|
|
|
|
|
2016-08-06 20:02:44 +02:00
|
|
|
# Fix path to LDraw library
|
|
|
|
sed -i 's@/usr/share/ldraw@/usr/share/LDRAW@' ModelViewerWidget.cpp
|
|
|
|
|
|
|
|
if [ "$ARCH" = "x86_64" ]; then
|
|
|
|
PLATFORM=linux-g++-64
|
|
|
|
else
|
|
|
|
PLATFORM=linux-g++-32
|
|
|
|
fi
|
|
|
|
qmake LIBS+=-lboost_system -spec $PLATFORM
|
|
|
|
lrelease LDView.pro
|
|
|
|
make "TESTING=-I ../gl2ps -I ../3rdParty/tinyxml"
|
2013-11-21 02:22:19 +01:00
|
|
|
|
|
|
|
|
|
|
|
# Install manually
|
|
|
|
mkdir -p $PKG/usr/bin
|
2016-08-06 20:02:44 +02:00
|
|
|
cp -a $PRGNAM $PKG/usr/bin/${PRGNAM}
|
|
|
|
strip --strip-unneeded $PKG/usr/bin/${PRGNAM}
|
2013-11-21 02:22:19 +01:00
|
|
|
chmod 0755 $PKG/usr/bin/$PRGNAM
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
# Sample files, font, translations
|
2016-08-06 20:02:44 +02:00
|
|
|
mkdir -p $PKG/usr/share/$SRCNAM
|
2013-11-21 02:22:19 +01:00
|
|
|
cp 8464.mpd m6459.ldr Textures/SansSerif.fnt \
|
2016-08-06 20:02:44 +02:00
|
|
|
$PKG/usr/share/$SRCNAM/
|
2013-11-21 02:22:19 +01:00
|
|
|
cp Translations/Czech/LDViewMessages.ini \
|
2016-08-06 20:02:44 +02:00
|
|
|
$PKG/usr/share/$SRCNAM/LDViewMessages_cz.ini
|
2013-11-21 02:22:19 +01:00
|
|
|
cp Translations/EnglishUS/LDViewMessages.ini \
|
2016-08-06 20:02:44 +02:00
|
|
|
$PKG/usr/share/$SRCNAM/LDViewMessages_en_US.ini
|
2013-11-21 02:22:19 +01:00
|
|
|
cp Translations/German/LDViewMessages.ini \
|
2016-08-06 20:02:44 +02:00
|
|
|
$PKG/usr/share/$SRCNAM/LDViewMessages_de.ini
|
2013-11-21 02:22:19 +01:00
|
|
|
cp Translations/Hungarian/LDViewMessages.ini \
|
2016-08-06 20:02:44 +02:00
|
|
|
$PKG/usr/share/$SRCNAM/LDViewMessages_hu.ini
|
2013-11-21 02:22:19 +01:00
|
|
|
cp Translations/Italian/LDViewMessages.ini \
|
2016-08-06 20:02:44 +02:00
|
|
|
$PKG/usr/share/$SRCNAM/LDViewMessages_it.ini
|
2013-11-21 02:22:19 +01:00
|
|
|
cat LDViewMessages.ini LDExporter/LDExportMessages.ini \
|
2016-08-06 20:02:44 +02:00
|
|
|
> $PKG/usr/share/$SRCNAM/LDViewMessages.ini
|
|
|
|
cp QT/ldview_en.qm $PKG/usr/share/$SRCNAM/ldview_en.qm
|
|
|
|
cp QT/ldview_de.qm $PKG/usr/share/$SRCNAM/ldview_de.qm
|
|
|
|
cp QT/ldview_it.qm $PKG/usr/share/$SRCNAM/ldview_it.qm
|
|
|
|
cp QT/ldview_cz.qm $PKG/usr/share/$SRCNAM/ldview_cz.qm
|
|
|
|
cp LDExporter/LGEO.xml $PKG/usr/share/$SRCNAM/LGEO.xml
|
|
|
|
|
|
|
|
# Icon, desktop and mime stuff
|
|
|
|
mkdir -p $PKG/usr/share/{applications,application-registry,mime/packages,mime-info}
|
|
|
|
mkdir -p $PKG/usr/share/icons/gnome/32x32/mimetypes
|
|
|
|
cat QT/desktop/ldview.desktop > $PKG/usr/share/applications/ldview.desktop
|
2013-11-21 02:22:19 +01:00
|
|
|
cat QT/desktop/ldraw.xml > $PKG/usr/share/mime/packages/ldraw.xml
|
2016-08-06 20:02:44 +02:00
|
|
|
cp QT/desktop/ldraw.keys $PKG/usr/share/mime-info/ldraw.keys
|
|
|
|
cp QT/desktop/ldraw.mime $PKG/usr/share/mime-info/ldraw.mime
|
|
|
|
cp QT/desktop/ldview.applications $PKG/usr/share/application-registry/ldview.applications
|
|
|
|
cp QT/images/LDViewIcon.png $PKG/usr/share/icons/gnome/32x32/mimetypes/gnome-mime-application-x-ldraw.png
|
|
|
|
cp QT/images/LDViewIcon.png $PKG/usr/share/icons/gnome/32x32/mimetypes/gnome-mime-application-x-multipart-ldraw.png
|
2010-05-13 00:58:15 +02:00
|
|
|
|
|
|
|
# Documentation
|
2013-11-21 02:22:19 +01:00
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/html
|
|
|
|
cp -a license.txt install.txt Readme.txt QT/todo.txt \
|
|
|
|
$PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cp -a ChangeHistory.html Help.html $PKG/usr/doc/$PRGNAM-$VERSION/html/
|
|
|
|
find $PKG/usr/doc/$PRGNAM-$VERSION/ -type f -exec chmod 644 {} \;
|
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
|
|
|
cat $CWD/doinst.sh > $PKG/install/doinst.sh
|
|
|
|
|
|
|
|
cd $PKG
|
2010-05-13 00:58:15 +02:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|