Eileen has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/248274

Change subject: CRM-17435 Add option to generate drupal_7 directory version
......................................................................

CRM-17435 Add option to generate drupal_7 directory version

Change-Id: If7d44656d222b21b34da3ef23417bb85dbc1c820
---
M distmaker/distmaker.sh
A distmaker/dists/drupal7_dir_php5.sh
2 files changed, 105 insertions(+), 16 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/civicrm-core 
refs/changes/74/248274/1

diff --git a/distmaker/distmaker.sh b/distmaker/distmaker.sh
index 179c54a..71674a5 100755
--- a/distmaker/distmaker.sh
+++ b/distmaker/distmaker.sh
@@ -1,4 +1,4 @@
-#!/bin/bash -v
+#!/bin/bash
 set -e
 
 # This is distmaker script for CiviCRM
@@ -6,13 +6,17 @@
 # "Protected by an electric fence and copyright control."
 # Thanks to Kleptones for moral support when writing this.
 
-# Make sure that you have distmaker.conf file
-# in the same directory containing following lines:
+# You need to ensure the following variables are defined. They are 
traditionally defined
+# in distmaker.conf but you can also defined them as an environment variable 
or by
+# calling the script with env DM_REF_CORE=4.7 (for example).
 #
 # DM_SOURCEDIR=/home/user/svn/civicrm           <- sources
 # DM_GENFILESDIR=/home/user/generated           <- generated files
 # DM_TMPDIR=/tmp                                <- temporary files (will be 
deleted afterwards)
 # DM_TARGETDIR=/tmp/outdir                      <- target dir for tarballs
+# DM_REF_CORE=master                            <- Git branch/tag name
+#
+# Optional variables
 # DM_PHP=/opt/php5/bin/php                      <- php5 binary
 # DM_RSYNC=/usr/bin/rsync                       <- rsync binary
 # DM_VERSION=trunk.r1234                        <- what the version number 
should be
@@ -33,6 +37,7 @@
 # Set no actions by default
 D5PACK=0
 D56PACK=0
+D7DIR=0
 J5PACK=0
 WP5PACK=0
 SK5PACK=0
@@ -50,26 +55,67 @@
   echo "  l10n - generate internationalization data"
   echo "  d5   - generate Drupal7 PHP5 module"
   echo "  d5.6 - generate Drupal6 PHP5 module"
+  echo "  d7_dir -generate Drupal7 PHP5 module, but output to a directory, no 
tarball"
   echo "  j5   - generate Joomla PHP5 module"
   echo "  wp5  - generate Wordpress PHP5 module"
   echo "  sk - generate Drupal StarterKit module"
   echo
   echo "You also need to have distmaker.conf file in place."
   echo "See distmaker.conf.dist for example contents."
+  echo "Alternatively you can set the required variables as "
+  echo "environment variables, eg. for your machine or by calling "
+  echo "this script using "
   echo
+  echo "env DM_TARGETDIR=/path/to/output/dir/for/files/or/tarball distmaker.sh 
all"
+  echo
+  echo "optional environmentals:"
+  echo "   DM_SOURCEDIR "
+  echo "   DM_GENFILESDIR (default $TMPDIR/genfiles)"
+  echo "   DM_TARGETDIR= (default $TMPDIR/civicrm)"
+  echo
+  echo
+
 }
 
+THIS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )";
 
 # Check if config is ok.
 check_conf()
 {
+  if [ -f $P/distmaker.conf ] ; then
+    source "$P/distmaker.conf"
+  fi
+
+  if [ -z $DM_SOURCEDIR ] ; then
+    DM_SOURCEDIR="$THIS_DIR/..";
+    echo "Setting source dir to $DM_SOURCEDIR";
+  fi
+
+  if [ -z $DM_TMPDIR ] && [ -e $TMPDIR ] ; then
+    DM_TMPDIR=$TMPDIR/civicrm
+  fi
+
+  if [ -z $DM_GENFILESDIR ] && [ -e $TMPDIR ] ; then
+    DM_GENFILESDIR=$TMPDIR/genfiles
+  fi
+
+  if [ -z $DM_PACKAGESDIR ] ; then
+    DM_PACKAGESDIR="$DM_SOURCEDIR/packages"
+  fi
+
   # Test for distmaker.conf file availability, cannot proceed without it anyway
-  if [ ! -f $P/distmaker.conf ] ; then
-    echo; echo "ERROR! No distmaker.conf file available!"; echo;
+  if [ -z $DM_GENFILESDIR ] || [ -z $DM_TMPDIR ] || [ -z $DM_TARGETDIR ]; then
+    echo; echo "Required variables not defined!"; echo;
     display_usage
+    echo "your variables"
+    echo "DM_SOURCEDIR : $DM_SOURCEDIR";
+    echo "DM_TARGETDIR : $DM_TARGETDIR (required)";
+    echo "DM_TMPDIR : $DM_TMPDIR";
+    echo "DM_GENFILESDIR : $DM_GENFILESDIR";
+    echo "DM_PACKAGESDIR : $DM_PACKAGESDIR";
+    echo "Current directory is : $THIS_DIR";
     exit 1
   else
-    source "$P/distmaker.conf"
     export DM_SOURCEDIR DM_GENFILESDIR DM_TMPDIR DM_TARGETDIR DM_PHP DM_RSYNC 
DM_ZIP DM_VERSION DM_REF_CORE DM_REF_DRUPAL DM_REF_DRUPAL6 DM_REF_JOOMLA 
DM_REF_WORDPRESS DM_REF_PACKAGES
     if [ ! -d "$DM_SOURCEDIR" ]; then
       echo; echo "ERROR! " DM_SOURCEDIR "directory not found!"; echo "(if you 
get empty directory name, it might mean that one of necessary variables is not 
set)"; echo;
@@ -83,15 +129,6 @@
         mkdir -p "$k"
       fi
     done
-  fi
-}
-
-# Check if PHP4 converstion happened
-check_php4()
-{
-  if [ ! $PHP4GENERATED = 1 ]; then
-    echo; echo "ERROR! Cannot package PHP4 version without running 
conversion!"; echo;
-    exit 1
   fi
 }
 
@@ -111,6 +148,12 @@
   d5)
   echo; echo "Generating Drupal7 PHP5 module"; echo;
   D5PACK=1
+  ;;
+
+  # Drupal 7 - Output to directory
+  d7_dir)
+  echo; echo "Generating Drupal7 Directory"; echo;
+  D7DIR=1
   ;;
 
   # DRUPAL7 PHP5 StarterKit package
@@ -158,7 +201,7 @@
 
 ## Make sure we have the right branch or tag
 dm_git_checkout "$DM_SOURCEDIR" "$DM_REF_CORE"
-dm_git_checkout "$DM_SOURCEDIR/packages" "$DM_REF_PACKAGES"
+dm_git_checkout "$DM_PACKAGESDIR" "$DM_REF_PACKAGES"
 
 ## in theory, this shouldn't matter, but GenCode is CMS-dependent, and we've 
been doing our past builds based on D7
 dm_git_checkout "$DM_SOURCEDIR/drupal" "$DM_REF_DRUPAL"
@@ -191,6 +234,12 @@
   bash $P/dists/drupal_php5.sh
 fi
 
+if [ "$D7DIR" = 1 ]; then
+  echo; echo "Packaging for Drupal7, Directory not tarball, PHP5 version"; 
echo;
+  dm_git_checkout "$DM_SOURCEDIR/drupal" "$DM_REF_DRUPAL"
+  bash $P/dists/drupal7_dir_php5.sh
+fi
+
 if [ "$SKPACK" = 1 ]; then
   echo; echo "Packaging for Drupal7, PHP5 StarterKit version"; echo;
   dm_git_checkout "$DM_SOURCEDIR/drupal" "$DM_REF_DRUPAL"
diff --git a/distmaker/dists/drupal7_dir_php5.sh 
b/distmaker/dists/drupal7_dir_php5.sh
new file mode 100644
index 0000000..b2b2861
--- /dev/null
+++ b/distmaker/dists/drupal7_dir_php5.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+set -ex
+
+P=`dirname $0`
+CFFILE=$P/../distmaker.conf
+if [ ! -f $CFFILE ] ; then
+  echo "NO DISTMAKER.CONF FILE! Make sure all parameters are defined elsewhere"
+else
+  . $CFFILE
+fi
+. "$P/common.sh"
+
+SRC=$DM_SOURCEDIR
+TRG=$DM_TMPDIR/civicrm
+
+if [ -z $DM_PACKAGESDIR ] ; then
+  DM_PACKAGESDIR="$SRC/packages"
+fi
+
+if [ -z $DM_DRUPALDIR ] ; then
+  DM_DRUPALDIR="$SRC/drupal"
+fi
+
+# copy all the stuff
+dm_reset_dirs "$TRG"
+cp $DM_DRUPALDIR/civicrm.config.php.drupal $TRG/civicrm.config.php
+dm_generate_version "$TRG/civicrm-version.php" Drupal
+dm_install_core "$SRC" "$TRG"
+dm_install_packages $DM_PACKAGESDIR "$TRG/packages"
+dm_install_vendor "$SRC/vendor" "$TRG/vendor"
+dm_install_bower "$SRC/bower_components" "$TRG/bower_components"
+dm_install_drupal "$DM_DRUPALDIR" "$TRG/drupal"
+
+# gen tarball
+cd $TRG
+rm -r $DM_TARGETDIR/*
+mv * $DM_TARGETDIR
+
+# clean up
+rm -rf $TRG

-- 
To view, visit https://gerrit.wikimedia.org/r/248274
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If7d44656d222b21b34da3ef23417bb85dbc1c820
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/civicrm-core
Gerrit-Branch: civi-4.6.9
Gerrit-Owner: Eileen <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to