distmaker - Remove dead code. Shift comments.
[civicrm-core.git] / distmaker / dists / wordpress_php5.sh
1 #!/bin/bash
2 set -ex
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
18 . "$P/common.sh"
19
20 SRC=$DM_SOURCEDIR
21 TRG=$DM_TMPDIR/civicrm
22
23 # checkout the right code revisions
24 pushd "$DM_SOURCEDIR/WordPress"
25 git checkout "$DM_REF_WORDPRESS"
26 popd
27
28 # make sure and clean up before
29 if [ -d $TRG ] ; then
30 rm -rf $TRG/*
31 fi
32
33 if [ ! -d $TRG ] ; then
34 mkdir $TRG
35 fi
36
37 if [ ! -d $TRG/civicrm ] ; then
38 mkdir $TRG/civicrm
39 fi
40
41 if [ ! -d $TRG/civicrm/civicrm ] ; then
42 mkdir $TRG/civicrm/civicrm
43 fi
44
45 # copy all the stuff
46 dm_install_core "$SRC" "$TRG/civicrm/civicrm"
47 dm_install_packages "$SRC/packages" "$TRG/civicrm/civicrm/packages"
48
49 for F in $SRC/WordPress/*; do
50 cp $F $TRG/civicrm
51 done
52 rm -f $TRG/civicrm/civicrm.config.php.wordpress
53
54 # copy docs
55 cp $SRC/WordPress/civicrm.config.php.wordpress $TRG/civicrm/civicrm/civicrm.config.php
56 dm_generate_version "$TRG/civicrm/civicrm/civicrm-version.php" Wordpress
57
58 # gen tarball
59 cd $TRG
60 $DM_ZIP -r -9 $DM_TARGETDIR/civicrm-$DM_VERSION-wordpress.zip *
61 # clean up
62 rm -rf $TRG