distmaker - Increase verbosity
[civicrm-core.git] / distmaker / dists / drupal_sk_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 RSYNCOPTIONS="-avC $DM_EXCLUDES_RSYNC --include=core"
19 RSYNCCOMMAND="$DM_RSYNC $RSYNCOPTIONS"
20 SRC=$DM_SOURCEDIR
21 TRG=$DM_TMPDIR/civicrm
22
23 # checkout the right code revisions
24 pushd "$DM_SOURCEDIR/drupal"
25 git checkout "$DM_REF_DRUPAL"
26 popd
27
28 # make sure and clean up before
29 if [ -d $TRG ] ; then
30 rm -rf $TRG/*
31 fi
32
33 # copy all the stuff
34 for CODE in css i js packages PEAR templates bin CRM api drupal extern Reports install settings; do
35 echo $CODE
36 [ -d $SRC/$CODE ] && $RSYNCCOMMAND $SRC/$CODE $TRG
37 done
38
39 # delete any setup.sh or setup.php4.sh if present
40 if [ -d $TRG/bin ] ; then
41 rm -f $TRG/bin/setup.sh
42 rm -f $TRG/bin/setup.php4.sh
43 rm -f $TRG/bin/setup.bat
44 fi
45
46 # delete packages that distributions on Drupal.org repalce if present
47 # also delete stuff that we dont really use and should not be included
48 rm -rf $TRG/packages/dompdf
49 rm -rf $TRG/packages/IDS
50 rm -rf $TRG/packages/jquery
51 rm -rf $TRG/packages/ckeditor
52 rm -rf $TRG/packages/tinymce
53 rm -rf $TRG/joomla
54 rm -rf $TRG/WordPress
55
56 # copy selected sqls
57 if [ ! -d $TRG/sql ] ; then
58 mkdir $TRG/sql
59 fi
60
61 for F in $SRC/sql/civicrm*.mysql $SRC/sql/counties.US.sql.gz $SRC/sql/case_sample*.mysql; do
62 cp $F $TRG/sql
63 done
64
65 set +e
66 rm -rf $TRG/sql/civicrm_*.??_??.mysql
67 set -e
68
69 # copy docs
70 cp $SRC/agpl-3.0.txt $TRG
71 cp $SRC/gpl.txt $TRG
72 cp $SRC/README.txt $TRG
73 cp $SRC/Sponsors.txt $TRG
74 cp $SRC/agpl-3.0.exception.txt $TRG
75 cp $SRC/drupal/civicrm.config.php.drupal $TRG/civicrm.config.php
76
77 # final touch
78 echo "<?php
79 function civicrmVersion( ) {
80 return array( 'version' => '$DM_VERSION',
81 'cms' => 'Drupal',
82 'revision' => '$DM_REVISION' );
83 }
84 " > $TRG/civicrm-version.php
85
86 # gen tarball
87 cd $TRG/..
88 tar czf $DM_TARGETDIR/civicrm-$DM_VERSION-starterkit.tgz civicrm
89
90 # clean up
91 rm -rf $TRG