96 lines
2.8 KiB
Text
96 lines
2.8 KiB
Text
|
#!/bin/sh
|
|||
|
|
|||
|
# variables
|
|||
|
TAG=cyco
|
|||
|
TMP=/tmp/$TAG
|
|||
|
CWD=$(pwd)
|
|||
|
OUTPUT=/tmp
|
|||
|
|
|||
|
PRGNAM=$(basename $CWD)
|
|||
|
PKG=$TMP/pkg-$PRGNAM
|
|||
|
|
|||
|
ARCH=$(uname -m)
|
|||
|
BUILD=1
|
|||
|
|
|||
|
REPOSITORY=/home/installs/SlackBuilds/repositories/$PRGNAM
|
|||
|
|
|||
|
# nettoyage pr<70>alable
|
|||
|
rm -fr $PKG $TMP/$PRGNAM
|
|||
|
|
|||
|
mkdir -p $PKG
|
|||
|
|
|||
|
# mise en place
|
|||
|
[ ! -e $REPOSITORY ] && git clone https://github.com/leozide/leocad.git $REPOSITORY
|
|||
|
( cd $REPOSITORY && git pull )
|
|||
|
VERSION="$( cd $REPOSITORY && git log -1 --format=%h_%ad --date=format:%Y.%m.%d )"
|
|||
|
|
|||
|
cp -R $REPOSITORY $TMP/$PRGNAM
|
|||
|
cd $TMP/$PRGNAM/
|
|||
|
|
|||
|
qmake-qt5 DISABLE_UPDATE_CHECK=1 DOCS_DIR=/usr/doc/$PRGNAM-$VERSION MAN_DIR=/usr/man/man1 leocad.pro
|
|||
|
CFLAGS="$SLKCFLAGS" \
|
|||
|
CXXFLAGS="$SLKCFLAGS" \
|
|||
|
make
|
|||
|
make INSTALL_ROOT="$PKG" install
|
|||
|
|
|||
|
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
|
|||
|
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
|||
|
|
|||
|
mkdir -p $PKG/usr/man/man1
|
|||
|
cp -a docs/leocad.1 $PKG/usr/man/man1
|
|||
|
find $PKG/usr/man -type f -exec gzip -9 {} \;
|
|||
|
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
|
|||
|
|
|||
|
LIBRARY_VERSION=$(curl -s https://api.github.com/repos/leozide/leocad/releases | grep -o "/Library-Linux-[0-9]*.zip" | head -n1 | grep -o "[0-9]*")
|
|||
|
[ ! -e $CWD/Library-Linux-${LIBRARY_VERSION}.zip ] && https://github.com/leozide/leocad/releases/download/v18.02/Library-Linux-${LIBRARY_VERSION}.zip
|
|||
|
# Data from zip-file + set permissions
|
|||
|
mkdir -p $PKG/usr/share/leocad
|
|||
|
unzip $CWD/Library-Linux-$LIBRARY_VERSION.zip -d $PKG/usr/share/leocad
|
|||
|
chown -R root:root $PKG
|
|||
|
find $PKG -type f -exec chmod 644 {} \;
|
|||
|
|
|||
|
mkdir -p $PKG/usr/doc/$PRGNAM
|
|||
|
cp -a docs/CREDITS.txt docs/README.txt docs/COPYING.txt $PKG/usr/doc/$PRGNAM
|
|||
|
|
|||
|
# correction
|
|||
|
cd $PKG
|
|||
|
chown -R root:root *
|
|||
|
|
|||
|
# embaumement
|
|||
|
mkdir -p $PKG/install
|
|||
|
cat <<EOF > $PKG/install/doinst.sh
|
|||
|
if [ -x /usr/bin/update-desktop-database ]; then
|
|||
|
/usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
|
|||
|
fi
|
|||
|
|
|||
|
if [ -x /usr/bin/update-mime-database ]; then
|
|||
|
/usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1
|
|||
|
fi
|
|||
|
|
|||
|
if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
|
|||
|
if [ -x /usr/bin/gtk-update-icon-cache ]; then
|
|||
|
/usr/bin/gtk-update-icon-cache -f usr/share/icons/hicolor >/dev/null 2>&1
|
|||
|
fi
|
|||
|
fi
|
|||
|
EOF
|
|||
|
|
|||
|
cat <<EOF > $PKG/install/slack-desc
|
|||
|
|-----handy-ruler------------------------------------------------------|
|
|||
|
$PRGNAM: $PRGNAM (CAD program for toy bricks)
|
|||
|
$PRGNAM:
|
|||
|
$PRGNAM: $PRGNAM is a CAD program that uses bricks similar to those
|
|||
|
$PRGNAM: found in many toys (but they don't represent any particular brand).
|
|||
|
$PRGNAM: Currently it uses a library of more than 7000 different pieces.
|
|||
|
$PRGNAM:
|
|||
|
$PRGNAM: https://www.$PRGNAM.org/
|
|||
|
$PRGNAM:
|
|||
|
$PRGNAM:
|
|||
|
$PRGNAM:
|
|||
|
$PRGNAM:
|
|||
|
EOF
|
|||
|
|
|||
|
# empaquetage
|
|||
|
cd $PKG
|
|||
|
rm -f $PKG/{,usr/}lib$(uname -m | grep -o 64)/*.la
|
|||
|
makepkg -l y -c n $OUTPUT/$PRGNAM-$(echo $VERSION | sed 's/-//g')-$ARCH-$BUILD$TAG.txz
|