2 # Copyright 2002-2015 Patrick J. Volkerding, Sebeka, Minnesota, USA
5 # Redistribution and use of this script, with or without modification, is
6 # permitted provided that the following conditions are met:
8 # 1. Redistributions of this script must retain the above copyright
9 # notice, this list of conditions and the following disclaimer.
11 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
12 # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
13 # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
14 # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
15 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
16 # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
17 # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
18 # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
19 # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
20 # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
26 # Automatically determine the architecture we're building on:
27 if [ -z "$ARCH" ]; then
28 case "$( uname -m )" in
29 i?86) export ARCH=i586 ;;
30 arm*) export ARCH=arm ;;
31 # Unless $ARCH is already set, use uname -m for all other archs:
32 *) export ARCH=$( uname -m ) ;;
38 NUMJOBS=${NUMJOBS:-" -j7 "}
40 if [ "$ARCH" = "i486" ]; then
41 SLKCFLAGS="-O2 -march=i486 -mcpu=i686"
42 elif [ "$ARCH" = "i586" ]; then
43 SLKCFLAGS="-O2 -march=i586 -mtune=i686"
44 elif [ "$ARCH" = "s390" ]; then
46 elif [ "$ARCH" = "x86_64" ]; then
52 PKG=$TMP/package-neomutt
56 rm -rf neomutt-$VERSION
57 tar xvf $CWD/neomutt-$VERSION.tar.?z* || exit 1
58 mv neomutt-neomutt-$VERSION neomutt-$VERSION
59 cd neomutt-$VERSION || exit 1
66 --docdir=/usr/doc/mutt-$VERSION \
67 --with-docdir=/usr/doc/mutt-$VERSION \
68 --sysconfdir=/etc/mutt \
69 --with-mailpath=/var/spool/mail \
78 --build=$ARCH-slackware-linux
87 --docdir=/usr/doc/mutt-$VERSION \
88 --with-docdir=/usr/doc/mutt-$VERSION \
89 --sysconfdir=/etc/mutt \
90 --with-mailpath=/var/spool/mail \
99 --build=$ARCH-slackware-linux
101 --enable-compressed \
104 make $NUMJOBS || make || exit 1
105 make install DESTDIR=$PKG || exit 1
109 find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
110 find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
113 # Compress and link manpages, if any:
114 if [ -d $PKG/usr/man ]; then
116 for manpagedir in $(find . -type d -name "man*") ; do
118 for eachpage in $( find . -type l -maxdepth 1) ; do
119 ln -s $( readlink $eachpage ).gz $eachpage.gz
128 mkdir -p $PKG/install
129 cat $CWD/slack-desc > $PKG/install/slack-desc
130 zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
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
148 mv $PKG/etc/mutt/Muttrc $PKG/etc/mutt/Muttrc.new
151 /sbin/makepkg -l y -c n ../neomutt-$VERSION-$ARCH-$BUILD.txz