Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # Vars
- NAME=extundelete
- VERSION=0.2.4
- BUILD=${BUILD:-1}
- BUILDDIR="/tmp/txz/$NAME"
- PKG="/tmp/txz/package-$NAME"
- CWD=`pwd`
- # Exit if error
- set -e
- # Create dirs
- rm -fr $BUILDDIR $PKG
- mkdir -p $BUILDDIR $PKG
- # First get sources
- if [ ! -e $CWD/extundelete-$VERSION.tar.bz2 ]
- then
- wget -c "https://vorboss.dl.sourceforge.net/project/extundelete/extundelete/$VERSION/extundelete-$VERSION.tar.bz2" -O $CWD/extundelete-$VERSION.tar.bz2
- fi
- # Extract
- cd $BUILDDIR
- tar -xvf $CWD/extundelete-$VERSION.tar.bz2
- # Compile & Install
- cd $NAME-$VERSION
- export PATH=$PATH:/opt/mipsel-tuxbox-linux-gnu/libexec/gcc/mipsel-tuxbox-linux-gnu/4.8.1/
- export TOOLCHAIN=/opt/mipsel-tuxbox-linux-gnu
- export CC=$TOOLCHAIN/bin/mipsel-tuxbox-linux-gnu-gcc
- export LD=$TOOLCHAIN/bin/mipsel-tuxbox-linux-gnu-ld
- CPPFLAGS='-I/opt/e2fsprogs-mipsel/include' LDFLAGS='-Wl,-rpath=/opt/e2fsprogs-mipsel/lib/libcom_err.so.2 -L/opt/e2fsprogs-mipsel/lib/ -lcom_err' CC=$TOOLCHAIN/bin/mipsel-tuxbox-linux-gnu-gcc LD=$TOOLCHAIN/bin/mipsel-tuxbox-linux-gnu-ld \
- ./configure \
- --prefix=/usr \
- --libdir=/usr/lib \
- --sysconfdir=/etc \
- --target=mipsel-linux
- make PREFIX=/usr LIBDIR=/usr/lib mandir=/usr/man CROSS=$TOOLCHAIN/bin/mipsel-tuxbox-linux-gnu- STRIP=/opt/mipsel-tuxbox-linux-gnu/mipsel-tuxbox-linux-gnu/bin/strip DESTDIR=$PKG install -j4
- # Chown
- chown -R root:root $PKG
- # No man
- rm -fr $PKG/usr/man
- rm -fr $PKG/usr/share/man
- # Strip
- STRIP="/opt/mipsel-tuxbox-linux-gnu/mipsel-tuxbox-linux-gnu/bin/strip"
- ( cd $PKG
- find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs $STRIP --strip-unneeded 2> /dev/null
- find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs $STRIP --strip-unneeded 2> /dev/null
- find . | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs $STRIP -g 2> /dev/null
- )
- # Create package
- mkdir -p $PKG/CONTROL
- install -m 644 $CWD/CONTROL/control $PKG/CONTROL/control
- sh /home/myname/scripts/ipkg.sh $PKG $CWD
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement