Commit cdcaf40e authored by Vincent Wei's avatar Vincent Wei

deb scripts

parent 99819318
Package: gvfb
Version: ${VERSION}
Section:
Priority: optional
Architecture: ${ARCHITECTURE}
Depends: libgtk2.0-dev
Installed-Size: 512
Maintainer: [url=http://www.minigui.com/]http://www.minigui.com/
Description: This is a virtual frame buffer program running on Gtk-2.0. This program (gvfb) is compliant to MiniGUI V3.0's XVFB specification. (versoin ${VERSION})
Package: ${PACKAGE}
Version: ${VERSION}
Section:
Priority: optional
Architecture: ${ARCHITECTURE}
Depends: gvfb, minigui-res, libcurl4-gnutls-dev, libxml2-dev, libfreetype6-dev, libjpeg-dev, liblua5.1-0-dev
Installed-Size: 512
Maintainer: [url=http://www.minigui.com/]http://www.minigui.com/
Description: ${DEVELOPMENT} MiniGUI is a mature cross-platform windowing system and GUI system for embedded and smart IoT devices. (runmode: ${RUNTIME_MODE}; version ${VERSION})
Package: minigui-res
Version: ${VERSION}
Section:
Priority: optional
Architecture: all
Depends:
Installed-Size: 512
Maintainer: [url=http://www.minigui.com/]http://www.minigui.com/
Description: The resource of MiniGUI, it contains the fonts, cursors, icons, and bitmaps used by MiniGUI V3.2. (version ${VERSION})
#!/bin/bash
source ${SCRIPTS_DIR}/gvfb-configure
cmake -DCMAKE_INSTALL_PREFIX=${PREFIX} -DCMAKE_LIBRARY_PATH=${PREFIX}/lib -DCMAKE_INCLUDE_PATH=${PREFIX}/include
make $MAKE_PARAM && make install && echo done
#!/bin/bash
source ${SCRIPTS_DIR}/mgeff-configure
CC=${TARGET}gcc \
CXX=${TARGET}g++ \
LD=${TARGET}ld \
AS=${TARGET}as \
AR=${TARGET}ar \
LDFLAGS="${MINIGUI_LDFLAGS} ${BOARD_LDFLAGS}" \
CFLAGS="${MINIGUI_CFLAGS} ${BOARD_CFLAGS}" \
CXXFLAGS="${MINIGUI_CXXFLAGS} ${BOARD_CXXFLAGS}" \
CPPFLAGS="${MINIGUI_CPPFLAGS} ${BOARD_CPPFLAGS}" \
./configure --prefix=${PREFIX} \
--build=${PLATFORM}-linux \
--host=${PLATFORM}-linux \
--target=${PLATFORM}-linux \
${MGEFF_CONFIG}
make $MAKE_PARAM && make install && echo done
#!/bin/bash
source ${SCRIPTS_DIR}/mgncs-configure
CC=${TARGET}gcc \
CXX=${TARGET}g++ \
LD=${TARGET}ld \
AS=${TARGET}as \
AR=${TARGET}ar \
LDFLAGS="${MINIGUI_LDFLAGS} ${BOARD_LDFLAGS}" \
CFLAGS="${MINIGUI_CFLAGS} ${BOARD_CFLAGS}" \
./configure --prefix=${PREFIX} \
--build=${PLATFORM}-linux \
--host=${PLATFORM}-linux \
--target=${PLATFORM}-linux \
${MGNCS_CONFIG}
make $MAKE_PARAM && make install && echo done
#!/bin/bash
source ${SCRIPTS_DIR}/mgplus-configure
CC=${TARGET}gcc \
CXX=${TARGET}g++ \
LD=${TARGET}ld \
AS=${TARGET}as \
AR=${TARGET}ar \
LDFLAGS="${MINIGUI_LDFLAGS} ${BOARD_LDFLAGS}" \
CFLAGS="${MINIGUI_CFLAGS} ${BOARD_CFLAGS}" \
CXXFLAGS="${MINIGUI_CXXFLAGS} ${BOARD_CXXFLAGS}" \
CPPFLAGS="${MINIGUI_CPPFLAGS} ${BOARD_CPPFLAGS}" \
./configure --prefix=${PREFIX} \
--build=${PLATFORM}-linux \
--host=${PLATFORM}-linux \
--target=${PLATFORM}-linux \
${MGPLUS_CONFIG}
make $MAKE_PARAM && make install && echo done
#!/bin/bash
source ${SCRIPTS_DIR}/mgutils-configure
CC=${TARGET}gcc \
CXX=${TARGET}g++ \
LD=${TARGET}ld \
AS=${TARGET}as \
AR=${TARGET}ar \
LDFLAGS="${MINIGUI_LDFLAGS} ${BOARD_LDFLAGS}" \
CFLAGS="${MINIGUI_CFLAGS} ${BOARD_CFLAGS}" \
./configure --prefix=${PREFIX} \
--build=${PLATFORM}-linux \
--host=${PLATFORM}-linux \
--target=${PLATFORM}-linux \
$MGUTILS_CONFIG
make $MAKE_PARAM && make install && echo done
#!/bin/bash
CC=${TARGET}gcc \
CXX=${TARGET}g++ \
LD=${TARGET}ld \
AS=${TARGET}as \
AR=${TARGET}ar \
LDFLAGS="${MINIGUI_LDFLAGS} ${BOARD_LDFLAGS}" \
CFLAGS="${MINIGUI_CFLAGS} ${BOARD_CFLAGS}" \
./configure --prefix=${PREFIX} \
--build=${PLATFORM}-linux \
--host=${PLATFORM}-linux \
--target=${PLATFORM}-linux \
${MINIGUI_CONFIG}
make $MAKE_PARAM && make install && echo done
#!/bin/bash
./configure --prefix=${PREFIX} \
${MINIGUI_RES_CONFIG}
make $MAKE_PARAM && make install && echo done
#!/bin/bash
#install directory
BIT=`getconf LONG_BIT`
if [ "$BIT" == "32" ]
then
export PLATFORM=i386
else
export PLATFORM=x86_64
fi
export PREFIX_BASE=$PWD/../target
export OUT_PATH=$PWD/../target/out
export DEB_PATH=$PWD/../target/deb
export PREFIX=$PREFIX_BASE/out/usr/local/
export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
export MAKE_PARAM="-j4"
export MINIGUI_SRC="${PWD}/../minigui"
export MGUTILS_SRC="${PWD}/../mgutils"
export MGPLUS_SRC="${PWD}/../mgplus"
export MGEFF_SRC="${PWD}/../mgeff"
export MGNCS_SRC="${PWD}/../mgncs"
export MINIGUI_RES="${PWD}/../minigui-res"
export GVFB_SRC="${PWD}/../gvfb"
#cross-compile gcc
export CROSSCOMPILER_BIN=""
export TARGET=
export BOARD_PARAM="-O2 -fPIC"
export BOARD_LDFLAGS=""
export BOARD_CFLAGS_INC=""
export BOARD_CFLAGS="$BOARD_PARAM $BOARD_CFLAGS_INC"
export BOARD_CXXFLAGS=$BOARD_CFLAGS
export BOARD_CPPFLAGS=$BOARD_CFLAGS
export MINIGUI_LDFLAGS="-L${PREFIX}/lib"
export MINIGUI_CFLAGS="-I${PREFIX}/include"
export MINIGUI_CXXPFLAGS=${MINIGUI_CFLAGS}
export MINIGUI_CPPFLAGS=${MINIGUI_CFLAGS}
#!/bin/bash
export GVFB_CONFIG=""
#!/bin/bash
export MGEFF_CONFIG="
"
#!/bin/bash
export MGNCS_CONFIG="
--enable-ctrlold-mledit \
--enable-datasource \
--enable-ctrltexteditor
"
#!/bin/bash
export MGPLUS_CONFIG=""
#!/bin/bash
export MGUTILS_CONFIG=""
#!/bin/bash
export MINIGUI_CONFIG="
--with-runmode=procs \
--with-ttfsupport=ft2 \
--enable-qpfsupport \
--enable-gb18030support \
--enable-ctrlstatic \
--enable-ctrlbutton \
--enable-ctrlsledit \
--enable-ctrlbidisledit \
--enable-ctrlnewtextedit \
--enable-ctrllistbox \
--enable-ctrlpgbar \
--enable-ctrlcombobox \
--enable-ctrlpropsheet \
--enable-ctrltrackbar \
--enable-ctrlscrollbar \
--enable-ctrlnewtoolbar \
--enable-ctrlmenubtn \
--enable-ctrlscrollview \
--enable-ctrltextedit \
--enable-ctrlmonthcal \
--enable-ctrltreeview \
--enable-ctrltreeview-rdr \
--enable-ctrlspinbox \
--enable-ctrlcoolbar \
--enable-ctrllistview \
--enable-ctrliconview \
--enable-ctrlgridview \
--enable-ctrlanimation
"
#!/bin/bash
export MINIGUI_RES_CONFIG="
"
#!/bin/bash
export MINIGUI_RES_CONFIG="
"
#!/bin/bash
export MINIGUI_CONFIG="
--with-runmode=ths \
--with-ttfsupport=ft2 \
--enable-qpfsupport \
--enable-gb18030support \
--enable-ctrlstatic \
--enable-ctrlbutton \
--enable-ctrlsledit \
--enable-ctrlbidisledit \
--enable-ctrlnewtextedit \
--enable-ctrllistbox \
--enable-ctrlpgbar \
--enable-ctrlcombobox \
--enable-ctrlpropsheet \
--enable-ctrltrackbar \
--enable-ctrlscrollbar \
--enable-ctrlnewtoolbar \
--enable-ctrlmenubtn \
--enable-ctrlscrollview \
--enable-ctrltextedit \
--enable-ctrlmonthcal \
--enable-ctrltreeview \
--enable-ctrltreeview-rdr \
--enable-ctrlspinbox \
--enable-ctrlcoolbar \
--enable-ctrllistview \
--enable-ctrliconview \
--enable-ctrlgridview \
--enable-ctrlanimation
"
#!/bin/bash
export NOW_DIR=$PWD
export SCRIPTS_DIR=$NOW_DIR/deb-scripts
CLEAN_BUILD="0"
RUN_MODE=""
Usage()
{
echo "========Usage======="
echo "Compile: $0 <build|clean-build> [gvfb deb](must have >1)"
echo "Cleanup: $0 build clean"
}
ERROR()
{
echo "Error, Will Quit"; exit -1
}
END()
{
echo "=======Done========="
}
build_clean()
{
cd $OUT_PATH
echo -n "Are you sure to delete ALL content in $OUT_PATH folder ? [ Y/N ]:"
read yes_no
if [ "$yes_no" == "Y" -o "$yes_no" == "y" ]
then
rm -rf *
else
cd $NOW_DIR
exit 0
fi
cd $NOW_DIR
}
CLEAN()
{
if [ "$CLEAN_BUILD" == "1" ]
then
make distclean
make clean
fi
}
build_deb()
{
VERSION=`grep PROJECT\(gvfb $GVFB_SRC/CMakeLists.txt | awk -F'[-)]' '{print $2}'`
if [ "$BIT" == "32" ]
then
ARCHITECTURE="i386"
else
ARCHITECTURE="amd64"
fi
mkdir -p $OUT_PATH
mkdir -p $OUT_PATH/DEBIAN
cp -v deb-scripts/DEBIAN/control-gvfb $OUT_PATH/DEBIAN/control
sed -i -e 's:\${VERSION}:'"$VERSION"':g' $OUT_PATH/DEBIAN/control
sed -i -e 's:\${ARCHITECTURE}:'"$ARCHITECTURE"':g' $OUT_PATH/DEBIAN/control
mkdir -p $DEB_PATH
dpkg -b $OUT_PATH $DEB_PATH/gvfb_"$VERSION"_"$ARCHITECTURE".deb
}
###########################################
build_gvfb()
{
cd $GVFB_SRC || ERROR
CLEAN
$SCRIPTS_DIR/build-config-gvfb
cd $NOW_DIR
}
###########################################
if [ $# -lt 2 ]
then
Usage; exit -1
fi
if [ "$1" == "build" ]
then
CLEAN_BUILD="0"
elif [ "$1" == "clean-build" ]
then
CLEAN_BUILD="1"
else
Usage
exit -1
fi
source $SCRIPTS_DIR/build-prepare
if [ ! -d "$PREFIX" ]; then
mkdir -p "$PREFIX"
fi
hasCC_BIN=`echo $PATH | grep $CROSSCOMPILER_BIN`
if [ "$hasCC_BIN" == "" ]
then
export PATH="$PATH:$CROSSCOMPILER_BIN"
fi
hasPREFIX_BIN=`echo $PATH | grep ${PREFIX}/bin`
if [ "$hasPREFIX_BIN" == "" ]
then
export PATH="${PREFIX}/bin/:${PATH}"
fi
run_num=0
for product in $*
do
if [ $run_num -gt 0 ];then
build_$product $1
fi
if [ $product == "clean" ]; then
echo "done"
exit 0
fi
let run_num=$run_num+1
done
END
#!/bin/bash
export NOW_DIR=$PWD
export SCRIPTS_DIR=$NOW_DIR/deb-scripts
CLEAN_BUILD="0"
RUN_MODE=""
Usage()
{
echo "========Usage======="
echo "Compile: $0 <build|clean-build> [minigui-res deb](must have >1)"
echo "Cleanup: $0 build clean"
}
ERROR()
{
echo "Error, Will Quit"; exit -1
}
END()
{
echo "=======Done========="
}
build_clean()
{
cd $OUT_PATH
echo -n "Are you sure to delete ALL content in $OUT_PATH folder ? [ Y/N ]:"
read yes_no
if [ "$yes_no" == "Y" -o "$yes_no" == "y" ]
then
rm -rf *
else
cd $NOW_DIR
exit 0
fi
cd $NOW_DIR
}
CLEAN()
{
if [ "$CLEAN_BUILD" == "1" ]
then
make distclean
make clean
fi
}
build_deb()
{
VERSION=`grep "PACKAGE_VERSION =" $MINIGUI_RES/Makefile | awk '{print $NF}'`
mkdir -p $OUT_PATH
mkdir -p $OUT_PATH/DEBIAN
cp -v deb-scripts/DEBIAN/control-minigui-res $OUT_PATH/DEBIAN/control
sed -i -e 's:\${VERSION}:'"$VERSION"':g' $OUT_PATH/DEBIAN/control
mkdir -p $DEB_PATH
dpkg -b $OUT_PATH $DEB_PATH/minigui-res_"$VERSION"_all.deb
}
###########################################
build_minigui-res()
{
cd $MINIGUI_RES || ERROR
CLEAN
./autogen.sh
$SCRIPTS_DIR/build-config-minigui-res $1
cd $NOW_DIR
}
###########################################
if [ $# -lt 2 ]
then
Usage; exit -1
fi
if [ "$1" == "build" ]
then
CLEAN_BUILD="0"
elif [ "$1" == "clean-build" ]
then
CLEAN_BUILD="1"
else
Usage
exit -1
fi
source $SCRIPTS_DIR/build-prepare
if [ ! -d "$PREFIX" ]; then
mkdir -p "$PREFIX"
fi
hasCC_BIN=`echo $PATH | grep $CROSSCOMPILER_BIN`
if [ "$hasCC_BIN" == "" ]
then
export PATH="$PATH:$CROSSCOMPILER_BIN"
fi
hasPREFIX_BIN=`echo $PATH | grep ${PREFIX}/bin`
if [ "$hasPREFIX_BIN" == "" ]
then
export PATH="${PREFIX}/bin/:${PATH}"
fi
run_num=0
for product in $*
do
if [ $run_num -gt 0 ];then
build_$product $1
fi
if [ $product == "clean" ]; then
echo "done"
exit 0
fi
let run_num=$run_num+1
done
END
#!/bin/bash
export NOW_DIR=$PWD
export SCRIPTS_DIR=$NOW_DIR/deb-scripts
CLEAN_BUILD="0"
RUN_MODE=""
RUNTIME_MODE_DESC=""
Usage()
{
echo "========Usage======="
echo "Compile: $0 <ths|procs|clean-build-ths|clean-build-procs> [minigui mgutils mgplus mgncs mgeff deb](must have >1)"
echo "Cleanup: $0 <ths|procs> clean)"
}
ERROR()
{
echo "Error, Will Quit"; exit -1
}
END()
{
echo "=======Done========="
}
build_clean()
{
cd $OUT_PATH
echo -n "Are you sure to delete ALL content in $OUT_PATH folder ? [ Y/N ]:"
read yes_no
if [ "$yes_no" == "Y" -o "$yes_no" == "y" ]
then
rm -rf *
else
cd $NOW_DIR
exit 0
fi
cd $NOW_DIR
}
CLEAN()
{
if [ "$CLEAN_BUILD" == "1" ]
then
make distclean
make clean
fi
}
build_deb()
{
PACKAGE="libminigui-$RUN_MODE";
PACKAGE_DEV="$PACKAGE-dev"
VERSION=`grep MINIGUI_VERSION $MINIGUI_SRC/Makefile | awk '{print $NF}'`
if [ "$BIT" == "32" ]
then
ARCHITECTURE="i386"
else
ARCHITECTURE="amd64"
fi
mkdir -p $OUT_PATH/DEBIAN
mkdir -p $DEB_PATH
sed -i -e 's:'"${OUT_PATH}"'::g' $OUT_PATH/usr/local/lib/pkgconfig/*.pc
sed -i -e 's:'"${OUT_PATH}"'::g' $OUT_PATH/usr/local/lib/*.la
# dev
DEVELOPMENT="Development files for MiniGUI."
cp deb-scripts/DEBIAN/control-minigui $OUT_PATH/DEBIAN/control
sed -i -e 's:\${VERSION}:'"$VERSION"':g' $OUT_PATH/DEBIAN/control
sed -i -e 's:\${ARCHITECTURE}:'"$ARCHITECTURE"':g' $OUT_PATH/DEBIAN/control
sed -i -e 's:\${PACKAGE}:'"$PACKAGE_DEV"':g' $OUT_PATH/DEBIAN/control
sed -i -e 's:\${DEVELOPMENT}:'"$DEVELOPMENT"':g' $OUT_PATH/DEBIAN/control
sed -i -e 's:\${RUNTIME_MODE}:'"$RUNTIME_MODE_DESC"':g' $OUT_PATH/DEBIAN/control
dpkg -b $OUT_PATH $DEB_PATH/"$PACKAGE_DEV"_"$VERSION"_"$ARCHITECTURE".deb
#
DEVELOPMENT=""
cp deb-scripts/DEBIAN/control-minigui $OUT_PATH/DEBIAN/control
sed -i -e 's:\${VERSION}:'"$VERSION"':g' $OUT_PATH/DEBIAN/control
sed -i -e 's:\${ARCHITECTURE}:'"$ARCHITECTURE"':g' $OUT_PATH/DEBIAN/control
sed -i -e 's:\${PACKAGE}:'"$PACKAGE"':g' $OUT_PATH/DEBIAN/control
sed -i -e 's:\${DEVELOPMENT}:'"$DEVELOPMENT"':g' $OUT_PATH/DEBIAN/control
sed -i -e 's:\${RUNTIME_MODE}:'"$RUNTIME_MODE_DESC"':g' $OUT_PATH/DEBIAN/control
rm -rf $OUT_PATH/usr/local/include
dpkg -b $OUT_PATH $DEB_PATH/"$PACKAGE"_"$VERSION"_"$ARCHITECTURE".deb
}
###########################################
# minigui compile
build_minigui()
{
cd $MINIGUI_SRC || ERROR
CLEAN
./autogen.sh
$SCRIPTS_DIR/build-config-minigui $1
cd $NOW_DIR
}
build_mgutils()
{
cd $MGUTILS_SRC || ERROR
CLEAN
./autogen.sh
$SCRIPTS_DIR/build-config-mgutils $1
cd $NOW_DIR
}
build_mgplus()
{
cd $MGPLUS_SRC || ERROR
CLEAN
./autogen.sh
$SCRIPTS_DIR/build-config-mgplus $1
cd $NOW_DIR
}
build_mgncs()
{
cd $MGNCS_SRC || ERROR
CLEAN
./autogen.sh
$SCRIPTS_DIR/build-config-mgncs
cd $NOW_DIR
}
build_mgeff()
{
cd $MGEFF_SRC || ERROR
CLEAN
./autogen.sh
$SCRIPTS_DIR/build-config-mgeff
cd $NOW_DIR
}
###########################################
if [ $# -lt 2 ]
then
Usage; exit -1
fi
if [ "$1" == "ths" ]
then
CLEAN_BUILD="0"
RUN_MODE="ths"
RUNTIME_MODE_DESC="threads"
source $SCRIPTS_DIR/minigui-ths-configure
source $SCRIPTS_DIR/minigui-res-ths-configure
elif [ "$1" == "procs" ]
then
CLEAN_BUILD="0"
RUN_MODE="procs"
RUNTIME_MODE_DESC="processes"
source $SCRIPTS_DIR/minigui-procs-configure
source $SCRIPTS_DIR/minigui-res-procs-configure
elif [ "$1" == "clean-build-ths" ]
then
CLEAN_BUILD="1"
RUN_MODE="ths"
RUNTIME_MODE_DESC="threads"
source $SCRIPTS_DIR/minigui-ths-configure
source $SCRIPTS_DIR/minigui-res-ths-configure
elif [ "$1" == "clean-build-procs" ]
then
CLEAN_BUILD="1"
RUN_MODE="procs"
RUNTIME_MODE_DESC="processes"
source $SCRIPTS_DIR/minigui-procs-configure
source $SCRIPTS_DIR/minigui-res-procs-configure
else
Usage
exit -1
fi
source $SCRIPTS_DIR/build-prepare
if [ ! -d "$PREFIX" ]; then
mkdir -p "$PREFIX"
fi
hasCC_BIN=`echo $PATH | grep $CROSSCOMPILER_BIN`
if [ "$hasCC_BIN" == "" ]
then
export PATH="$PATH:$CROSSCOMPILER_BIN"
fi
hasPREFIX_BIN=`echo $PATH | grep ${PREFIX}/bin`
if [ "$hasPREFIX_BIN" == "" ]
then
export PATH="${PREFIX}/bin/:${PATH}"
fi
run_num=0
for product in $*
do
if [ $run_num -gt 0 ];then
build_$product $1
fi
if [ $product == "clean" ]; then
echo