diff options
Diffstat (limited to 'source/ap/nano')
-rw-r--r-- | source/ap/nano/doinst.sh | 13 | ||||
-rwxr-xr-x | source/ap/nano/nano.SlackBuild | 28 |
2 files changed, 38 insertions, 3 deletions
diff --git a/source/ap/nano/doinst.sh b/source/ap/nano/doinst.sh new file mode 100644 index 00000000..3cd3405f --- /dev/null +++ b/source/ap/nano/doinst.sh @@ -0,0 +1,13 @@ +#!/bin/sh +config() { + NEW="$1" + OLD="`dirname $NEW`/`basename $NEW .new`" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} +config etc/nanorc.new diff --git a/source/ap/nano/nano.SlackBuild b/source/ap/nano/nano.SlackBuild index c6e3c3ad..0f9e114c 100755 --- a/source/ap/nano/nano.SlackBuild +++ b/source/ap/nano/nano.SlackBuild @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright 2006, 2007, 2008, 2009, 2010 Patrick J. Volkerding, Sebeka, MN, USA +# Copyright 2006, 2007, 2008, 2009, 2010, 2012 Patrick J. Volkerding, Sebeka, MN, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -23,7 +23,7 @@ PKGNAM=nano VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | cut -d - -f 2 | rev | cut -f 3- -d . | rev)} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} NUMJOBS=${NUMJOBS:-" -j7 "} @@ -39,12 +39,24 @@ fi if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" + ARCHQUADLET="" elif [ "$ARCH" = "s390" ]; then SLKCFLAGS="-O2" + LIBDIRSUFFIX="" + ARCHQUADLET="" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" + ARCHQUADLET="" +elif [ "$ARCH" = "arm" ]; then + SLKCFLAGS="-O2 -march=armv5te" + LIBDIRSUFFIX="" + ARCHQUADLET="-gnueabi" else SLKCFLAGS="-O2" + LIBDIRSUFFIX="" + ARCHQUADLET="" fi CWD=$(pwd) @@ -80,7 +92,8 @@ CFLAGS="$SLKCFLAGS" \ --enable-nanorc \ --enable-all \ --enable-utf8 \ - --build=$ARCH-slackware-linux + --disable-wrapping-as-root \ + --build=$ARCH-slackware-linux$ARCHQUADLET || exit 1 # Build and install: make $NUMJOBS || make || exit 1 @@ -113,6 +126,13 @@ if [ -d $PKG/usr/info ]; then ) fi +# Install a default /etc/nanorc file. This is the standard sample +# file from the doc directory that loads the colour configurations +# from /usr/share/nano. +mkdir -vpm755 $PKG/etc +sed 's?^# include?include?g' doc/nanorc.sample > $PKG/etc/nanorc.new +chmod 644 $PKG/etc/nanorc.new + # Add a documentation directory: mkdir -p $PKG/usr/doc/${PKGNAM}-$VERSION cp -a \ @@ -128,8 +148,10 @@ if [ -r ChangeLog ]; then touch -r ChangeLog $DOCSDIR/ChangeLog fi +# Place the package description and installation script: mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc +zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh cd $PKG /sbin/makepkg -l y -c n $TMP/${PKGNAM}-$VERSION-$ARCH-$BUILD.txz |