| 1 | #!/bin/bash |
| 2 | set -ex |
| 3 | |
| 4 | P=`dirname $0` |
| 5 | CFFILE=$P/../distmaker.conf |
| 6 | if [ ! -f $CFFILE ] ; then |
| 7 | echo "NO DISTMAKER.CONF FILE!" |
| 8 | exit 1 |
| 9 | else |
| 10 | . $CFFILE |
| 11 | fi |
| 12 | . "$P/common.sh" |
| 13 | |
| 14 | SRC=$DM_SOURCEDIR |
| 15 | TRG=$DM_TMPDIR/civicrm |
| 16 | |
| 17 | # copy all the rest of the stuff |
| 18 | dm_reset_dirs "$TRG" "$DM_TMPDIR/com_civicrm" |
| 19 | cp $SRC/civicrm.config.php $TRG |
| 20 | dm_generate_version "$TRG/civicrm-version.php" Joomla |
| 21 | dm_install_core "$SRC" "$TRG" |
| 22 | dm_install_packages "$SRC/packages" "$TRG/packages" |
| 23 | dm_install_vendor "$SRC/vendor" "$TRG/vendor" |
| 24 | dm_install_bower "$SRC/bower_components" "$TRG/bower_components" |
| 25 | |
| 26 | ## WTF: It's so good we'll install it twice! |
| 27 | ## (The first is probably extraneous, but there could be bugs dependent on it.) |
| 28 | dm_install_joomla "$SRC/joomla" "$TRG/joomla" |
| 29 | dm_install_joomla "$SRC/joomla" "$DM_TMPDIR/com_civicrm" |
| 30 | |
| 31 | ## joomla 3.0 likes admin.civicrm.php to be called civicrm.php; keep both names |
| 32 | cp "$SRC/joomla/admin/admin.civicrm.php" "$DM_TMPDIR/com_civicrm/admin/civicrm.php" |
| 33 | |
| 34 | # gen zip file |
| 35 | cd $DM_TMPDIR; |
| 36 | |
| 37 | # generate alt version of package |
| 38 | cp -r -p civicrm com_civicrm/admin/civicrm |
| 39 | ${DM_PHP:-php} $DM_SOURCEDIR/distmaker/utils/joomlaxml.php $DM_SOURCEDIR com_civicrm $DM_VERSION alt |
| 40 | ${DM_ZIP:-zip} -q -r -9 $DM_TARGETDIR/civicrm-$DM_VERSION-joomla-alt.zip com_civicrm |
| 41 | rm -rf com_civicrm/admin/civicrm |
| 42 | |
| 43 | # generate zip version of civicrm.xml |
| 44 | ${DM_PHP:-php} $DM_SOURCEDIR/distmaker/utils/joomlaxml.php $DM_SOURCEDIR com_civicrm $DM_VERSION zip |
| 45 | ${DM_ZIP:-zip} -q -r -9 com_civicrm/admin/civicrm.zip civicrm |
| 46 | ${DM_ZIP:-zip} -q -r -9 $DM_TARGETDIR/civicrm-$DM_VERSION-joomla.zip com_civicrm -x 'com_civicrm/admin/civicrm' |
| 47 | |
| 48 | # clean up |
| 49 | rm -rf com_civicrm |
| 50 | rm -rf $TRG |