distmaker - Extract function dm_install_packages()
[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 RSYNCOPTIONS="-avC $DM_EXCLUDES_RSYNC --include=core"
21 RSYNCCOMMAND="$DM_RSYNC $RSYNCOPTIONS"
22 SRC=$DM_SOURCEDIR
23 TRG=$DM_TMPDIR/civicrm
24
25 # checkout the right code revisions
26 pushd "$DM_SOURCEDIR/WordPress"
27 git checkout "$DM_REF_WORDPRESS"
28 popd
29
30 # make sure and clean up before
31 if [ -d $TRG ] ; then
32 rm -rf $TRG/*
33 fi
34
35 if [ ! -d $TRG ] ; then
36 mkdir $TRG
37 fi
38
39 if [ ! -d $TRG/civicrm ] ; then
40 mkdir $TRG/civicrm
41 fi
42
43 if [ ! -d $TRG/civicrm/civicrm ] ; then
44 mkdir $TRG/civicrm/civicrm
45 fi
46
47 # copy all the stuff
48 dm_install_core "$SRC" "$TRG/civicrm/civicrm"
49 dm_install_packages "$SRC/packages" "$TRG/civicrm/civicrm/packages"
50
51 for F in $SRC/WordPress/*; do
52 cp $F $TRG/civicrm
53 done
54 rm -f $TRG/civicrm/civicrm.config.php.wordpress
55
56 # copy docs
57 cp $SRC/WordPress/civicrm.config.php.wordpress $TRG/civicrm/civicrm/civicrm.config.php
58
59 # final touch
60 echo "<?php
61 function civicrmVersion( ) {
62 return array( 'version' => '$DM_VERSION',
63 'cms' => 'Wordpress',
64 'revision' => '$DM_REVISION' );
65 }
66 " > $TRG/civicrm/civicrm/civicrm-version.php
67
68 # gen tarball
69 cd $TRG
70 $DM_ZIP -r -9 $DM_TARGETDIR/civicrm-$DM_VERSION-wordpress.zip *
71 # clean up
72 rm -rf $TRG