#!/bin/sh # ###################################################### # Build script # # # # See .info for details # ###################################################### ###################################################### # Configure extension creation parameters # ###################################################### SRCNAM=XML-Parser-2.46.tar.gz WRKDIR=XML-Parser-2.46 EXTNAM=perl_xml_parser TMPDIR=/tmp/$EXTNAM ###################################################### # Prepare extension creation # ###################################################### # Remove dirs and files left from previous creation rm -r -f $WRKDIR rm -r -f $TMPDIR #rm -r -f $TMPDIR-doc #rm -r -f $TMPDIR-dev # Crete temporary directory mkdir -p $TMPDIR ###################################################### # Compile extension # ###################################################### # Export variables needed for compilation export CFLAGS="-O2 -pipe -march=armv8-a+crc -mtune=cortex-a53" export CXXFLAGS="-O2 -pipe -fno-exceptions -fno-rtti -march=armv8-a+crc -mtune=cortex-a53" # Unpack source in current directory tar -xf $SRCNAM # Configure it cd $WRKDIR perl Makefile.PL # Compile make -j4 # Install in base temp dir make install DESTDIR=$TMPDIR # Delete compilation work directory cd .. rm -r -f $WRKDIR # Adjust directory access rigths find $TMPDIR/ -type d | xargs chmod -v 755; # Strip executables find $TMPDIR | xargs file | grep ELF | cut -f 1 -d : | sudo xargs strip --strip-unneeded # remove pod find $TMPDIR | grep perllocal.pod | xargs rm -f ################################################### # Create base extension in temp dir # ################################################### cd $TMPDIR cd .. mksquashfs $TMPDIR $EXTNAM.tcz cd $TMPDIR find usr -not -type d > $EXTNAM.tcz.list mv ../$EXTNAM.tcz . # Create md5 file md5sum $EXTNAM.tcz > $EXTNAM.tcz.md5.txt # Cleanup temp directory rm -r -f usr