4 # This is distmaker script for CiviCRM
6 # "Protected by an electric fence and copyright control."
7 # Thanks to Kleptones for moral support when writing this.
9 # Make sure that you have distmaker.conf file
10 # in the same directory containing following lines:
12 # DM_SOURCEDIR=/home/user/svn/civicrm <- sources
13 # DM_GENFILESDIR=/home/user/generated <- generated files
14 # DM_TMPDIR=/tmp <- temporary files (will be deleted afterwards)
15 # DM_TARGETDIR=/tmp/outdir <- target dir for tarballs
16 # DM_PHP=/opt/php5/bin/php <- php5 binary
17 # DM_RSYNC=/usr/bin/rsync <- rsync binary
18 # DM_VERSION=trunk.r1234 <- what the version number should be
19 # DM_ZIP=/usr/bin/zip <- zip binary
22 # ========================================================
24 # ========================================================
27 # Where are we called from?
32 # List of files to exclude from all tarballs
33 DM_EXCLUDES
=".git .svn packages/_ORIGINAL_ packages/SeleniumRC packages/PHPUnit packages/PhpDocumentor packages/SymfonyComponents packages/amavisd-new packages/git-footnote"
34 for DM_EXCLUDE
in $DM_EXCLUDES ; do
35 DM_EXCLUDES_RSYNC
="--exclude=${DM_EXCLUDE} ${DM_EXCLUDES_RSYNC}"
37 ## Note: These small folders have items that previously were not published,
38 ## but there's no real cost to including them, and excluding them seems
39 ## likely to cause confusion as the codebase evolves:
40 ## packages/Files packages/PHP packages/Text
41 export DM_EXCLUDES DM_EXCLUDES_RSYNC
43 # Set no actions by default
56 echo " distmaker.sh OPTION"
58 echo "Options available:"
59 echo " all - generate all available tarballs"
60 echo " l10n - generate internationalization data"
61 echo " d5 - generate Drupal7 PHP5 module"
62 echo " d5.6 - generate Drupal6 PHP5 module"
63 echo " j5 - generate Joomla PHP5 module"
64 echo " wp5 - generate Wordpress PHP5 module"
65 echo " sk - generate Drupal StarterKit module"
67 echo "You also need to have distmaker.conf file in place."
68 echo "See distmaker.conf.dist for example contents."
73 # Check if config is ok.
76 # Test for distmaker.conf file availability, cannot proceed without it anyway
77 if [ ! -f $P/distmaker.conf
] ; then
78 echo; echo "ERROR! No distmaker.conf file available!"; echo;
82 source "$P/distmaker.conf"
83 export DM_SOURCEDIR DM_GENFILESDIR DM_TMPDIR DM_TARGETDIR DM_PHP DM_RSYNC DM_ZIP DM_VERSION DM_REF_CORE DM_REF_DRUPAL DM_REF_DRUPAL6 DM_REF_JOOMLA DM_REF_WORDPRESS DM_REF_PACKAGES
84 for k
in "$DM_SOURCEDIR" "$DM_GENFILESDIR" "$DM_TARGETDIR" "$DM_TMPDIR"; do
85 if [ ! -d "$k" ] ; then
86 echo; echo "ERROR! " $k "directory not found!"; echo "(if you get empty directory name, it might mean that one of necessary variables is not set)"; echo;
93 # Check if PHP4 converstion happened
96 if [ ! $PHP4GENERATED = 1 ]; then
97 echo; echo "ERROR! Cannot package PHP4 version without running conversion!"; echo;
106 # Figure out what to do
110 echo; echo "Generating L10N module"; echo;
116 echo; echo "Generating Drupal7 PHP5 module"; echo;
120 # DRUPAL7 PHP5 StarterKit package
122 echo; echo "Generating Drupal7 PHP5 starter kit minimal module"; echo;
128 echo; echo "Generating Drupal6 PHP5 module"; echo;
134 echo; echo "Generating Joomla PHP5 module"; echo;
140 echo; echo "Generating Wordpress PHP5 module"; echo;
146 echo; echo "Generating all we've got."; echo;
163 ## Make sure we have the right branch or tag
164 pushd "$DM_SOURCEDIR"
165 git checkout
"$DM_REF_CORE"
167 pushd "$DM_SOURCEDIR/packages"
168 git checkout
"$DM_REF_PACKAGES"
170 ## in theory, this shouldn't matter, but GenCode is CMS-dependent, and we've been doing our past builds based on D7
171 pushd "$DM_SOURCEDIR/drupal"
172 git checkout
"$DM_REF_DRUPAL"
175 # Before anything - regenerate DAOs
178 $DM_PHP GenCode.php schema
/Schema.xml
$DM_VERSION
182 if [ "$L10NPACK" = 1 ]; then
183 echo; echo "Packaging for L10N"; echo;
184 bash
$P/dists
/l10n.sh
187 if [ "$D56PACK" = 1 ]; then
188 echo; echo "Packaging for Drupal6, PHP5 version"; echo;
189 bash
$P/dists
/drupal6_php5.sh
192 if [ "$D5PACK" = 1 ]; then
193 echo; echo "Packaging for Drupal7, PHP5 version"; echo;
194 bash
$P/dists
/drupal_php5.sh
197 if [ "$SKPACK" = 1 ]; then
198 echo; echo "Packaging for Drupal7, PHP5 StarterKit version"; echo;
199 bash
$P/dists
/drupal_sk_php5.sh
202 if [ "$J5PACK" = 1 ]; then
203 echo; echo "Packaging for Joomla, PHP5 version"; echo;
204 bash
$P/dists
/joomla_php5.sh
207 if [ "$WP5PACK" = 1 ]; then
208 echo; echo "Packaging for Wordpress, PHP5 version"; echo;
209 bash
$P/dists
/wordpress_php5.sh
212 unset DM_SOURCEDIR DM_GENFILESDIR DM_TARGETDIR DM_TMPDIR DM_PHP DM_RSYNC DM_VERSION DM_ZIP
213 echo;echo "DISTMAKER Done.";echo;