Commit | Line | Data |
---|---|---|
6a488035 | 1 | #!/bin/bash |
7c71cbb4 | 2 | set -ex |
6a488035 TO |
3 | |
4 | # This script assumes | |
5 | # that DAOs are generated | |
6 | # and all the necessary conversions had place! | |
7 | ||
8 | P=`dirname $0` | |
9 | CFFILE=$P/../distmaker.conf | |
10 | ||
11 | if [ ! -f $CFFILE ] ; then | |
12 | echo "NO DISTMAKER.CONF FILE!" | |
13 | exit 1 | |
14 | else | |
15 | . $CFFILE | |
16 | fi | |
17 | ||
69ff4a4a | 18 | . "$P/common.sh" |
19 | ||
ee752347 | 20 | RSYNCOPTIONS="-avC $DM_EXCLUDES_RSYNC --include=core" |
6a488035 TO |
21 | RSYNCCOMMAND="$DM_RSYNC $RSYNCOPTIONS" |
22 | SRC=$DM_SOURCEDIR | |
23 | TRG=$DM_TMPDIR/civicrm | |
24 | ||
bed96570 TO |
25 | # checkout the right code revisions |
26 | pushd "$DM_SOURCEDIR/joomla" | |
27 | git checkout "$DM_REF_JOOMLA" | |
28 | popd | |
29 | ||
6a488035 TO |
30 | # make sure and clean up before |
31 | if [ -d $TRG ] ; then | |
32 | rm -rf $TRG/* | |
33 | fi | |
34 | ||
35 | # copy all the rest of the stuff | |
69ff4a4a | 36 | dm_install_core "$SRC" "$TRG" |
9f0ca23d | 37 | dm_install_packages "$SRC/packages" "$TRG/packages" |
38 | for CODE in joomla ; do | |
6a488035 TO |
39 | echo $CODE |
40 | [ -d $SRC/$CODE ] && $RSYNCCOMMAND $SRC/$CODE $TRG | |
41 | done | |
42 | ||
6a488035 | 43 | # copy docs |
6a488035 | 44 | cp $SRC/civicrm.config.php $TRG |
30a50cd8 | 45 | dm_generate_version "$TRG/civicrm-version.php" Joomla |
6a488035 TO |
46 | |
47 | # gen zip file | |
48 | cd $DM_TMPDIR; | |
49 | ||
50 | mkdir com_civicrm | |
51 | mkdir com_civicrm/admin | |
52 | mkdir com_civicrm/site | |
53 | mkdir com_civicrm/site/elements | |
54 | mkdir com_civicrm/admin/civicrm | |
55 | mkdir com_civicrm/admin/language | |
56 | mkdir com_civicrm/admin/language/en-GB | |
57 | mkdir com_civicrm/admin/helpers | |
58 | mkdir com_civicrm/admin/plugins | |
59 | ||
60 | # copying back end code to admin folder | |
61 | cp civicrm/joomla/script.civicrm.php com_civicrm/ | |
62 | cp civicrm/joomla/admin/admin.civicrm.php com_civicrm/admin | |
63 | cp civicrm/joomla/admin/config.xml com_civicrm/admin | |
64 | cp civicrm/joomla/admin/configure.php com_civicrm/admin | |
65 | cp civicrm/joomla/admin/license.civicrm.txt com_civicrm/admin | |
66 | cp civicrm/joomla/admin/toolbar.civicrm.php com_civicrm/admin | |
67 | cp civicrm/joomla/admin/toolbar.civicrm.html.php com_civicrm/admin | |
68 | cp -r -p civicrm/joomla/admin/helpers/* com_civicrm/admin/helpers | |
69 | cp -r -p civicrm/joomla/admin/plugins/* com_civicrm/admin/plugins | |
70 | cp civicrm/joomla/admin/language/en-GB/* com_civicrm/admin/language/en-GB | |
71 | ||
01ad1437 DL |
72 | # joomla 3.0 like admin.civicrm.php to be called civicrm.php |
73 | # lets keep both versions there | |
74 | cp com_civicrm/admin/admin.civicrm.php com_civicrm/admin/civicrm.php | |
6a488035 TO |
75 | |
76 | # copying front end code | |
77 | cp civicrm/joomla/site/civicrm.html.php com_civicrm/site | |
78 | cp civicrm/joomla/site/civicrm.php com_civicrm/site | |
79 | cp -r civicrm/joomla/site/views com_civicrm/site | |
80 | cp -r -p civicrm/joomla/site/elements/* com_civicrm/site/elements | |
81 | ||
82 | # copy civicrm code | |
83 | cp -r -p civicrm/* com_civicrm/admin/civicrm | |
84 | ||
85 | # generate alt version of civicrm.xml | |
86 | $DM_PHP $DM_SOURCEDIR/distmaker/utils/joomlaxml.php $DM_SOURCEDIR com_civicrm $DM_VERSION alt | |
87 | ||
88 | # generate alt version of package | |
89 | $DM_ZIP -q -r -9 $DM_TARGETDIR/civicrm-$DM_VERSION-joomla-alt.zip com_civicrm | |
90 | ||
91 | # delete the civicrm directory | |
92 | rm -rf com_civicrm/admin/civicrm | |
93 | ||
94 | # generate zip version of civicrm.xml | |
95 | $DM_PHP $DM_SOURCEDIR/distmaker/utils/joomlaxml.php $DM_SOURCEDIR com_civicrm $DM_VERSION zip | |
96 | ||
97 | $DM_ZIP -q -r -9 com_civicrm/admin/civicrm.zip civicrm | |
98 | ||
99 | # generate zip within zip file | |
100 | $DM_ZIP -q -r -9 $DM_TARGETDIR/civicrm-$DM_VERSION-joomla.zip com_civicrm -x 'com_civicrm/admin/civicrm' | |
101 | ||
102 | # clean up | |
103 | rm -rf com_civicrm | |
104 | rm -rf $TRG |