2010-07-17 22:45:43 +00:00
|
|
|
#!/bin/sh
|
2011-01-09 22:32:01 +00:00
|
|
|
|
2011-01-09 20:26:03 +00:00
|
|
|
################################################################################
|
|
|
|
# This file is part of OpenELEC - http://www.openelec.tv
|
|
|
|
# Copyright (C) 2009-2011 Stephan Raue (stephan@openelec.tv)
|
|
|
|
#
|
|
|
|
# This Program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
# any later version.
|
|
|
|
#
|
|
|
|
# This Program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with OpenELEC.tv; see the file COPYING. If not, write to
|
|
|
|
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
# http://www.gnu.org/copyleft/gpl.html
|
|
|
|
################################################################################
|
2010-07-17 22:45:43 +00:00
|
|
|
|
2010-07-21 16:54:45 +00:00
|
|
|
. config/options $1
|
2010-07-17 22:45:43 +00:00
|
|
|
|
|
|
|
if [ -z "$1" ]; then
|
|
|
|
echo "usage: $0 package_name"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
buildsystem: big rework & cleanup - PART-1: split functions from 'config/path' to an seperate file 'config/functions', rework and cleanup some build scripts, remove references to $TARGET_PLATFORM, add support for more then one downloadurl for $PKG_URL (partially done), remove support for: $PKG_DIR/arch, $PKG_DIR/platform, $PKG_DIR/url files, remove support for *.diff patches, create download-stampfiles in sources/$PKG_NAME, create md5 files after download, add support to download all sources at once with './scripts/get'
Signed-off-by: Stephan Raue <stephan@openelec.tv>
2010-11-19 21:01:08 +00:00
|
|
|
if [ -n $PKG_ARCH -a ! "$PKG_ARCH" = "any" ]; then
|
|
|
|
echo "$PKG_ARCH" | grep -q "$TARGET_ARCH" || exit 0
|
|
|
|
echo "$PKG_ARCH" | grep -q "\-$TARGET_ARCH" && exit 0
|
2010-07-17 22:45:43 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
$SCRIPTS/build $@
|
|
|
|
|
|
|
|
printf "%${INDENT}c CREATE ADDON $1\n" >&$SILENT_OUT
|
|
|
|
export INDENT=$((${INDENT:-1}+$INDENT_SIZE))
|
|
|
|
|
|
|
|
if [ -f $PKG_DIR/addon ]; then
|
2010-07-22 18:07:18 +00:00
|
|
|
|
|
|
|
rm -rf $ADDON_BUILD
|
|
|
|
|
2010-07-17 22:45:43 +00:00
|
|
|
$PKG_DIR/addon $@ >&$VERBOSE_OUT
|
2010-07-22 18:07:18 +00:00
|
|
|
|
|
|
|
mkdir -p $ADDON_BUILD/$PKG_ADDON_ID
|
|
|
|
cp config/addon/addon.xml $ADDON_BUILD/$PKG_ADDON_ID
|
|
|
|
$SED -e "s|@PKG_ADDON_ID@|$PKG_ADDON_ID|g" \
|
|
|
|
-e "s|@ADDON_VERSION@|$OS_VERSION.$PKG_REV|g" \
|
2011-04-19 03:08:51 +00:00
|
|
|
-e "s|@PKG_ADDON_TYPE@|$PKG_ADDON_TYPE|g" \
|
2010-07-22 18:07:18 +00:00
|
|
|
-e "s|@PKG_SHORTDESC@|$PKG_SHORTDESC|g" \
|
|
|
|
-e "s|@OS_VERSION@|$OS_VERSION|g" \
|
|
|
|
-e "s|@PKG_LONGDESC@|$PKG_LONGDESC|g" \
|
|
|
|
-i $ADDON_BUILD/$PKG_ADDON_ID/addon.xml
|
|
|
|
|
2011-04-19 03:08:51 +00:00
|
|
|
if [ -f $PKG_DIR/source/default.py ]; then
|
|
|
|
cp -R $PKG_DIR/source/* $ADDON_BUILD/$PKG_ADDON_ID
|
2010-07-22 18:07:18 +00:00
|
|
|
else
|
2011-04-19 03:08:51 +00:00
|
|
|
echo "*** ERROR: you need at least $PKG_DIR/source/default.py so your addon can work ***"
|
2010-07-22 18:07:18 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -f $PKG_DIR/icon/icon.png ]; then
|
|
|
|
cp $PKG_DIR/icon/icon.png $ADDON_BUILD/$PKG_ADDON_ID
|
|
|
|
else
|
|
|
|
echo "*** WARNING: its recommended to have an $PKG_DIR/icon/icon.png ***"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -f $PKG_DIR/changelog.txt ]; then
|
|
|
|
cp $PKG_DIR/changelog.txt $ADDON_BUILD/$PKG_ADDON_ID
|
|
|
|
else
|
|
|
|
echo "*** WARNING: its recommended to have an $PKG_DIR/changelog.txt ***"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -d $ADDON_BUILD/mkimage ]; then
|
|
|
|
$ROOT/$TOOLCHAIN/bin/mksquashfs $ADDON_BUILD/mkimage $ADDON_BUILD/$PKG_ADDON_ID/$1.img -noappend -comp lzma
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd $ADDON_BUILD
|
|
|
|
echo "*** compressing Addon $PKG_ADDON_ID ... ***"
|
|
|
|
zip -rq $PKG_ADDON_ID-$OS_VERSION.$PKG_REV.zip $PKG_ADDON_ID;
|
|
|
|
cd -
|
|
|
|
|
|
|
|
mkdir -p $ADDON_BUILD/target/$PKG_ADDON_ID
|
|
|
|
cp $ADDON_BUILD/$PKG_ADDON_ID-$OS_VERSION.$PKG_REV.zip $ADDON_BUILD/target/$PKG_ADDON_ID
|
|
|
|
cp $PKG_DIR/changelog.txt $ADDON_BUILD/target/$PKG_ADDON_ID/changelog-$OS_VERSION.$PKG_REV.txt
|
|
|
|
cp $PKG_DIR/icon/icon.png $ADDON_BUILD/target/$PKG_ADDON_ID/icon.png
|
2010-07-17 22:45:43 +00:00
|
|
|
fi
|