3 # Slackware build script for neomutt
5 # Copyright 2016,2017 Maximilian Friedersdorff Aberystwyth, United Kingdom
6 # Copyright 2002-2015 Patrick J. Volkerding, Sebeka, Minnesota, USA
9 # Redistribution and use of this script, with or without modification, is
10 # permitted provided that the following conditions are met:
12 # 1. Redistributions of this script must retain the above copyright
13 # notice, this list of conditions and the following disclaimer.
15 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
16 # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
17 # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
18 # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
19 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20 # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
21 # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
22 # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
23 # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
24 # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 VERSION=${VERSION:-$(echo $PRGNAM-*.tar.?z* | cut -f 2- -d - | cut -f 1 -d .)}
31 # Automatically determine the architecture we're building on:
32 if [ -z "$ARCH" ]; then
33 case "$( uname -m )" in
36 # Unless $ARCH is already set, use uname -m for all other archs:
37 *) ARCH=$( uname -m ) ;;
43 PKG=$TMP/package-$PRGNAM
44 OUTPUT=${OUTPUT:-/tmp} # Drop the package in /tmp
46 if [ "$ARCH" = "i586" ]; then
47 SLKCFLAGS="-O2 -march=i586 -mtune=i686"
49 elif [ "$ARCH" = "i686" ]; then
50 SLKCFLAGS="-O2 -march=i686 -mtune=i686"
52 elif [ "$ARCH" = "x86_64" ]; then
60 set -e # Exit on most errors
63 mkdir -p $TMP $PKG $OUTPUT
65 rm -rf $PRGNAM-$VERSION
66 tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
67 mv neomutt-neomutt-$VERSION neomutt-$VERSION
71 \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
72 -o -perm 511 \) -exec chmod 755 {} \; -o \
73 \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
74 -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
78 CXXFLAGS="$SLKCFLAGS" \
82 --docdir=/usr/doc/neomutt-$VERSION \
83 --with-docdir=/usr/doc/neomutt-$VERSION \
84 --sysconfdir=/etc/mutt \
85 --with-mailpath=/var/spool/mail \
94 --build=$ARCH-slackware-linux \
100 CXXFLAGS="$SLKCFLAGS" \
104 --docdir=/usr/doc/neomutt-$VERSION \
105 --with-docdir=/usr/doc/neomutt-$VERSION \
106 --sysconfdir=/etc/mutt \
107 --with-mailpath=/var/spool/mail \
116 --build=$ARCH-slackware-linux \
118 --enable-compressed \
122 make install DESTDIR=$PKG
124 find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
125 | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
127 find $PKG/usr/man -type f -exec gzip -9 {} \;
128 for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
130 cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
132 # This stuff is redundant or not useful to most people, IMHO.
133 # If you want it, use the source, Luke.
134 rm -f $PKG/usr/doc/mutt-$VERSION/*.html
135 rm -f $PKG/etc/mutt/*.dist
137 # This is an ancient artifact
138 rm -f $PKG/usr/doc/mutt-$VERSION/samples/ca-bundle.crt
140 # If there's a ChangeLog, installing at least part of the recent history
141 # is useful, but don't let it get totally out of control:
142 if [ -r ChangeLog ]; then
143 DOCSDIR=$(echo $PKG/usr/doc/${PKGNAM}-$VERSION)
144 cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
145 touch -r ChangeLog $DOCSDIR/ChangeLog
149 # Copy the slack-desc (and a custom doinst.sh if necessary) into ./install
150 mkdir -p $PKG/install
151 cat $CWD/slack-desc > $PKG/install/slack-desc
152 zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
155 /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}