| 1 | #!/bin/sh |
|---|
| 2 | |
|---|
| 3 | # Copyright 2005-2009, 2010 Patrick J. Volkerding, Sebeka, Minnesota, USA |
|---|
| 4 | # All rights reserved. |
|---|
| 5 | # |
|---|
| 6 | # Redistribution and use of this script, with or without modification, is |
|---|
| 7 | # permitted provided that the following conditions are met: |
|---|
| 8 | # |
|---|
| 9 | # 1. Redistributions of this script must retain the above copyright |
|---|
| 10 | # notice, this list of conditions and the following disclaimer. |
|---|
| 11 | # |
|---|
| 12 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED |
|---|
| 13 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
|---|
| 14 | # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO |
|---|
| 15 | # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
|---|
| 16 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
|---|
| 17 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; |
|---|
| 18 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
|---|
| 19 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
|---|
| 20 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
|---|
| 21 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|---|
| 22 | |
|---|
| 23 | VERSION=11.1 |
|---|
| 24 | BUILD=${BUILD:-1} |
|---|
| 25 | |
|---|
| 26 | # Automatically determine the architecture we're building on: |
|---|
| 27 | if [ -z "$ARCH" ]; then |
|---|
| 28 | case "$( uname -m )" in |
|---|
| 29 | i?86) export ARCH=i486 ;; |
|---|
| 30 | arm*) export ARCH=arm ;; |
|---|
| 31 | # Unless $ARCH is already set, use uname -m for all other archs: |
|---|
| 32 | *) export ARCH=$( uname -m ) ;; |
|---|
| 33 | esac |
|---|
| 34 | fi |
|---|
| 35 | |
|---|
| 36 | CWD=$(pwd) |
|---|
| 37 | TMP=${TMP:-/tmp} |
|---|
| 38 | PKG=$TMP/package-bin |
|---|
| 39 | |
|---|
| 40 | # These don't need to be real recent, as we only require a couple |
|---|
| 41 | # of things such as 'mktemp' and 'tempfile'. |
|---|
| 42 | DUTILS=2.7 |
|---|
| 43 | |
|---|
| 44 | # The fbset package |
|---|
| 45 | FBSET=2.1 |
|---|
| 46 | |
|---|
| 47 | rm -rf $PKG |
|---|
| 48 | mkdir -p $TMP $PKG |
|---|
| 49 | |
|---|
| 50 | echo "+=============+" |
|---|
| 51 | echo "| debianutils |" |
|---|
| 52 | echo "+=============+" |
|---|
| 53 | cd $TMP |
|---|
| 54 | rm -rf debianutils-$DUTILS |
|---|
| 55 | tar xzvf $CWD/debianutils_$DUTILS.tar.gz |
|---|
| 56 | cd debianutils-$DUTILS |
|---|
| 57 | chown -R root:root . |
|---|
| 58 | ./configure --prefix=/usr |
|---|
| 59 | make || exit 1 |
|---|
| 60 | ## We use our own very simple run-parts script |
|---|
| 61 | ## in the dcron package instead. |
|---|
| 62 | #cat run-parts > $PKG/usr/bin/run-parts |
|---|
| 63 | #cat run-parts.8 | gzip -9c > $PKG/usr/man/man8/run-parts.8.gz |
|---|
| 64 | mkdir -p $PKG/usr/bin $PKG/usr/man/man{1,8} |
|---|
| 65 | cat mktemp > $PKG/usr/bin/mktemp |
|---|
| 66 | cat mktemp.1 | gzip -9c > $PKG/usr/man/man1/mktemp.1.gz |
|---|
| 67 | cat savelog > $PKG/usr/bin/savelog |
|---|
| 68 | cat savelog.8 | gzip -9c > $PKG/usr/man/man8/savelog.8.gz |
|---|
| 69 | cat tempfile > $PKG/usr/bin/tempfile |
|---|
| 70 | cat tempfile.1 | gzip -9c > $PKG/usr/man/man1/tempfile.1.gz |
|---|
| 71 | chmod 755 $PKG/usr/bin/* |
|---|
| 72 | mkdir -p $PKG/usr/doc/debianutils-$DUTILS |
|---|
| 73 | cp -a debian/copyright $PKG/usr/doc/debianutils-$DUTILS |
|---|
| 74 | |
|---|
| 75 | |
|---|
| 76 | echo "+=========+" |
|---|
| 77 | echo "| banners |" |
|---|
| 78 | echo "+=========+" |
|---|
| 79 | cd $TMP |
|---|
| 80 | rm -rf banners |
|---|
| 81 | tar xzvf $CWD/banners.tar.gz |
|---|
| 82 | cd banners |
|---|
| 83 | chown -R root:root . |
|---|
| 84 | make || exit 1 |
|---|
| 85 | cat bban > $PKG/usr/bin/bban |
|---|
| 86 | cat sysvbanner > $PKG/usr/bin/sysvbanner |
|---|
| 87 | chmod 755 $PKG/usr/bin/{bban,sysvbanner} |
|---|
| 88 | |
|---|
| 89 | echo "+===============+" |
|---|
| 90 | echo "| todos/fromdos |" |
|---|
| 91 | echo "+===============+" |
|---|
| 92 | cd $TMP |
|---|
| 93 | rm -rf todos |
|---|
| 94 | tar xzvf $CWD/todos.tar.gz |
|---|
| 95 | cd todos |
|---|
| 96 | chown -R root:root . |
|---|
| 97 | make || exit 1 |
|---|
| 98 | mkdir -p $PKG/usr/bin |
|---|
| 99 | cat todos > $PKG/usr/bin/todos |
|---|
| 100 | cat fromdos > $PKG/usr/bin/fromdos |
|---|
| 101 | chmod 755 $PKG/usr/bin/*dos |
|---|
| 102 | mkdir -p $PKG/usr/man/man1 |
|---|
| 103 | cat todos.1.gz > $PKG/usr/man/man1/todos.1.gz |
|---|
| 104 | cat fromdos.1.gz > $PKG/usr/man/man1/fromdos.1.gz |
|---|
| 105 | |
|---|
| 106 | # These are a couple of really old scripts that might still |
|---|
| 107 | # be useful for a couple more years. :-) |
|---|
| 108 | zcat $CWD/scripts/diskcopy.gz > $PKG/usr/bin/diskcopy |
|---|
| 109 | zcat $CWD/scripts/xx.gz > $PKG/usr/bin/xx |
|---|
| 110 | chmod 755 $PKG/usr/bin/diskcopy |
|---|
| 111 | chmod 755 $PKG/usr/bin/xx |
|---|
| 112 | |
|---|
| 113 | ( cd $PKG |
|---|
| 114 | find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null |
|---|
| 115 | find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null |
|---|
| 116 | ) |
|---|
| 117 | |
|---|
| 118 | mkdir -p $PKG/install |
|---|
| 119 | cat $CWD/slack-desc > $PKG/install/slack-desc |
|---|
| 120 | |
|---|
| 121 | # Build the package: |
|---|
| 122 | cd $PKG |
|---|
| 123 | makepkg -l y -c n $TMP/bin-$VERSION-$ARCH-$BUILD.txz |
|---|
| 124 | |
|---|