#!/bin/sh # ###################################################### # Build script for Core 9.0 # # # # See .info for details # ###################################################### ###################################################### # Prepare extension creation # ###################################################### # download and install dependencies tce-load -wi git #download and install the compile tools tce-load -wi autoconf.tcz tce-load -wi automake.tcz tce-load -wi libtool-dev.tcz #tce-load -wi libtool.tcz #tce-load -i pkg-config.tcz #tce-load -i intltool.tcz tce-load -wi compiletc.tcz tce-load -wi squashfs-tools.tcz ###################################################### # Configure extension creation parameters # ###################################################### # Variables TODAY=`date +%Y/%m/%d` PACKAGE="json-c" VERSION="0.11" DESCRIPTION="Library for handling JSON" DEVDESCRIPTION="Development files part of JSON-C, Library for handling JSON" AUTHORS="Eric Haszlakiewicz" HOMEPAGE="https://github.com/json-c/json-c/wiki" LICENSE="https://github.com/json-c/json-c/blob/master/COPYING" ME="rhermsen" TAGS="json-c " DEVTAGS="development json-c" DESTDIR=/tmp/dest/${PACKAGE} TMPDIR=/tmp/submit/${PACKAGE} # Workdir sudo rm -r /tmp/${PACKAGE} 2>/dev/null sudo rm -r /tmp/dest/${PACKAGE} 2>/dev/null cd /tmp # Source git clone https://github.com/json-c/json-c cd /tmp/${PACKAGE} # git tag -l git checkout tags/json-c-0.11-20130402 # git checkout tags/json-c-0.12-20140410 ###################################################### # Compile extension # ###################################################### sh autogen.sh ./configure \ --prefix=/usr/local # allow compile warnings to be ignored to compile 0.11 and 0.12 sed -i 's/Wall -Werror/Wall/g' /tmp/json-c/Makefile.in make mkdir -p $DESTDIR make DESTDIR=$DESTDIR install sudo rm -r ${TMPDIR}* 2>/dev/null mkdir -p ${TMPDIR}/usr/local/lib mv $DESTDIR/usr/local/lib/*.so* ${TMPDIR}/usr/local/lib/ ################################################### # Create info file # ################################################### cd /tmp/submit/ cat < ${PACKAGE}.tcz.info Title: ${PACKAGE}.tcz Description: ${DESCRIPTION} Version: ${VERSION} Author: ${AUTHORS} Original-site: ${HOMEPAGE} Copying-policy: ${LICENSE} Size: ${size} Extension_by: Curaga Tags: ${TAGS} Comments: JSON-C - A JSON implementation in C JSON-C implements a reference counting object model that allows you to easily construct JSON objects in C, output them as JSON formatted strings and parse JSON formatted strings back into the C representation of JSON objects. It aims to conform to RFC 7159. Change-log: 2011/09/04 Original, version 0.9 (Curaga) ${TODAY} compile later version, ${VERSION} (${ME}) Current: ${TODAY} compile later version, ${VERSION} (${ME}) EOF # 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 : | xargs strip --strip-unneeded ################################################### # Create info file # ################################################### cd /tmp/submit/ cat < ${PACKAGE}-dev.tcz.info Title: ${PACKAGE}-dev.tcz Description: ${DEVDESCRIPTION} Version: ${VERSION} Author: ${AUTHORS} Original-site: ${HOMEPAGE} Copying-policy: ${LICENSE} Size: ${size} Extension_by: Curaga Tags: ${DEVTAGS} Comments: JSON-C - A JSON implementation in C JSON-C implements a reference counting object model that allows you to easily construct JSON objects in C, output them as JSON formatted strings and parse JSON formatted strings back into the C representation of JSON objects. It aims to conform to RFC 7159. Change-log: 2011/09/04 Original, version 0.9 (Curaga) ${TODAY} compile later version, ${VERSION} (${ME}) Current: ${TODAY} compile later version, ${VERSION} (${ME}) EOF mkdir -p $TMPDIR-dev/usr/local/lib/pkgconfig mkdir -p $TMPDIR-dev/usr/local mv $DESTDIR/usr/local/lib/pkgconfig/*.pc ${TMPDIR}-dev/usr/local/lib/pkgconfig mv $DESTDIR/usr/local/lib/*.la $TMPDIR-dev/usr/local/lib/ mv $DESTDIR/usr/local/lib/*.a $TMPDIR-dev/usr/local/lib/ mv $DESTDIR/usr/local/include $TMPDIR-dev/usr/local ################################################### # Create .dep file # ################################################### cat < /tmp/submit/${PACKAGE}-dev.tcz.dep ${PACKAGE}.tcz EOF ################################################### # Create base extension in temp dir # ################################################### cd $TMPDIR find $TMPDIR -perm 777 -exec chmod 755 {} \; find $TMPDIR -perm 555 -exec chmod 755 {} \; find $TMPDIR -perm 444 -exec chmod 644 {} \; find $TMPDIR -perm 666 -exec chmod 644 {} \; find $TMPDIR -perm 664 -exec chmod 644 {} \; sudo chown -R root:root $TMPDIR sudo chown -R tc:staff $TMPDIR/usr/local/etc/${PACKAGE} sudo chown -R root:staff $TMPDIR/usr/local/tce.installed sudo chmod -R 775 $TMPDIR/usr/local/tce.installed cd .. mksquashfs $TMPDIR ${PACKAGE}.tcz cd $TMPDIR sudo sh -c "find usr -not -type d > ${PACKAGE}.tcz.list" sudo mv ../${PACKAGE}.tcz* . #sudo mv /tmp/${PACKAGE}/${PACKAGE}.tcz.info . # Create md5 file sudo sh -c "md5sum ${PACKAGE}.tcz > ${PACKAGE}.tcz.md5.txt" # Cleanup temp directory sudo rm -r -f usr ################################################### # Create dev extension in temp dir # ################################################### cd $TMPDIR-dev find $TMPDIR-dev -perm 777 -exec chmod 755 {} \; find $TMPDIR-dev -perm 555 -exec chmod 755 {} \; find $TMPDIR-dev -perm 444 -exec chmod 644 {} \; find $TMPDIR-dev -perm 666 -exec chmod 644 {} \; find $TMPDIR-dev -perm 664 -exec chmod 644 {} \; sudo chown -R root:root $TMPDIR-dev cd .. mksquashfs $TMPDIR-dev ${PACKAGE}-dev.tcz cd $TMPDIR-dev sudo sh -c "find usr -not -type d > ${PACKAGE}-dev.tcz.list" sudo mv ../${PACKAGE}-dev.tcz* . #sudo mv /tmp/${PACKAGE}/${PACKAGE}-dev.tcz.info . # Create md5 file sudo sh -c "md5sum ${PACKAGE}-dev.tcz > ${PACKAGE}-dev.tcz.md5.txt" # Cleanup temp directory sudo rm -r -f usr