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?
31 source "$P/dists/common.sh"
33 # Set no actions by default
46 echo " distmaker.sh OPTION"
48 echo "Options available:"
49 echo " all - generate all available tarballs"
50 echo " l10n - generate internationalization data"
51 echo " d5 - generate Drupal7 PHP5 module"
52 echo " d5.6 - generate Drupal6 PHP5 module"
53 echo " j5 - generate Joomla PHP5 module"
54 echo " wp5 - generate Wordpress PHP5 module"
55 echo " sk - generate Drupal StarterKit module"
57 echo "You also need to have distmaker.conf file in place."
58 echo "See distmaker.conf.dist for example contents."
63 # Check if config is ok.
66 # Test for distmaker.conf file availability, cannot proceed without it anyway
67 if [ ! -f $P/distmaker.conf
] ; then
68 echo; echo "ERROR! No distmaker.conf file available!"; echo;
72 source "$P/distmaker.conf"
73 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
74 if [ ! -d "$DM_SOURCEDIR" ]; then
75 echo; echo "ERROR! " DM_SOURCEDIR
"directory not found!"; echo "(if you get empty directory name, it might mean that one of necessary variables is not set)"; echo;
77 for k
in "$DM_GENFILESDIR" "$DM_TARGETDIR" "$DM_TMPDIR"; do
79 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;
82 if [ ! -d "$k" ]; then
89 # Check if PHP4 converstion happened
92 if [ ! $PHP4GENERATED = 1 ]; then
93 echo; echo "ERROR! Cannot package PHP4 version without running conversion!"; echo;
102 # Figure out what to do
106 echo; echo "Generating L10N module"; echo;
112 echo; echo "Generating Drupal7 PHP5 module"; echo;
116 # DRUPAL7 PHP5 StarterKit package
118 echo; echo "Generating Drupal7 PHP5 starter kit minimal module"; echo;
124 echo; echo "Generating Drupal6 PHP5 module"; echo;
130 echo; echo "Generating Joomla PHP5 module"; echo;
136 echo; echo "Generating Wordpress PHP5 module"; echo;
142 echo; echo "Generating all we've got."; echo;
159 ## Make sure we have the right branch or tag
160 dm_git_checkout
"$DM_SOURCEDIR" "$DM_REF_CORE"
161 dm_git_checkout
"$DM_SOURCEDIR/packages" "$DM_REF_PACKAGES"
163 ## in theory, this shouldn't matter, but GenCode is CMS-dependent, and we've been doing our past builds based on D7
164 dm_git_checkout
"$DM_SOURCEDIR/drupal" "$DM_REF_DRUPAL"
166 ## Get latest dependencies
167 dm_generate_vendor
"$DM_SOURCEDIR"
168 dm_generate_bower
"$DM_SOURCEDIR"
170 # Before anything - regenerate DAOs
173 ${DM_PHP:-php} GenCode.php schema
/Schema.xml
$DM_VERSION
177 if [ "$L10NPACK" = 1 ]; then
178 echo; echo "Packaging for L10N"; echo;
179 bash
$P/dists
/l10n.sh
182 if [ "$D56PACK" = 1 ]; then
183 echo; echo "Packaging for Drupal6, PHP5 version"; echo;
184 dm_git_checkout
"$DM_SOURCEDIR/drupal" "$DM_REF_DRUPAL6"
185 bash
$P/dists
/drupal6_php5.sh
188 if [ "$D5PACK" = 1 ]; then
189 echo; echo "Packaging for Drupal7, PHP5 version"; echo;
190 dm_git_checkout
"$DM_SOURCEDIR/drupal" "$DM_REF_DRUPAL"
191 bash
$P/dists
/drupal_php5.sh
194 if [ "$SKPACK" = 1 ]; then
195 echo; echo "Packaging for Drupal7, PHP5 StarterKit version"; echo;
196 dm_git_checkout
"$DM_SOURCEDIR/drupal" "$DM_REF_DRUPAL"
197 bash
$P/dists
/drupal_sk_php5.sh
200 if [ "$J5PACK" = 1 ]; then
201 echo; echo "Packaging for Joomla, PHP5 version"; echo;
202 dm_git_checkout
"$DM_SOURCEDIR/joomla" "$DM_REF_JOOMLA"
203 bash
$P/dists
/joomla_php5.sh
206 if [ "$WP5PACK" = 1 ]; then
207 echo; echo "Packaging for Wordpress, PHP5 version"; echo;
208 dm_git_checkout
"$DM_SOURCEDIR/WordPress" "$DM_REF_WORDPRESS"
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;