#Environment setup
tce-load -i compiletc make coreutils binutils squashfs-tools
export CFLAGS="-mtune=generic -O3 -flto -pipe"
export CXXFLAGS="-mtune=generic -O3 -flto -pipe -fno-exceptions -fno-rtti"

#Getting source
wget --no-check-certificate https://www.ivarch.com/programs/sources/pv-1.9.0.tar.gz -O- | tar xz
cd pv-1.9.0/

#Compile
./configure --with-gnu-ld
make
make install DESTDIR=/tmp/pv/

#File processing
strip -s /tmp/pv/usr/local/bin/pv

#Package
cp --parent /tmp/pv/usr/local/bin/pv .
mksquashfs tmp/pv/ pv.tcz
mv pv.tcz ..
