6 # Copyright (c) 2003-2008 John Willinsky
7 # Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
9 # Script to create an OMP package for distribution.
11 # Usage: buildpkg.sh <version> [<tag>]
13 # $Id: buildpkg.sh,v 1.3 2009/06/09 23:37:16 tylerl Exp $
16 CVSROOT
=:pserver
:anonymous@pkp.sfu.ca
:/cvs
20 echo "Usage: $0 <version> [<tag>] [<patch_dir>]";
28 BUILD
=$PREFIX-$VERSION
29 TMPDIR
=`mktemp -d $PREFIX.XXXXXX` ||
exit 1
31 EXCLUDE
="dbscripts/xml/data/locale/en_US/sample.xml \
32 dbscripts/xml/data/locale/te_ST \
33 dbscripts/xml/data/sample.xml \
36 lib/adodb/CHANGED_FILES \
38 lib/smarty/CHANGED_FILES \
44 tools/genLocaleReport.sh \
45 tools/genTestLocale.php \
51 echo -n "Exporting $MODULE with tag $TAG ... "
52 cvs
-Q -d $CVSROOT export -r $TAG -d $BUILD $MODULE ||
exit 1
57 echo -n "Preparing package ... "
58 cp config.TEMPLATE.inc.php config.inc.php
59 find .
-name .cvsignore
-exec rm {} \
;
65 echo -n "Creating archive $BUILD.tar.gz ... "
66 tar -zcf ..
/$BUILD.
tar.gz
$BUILD
69 if [ ! -z "$PATCHDIR" ]; then
70 echo "Creating patches in $BUILD.patch ..."
71 [ -e "../${BUILD}.patch" ] || mkdir
"../$BUILD.patch"
72 for FILE
in $PATCHDIR/*; do
73 OLDBUILD
=$
(basename $FILE)
74 OLDVERSION
=${OLDBUILD/$PREFIX-/}
75 OLDVERSION
=${OLDVERSION/.tar.gz/}
76 echo -n "Creating patch against ${OLDVERSION} ... "
78 diff -urN $PREFIX-$OLDVERSION $BUILD |
gzip -c > ..
/${BUILD}.patch/$PREFIX-${OLDVERSION}_to_${VERSION}.
patch.gz
86 echo -n "Building doxygen documentation... "
87 doxygen docs
/dev
/omp.doxygen
> /dev
/null
&& cd docs
/doxygen
&& tar czf ..
/..
/${BUILD}-doxygen.
tar.gz html latex
&& cd ..
/..