#!/bin/bash CWD=$(pwd) PRGNAM=$(basename $CWD) VERSION=${VERSION:-1.6d} ARCH=$(uname -m) BUILD=${BUILD:-1} TAG=${TAG:-gwh} TMP=${TMP:-/tmp/$TAG} PKG=$TMP/pkg-$PRGNAM OUTPUT=${OUTPUT:-/tmp} REPOSITORY=${REPOSITORY:-/home/installs/SlackBuilds/_repositories/$PRGNAM} mkdir -p $REPOSITORY TARVERSION=$(echo $VERSION | tr . -) [ ! -e $REPOSITORY/LDCad-$TARVERSION-Linux.tar.bz2 ] && wget -c -O $REPOSITORY/LDCad-$TARVERSION-Linux.tar.bz2 http://www.melkert.net/action/download/LDCad-$TARVERSION-Linux.tar.bz2 [ ! -e $REPOSITORY/complete.zip ] && wget -c -O $REPOSITORY/complete.zip http://www.ldraw.org/library/updates/complete.zip rm -fr $PKG $TMP/LDCad-$TARVERSION-Linux mkdir -p $PKG $TMP cd $TMP tar xvf $REPOSITORY/LDCad-$TARVERSION-Linux.tar.bz2 cd LDCad-$TARVERSION-Linux mkdir -p $PKG/usr/bin if [ -e "LDCad" ] then appSrcExe="LDCad" else if [ `getconf LONG_BIT` = "64" ] then appSrcExe="LDCad64" else appSrcExe="LDCad32" fi fi cp -v $appSrcExe $PKG/usr/bin/LDCad mkdir -p $PKG/usr/share/LDCad mkdir -p $PKG/usr/share/LDCad/seeds cp -v seeds/*.sf $PKG/usr/share/LDCad/seeds cp -vr resources $PKG/usr/share/LDCad cp $REPOSITORY/complete.zip $PKG/usr/share/LDCad mkdir -p $PKG/usr/doc/LDCad cp -vr docs/* $PKG/usr/doc/LDCad mkdir -p $PKG/usr/share/mime cat < $PKG/usr/share/mime/ldraw.xml LDraw Model LDraw Model EOF mkdir -p $PKG/usr/share/applications/ cat < $PKG/usr/share/applications/LDCad.desktop #!/usr/bin/env xdg-open [Desktop Entry] Type=Application Version=$VERSION Name=LDCad GenericName=LDraw model editor Comment=LDCad can be used to edit all kinds of LDraw (virtual LEGO(r)) models. Icon=/usr/share/LDCad/resources/LDCad-128x128.png Exec=/usr/bin/LDCad Terminal=false MimeType=application/x-ldraw;application/x-multipart-ldraw Categories=Graphics EOF mkdir -p $PKG/etc cat < $PKG/etc/LDCad.cfg [paths] resourcesDir=/usr/share/LDCad/resources seedsDir=/usr/share/LDCad/seeds logDir=/.LDCad/logs cfgDir=/.LDCad/config guiDir=/.LDCad/gui colorBinDir=/.LDCad/colorBin partBinDir=/.LDCad/partBin examplesDir=/.LDCad/examples templatesDir=/.LDCad/templates donorsDir=/.LDCad/donors shadowDir=/.LDCad/shadow scriptsDir=/.LDCad/scripts povCfgDir=/.LDCad/povray EOF mkdir -p $PKG/install/ cat < $PKG/install/doinst.sh #!/bin/bash update-mime-database /usr/share/mime update-desktop-database EOF cat < $PKG/install/slack-desc # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. |-----handy-ruler------------------------------------------------------| ${PRGNAM}: ${PRGNAM} (LEGO™ CAD program) ${PRGNAM}: ${PRGNAM}: LDCad is a multiplatform LDraw (virtual LEGO) editor that lets you ${PRGNAM}: edit LDraw model documents in real-time. ${PRGNAM}: ${PRGNAM}: For those that are new to LDraw, it's highly recommended that you take ${PRGNAM}: a close look to the project's home site LDraw.org and it's forum. ${PRGNAM}: ${PRGNAM}: ${PRGNAM}: LDraw library is installed in /usr/share/LDCad/ ${PRGNAM}: EOF cd $PKG rm -f $PKG/{,usr/}lib$(uname -m | grep -o 64)/*.la /sbin/makepkg --linkadd y --chown n --prepend ${OUTPUT}/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.txz