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
47 echo " distmaker.sh OPTION"
49 echo "Options available:"
50 echo " all - generate all available tarballs"
51 echo " l10n - generate internationalization data"
52 echo " Backdrop - generate Backdrop PHP5 module"
53 echo " Drupal|d5 - generate Drupal7 PHP5 module"
54 echo " Drupal6|d5.6 - generate Drupal6 PHP5 module"
55 echo " Joomla|j5 - generate Joomla PHP5 module"
56 echo " WordPress|wp5 - generate Wordpress PHP5 module"
57 echo " sk - generate Drupal StarterKit module"
59 echo "You also need to have distmaker.conf file in place."
60 echo "See distmaker.conf.dist for example contents."
65 # Check if config is ok.
68 # Test for distmaker.conf file availability, cannot proceed without it anyway
69 if [ ! -f $P/distmaker.conf
] ; then
70 echo; echo "ERROR! No distmaker.conf file available!"; echo;
74 source "$P/distmaker.conf"
75 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
76 if [ ! -d "$DM_SOURCEDIR" ]; then
77 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;
79 for k
in "$DM_GENFILESDIR" "$DM_TARGETDIR" "$DM_TMPDIR"; do
81 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;
84 if [ ! -d "$k" ]; then
91 # Check if PHP4 converstion happened
94 if [ ! $PHP4GENERATED = 1 ]; then
95 echo; echo "ERROR! Cannot package PHP4 version without running conversion!"; echo;
104 # Figure out what to do
108 echo; echo "Generating L10N module"; echo;
114 echo; echo "Generating Backdrop PHP5 module"; echo;
120 echo; echo "Generating Drupal7 PHP5 module"; echo;
124 # DRUPAL7 PHP5 StarterKit package
126 echo; echo "Generating Drupal7 PHP5 starter kit minimal module"; echo;
132 echo; echo "Generating Drupal6 PHP5 module"; echo;
138 echo; echo "Generating Joomla PHP5 module"; echo;
144 echo; echo "Generating Wordpress PHP5 module"; echo;
150 echo; echo "Generating all we've got."; echo;
168 ## Make sure we have the right branch or tag
169 dm_git_checkout
"$DM_SOURCEDIR" "$DM_REF_CORE"
170 dm_git_checkout
"$DM_SOURCEDIR/packages" "$DM_REF_PACKAGES"
172 ## in theory, this shouldn't matter, but GenCode is CMS-dependent, and we've been doing our past builds based on D7
174 if [ -d "$DM_SOURCEDIR/backdrop" ]; then
175 dm_git_checkout
"$DM_SOURCEDIR/backdrop" "$DM_REF_BACKDROP"
178 if [ -d "$DM_SOURCEDIR/drupal" ]; then
179 dm_git_checkout
"$DM_SOURCEDIR/drupal" "$DM_REF_DRUPAL"
183 ## Get latest dependencies
184 dm_generate_vendor
"$DM_SOURCEDIR"
185 dm_generate_bower
"$DM_SOURCEDIR"
187 # Before anything - regenerate DAOs
190 ${DM_PHP:-php} GenCode.php schema
/Schema.xml
$DM_VERSION $GENCODE_CMS
194 if [ "$L10NPACK" = 1 ]; then
195 echo; echo "Packaging for L10N"; echo;
196 bash
$P/dists
/l10n.sh
199 if [ "$BPACK" = 1 ]; then
200 echo; echo "Packaging for Backdrop, PHP5 version"; echo;
201 dm_git_checkout
"$DM_SOURCEDIR/backdrop" "$DM_REF_BACKDROP"
202 bash
$P/dists
/backdrop_php5.sh
205 if [ "$D56PACK" = 1 ]; then
206 echo; echo "Packaging for Drupal6, PHP5 version"; echo;
207 dm_git_checkout
"$DM_SOURCEDIR/drupal" "$DM_REF_DRUPAL6"
208 bash
$P/dists
/drupal6_php5.sh
211 if [ "$D5PACK" = 1 ]; then
212 echo; echo "Packaging for Drupal7, PHP5 version"; echo;
213 dm_git_checkout
"$DM_SOURCEDIR/drupal" "$DM_REF_DRUPAL"
214 bash
$P/dists
/drupal_php5.sh
217 if [ "$SKPACK" = 1 ]; then
218 echo; echo "Packaging for Drupal7, PHP5 StarterKit version"; echo;
219 dm_git_checkout
"$DM_SOURCEDIR/drupal" "$DM_REF_DRUPAL"
220 bash
$P/dists
/drupal_sk_php5.sh
223 if [ "$J5PACK" = 1 ]; then
224 echo; echo "Packaging for Joomla, PHP5 version"; echo;
225 dm_git_checkout
"$DM_SOURCEDIR/joomla" "$DM_REF_JOOMLA"
226 bash
$P/dists
/joomla_php5.sh
229 if [ "$WP5PACK" = 1 ]; then
230 echo; echo "Packaging for Wordpress, PHP5 version"; echo;
231 dm_git_checkout
"$DM_SOURCEDIR/WordPress" "$DM_REF_WORDPRESS"
232 bash
$P/dists
/wordpress_php5.sh
235 unset DM_SOURCEDIR DM_GENFILESDIR DM_TARGETDIR DM_TMPDIR DM_PHP DM_RSYNC DM_VERSION DM_ZIP
236 echo;echo "DISTMAKER Done.";echo;