#!/bin/sh # # Submitted by gh PROGRAM=nano VERSION=1.2.1 ARCH=i386 BUILD=1 CWD=`pwd` TMP=/tmp PKG=$TMP/package-$PROGRAM # clean out old builds [ -d $TMP/$PROGRAM-$VERSION ] && rm -fr $TMP/$PROGRAM-$VERSION [ -d $PKG ] && rm -fr $PKG mkdir -p $PKG/install cd $TMP && \ tar xzvf $CWD/$PROGRAM-$VERSION.tar.gz cd $PROGRAM-$VERSION # config without native lang support and build CFLAGS=-O2 LDFLAGS=-s ./configure --prefix=/usr --disable-nls make make install DESTDIR=$PKG # Copy the docs mkdir -p $PKG/usr/doc/$PROGRAM-$VERSION cp -a `ls | grep [A-Z] | grep -v Makefile` $PKG/usr/doc/$PROGRAM-$VERSION/ cp -a *.html $PKG/usr/doc/$PROGRAM-$VERSION/ cp -a *.sample $PKG/usr/doc/$PROGRAM-$VERSION/ cp -a $CWD/nanoManual.html $PKG/usr/doc/$PROGRAM-$VERSION/ cd $PKG # Strip the binary LIST=`find . -perm -700 | grep nano` for FILE in $LIST do strip $FILE done # Insert the slack-desc file in install dir # |_________1_________2_________3_________4_________5_________6_________7| cat << EOF > $PKG/install/slack-desc $PROGRAM: $PROGRAM-$VERSION $PROGRAM: $PROGRAM: The nano project was started because of a few "problems" with the $PROGRAM: wonderfully easy-to-use and friendly Pico text editor. $PROGRAM: $PROGRAM: First and foremost is its license: the Pine suite does not use the $PROGRAM: GPL or a GPL-friendly license, and has unclear restrictions on $PROGRAM: redistribution. Because of this, Pine and Pico are not included with $PROGRAM: many GNU/Linux distributions. Also, other features (like goto line $PROGRAM: number or search and replace) were unavailable until recently or $PROGRAM: require a command line flag. EOF # gzip the man and info page # find usr/man -type f -print0 | xargs -0 gzip -9 # find usr/info -type f -print0 | xargs -0 gzip -9 cd $PKG/usr/man/man1 cat nano.1 | gzip -9c > nano.1.gz rm -f nano.1 cd $PKG/usr/man/man5 cat nanorc.5 | gzip -9c > nanorc.5.gz rm -f nanorc.5 cd $PKG && chown -R root:root makepkg -l y -c y ../$PROGRAM-$VERSION-$ARCH-$BUILD.tgz