A Guide to Building eZ publish from Subversion Sources

Forword

eZ publish stable releases from (raw) svn sources are very different from 
the packaged zip/tar.gz/bz2 releases most average eZ publish users are
accustomed.

Introduction

To bridge this gap one must 'build' eZ publish which entails running the script

./bin/shell/makedist.sh

This script requires several dependancies above the base eZ publish dependancies.

Specificly the makedist.sh script requires the ezlupdate program which is provided
with eZ publish in source code form. ezlupdate must be compiled if your running on
a GNU/Linux system. In order to compile this required dependancy, you will need to 
make sure you have the TrollTech/QT Library + Tools installed (specificly the qt-devel files).

I built my copy of eZ publish stable/3.6 from svn sources using GNU/Linux,
Centos 4 which is an rpm/yum like GNU System similar to Redhat Enterprize Linux (RHEL).
This makes installing some of these dependancies much simpler to those without a lot of linux experiance.

Checklist

1) Package Dependancies
   yum install qt.i386 qt-devel.i386 qt-config.i386 qt-designer.i386
   yum install gcc-c++.i386

2) Get the eZ publish source via svn, I recommend the latest stable release from eZ systems / pubsvn
-> svn checkout http://pubsvn.ez.no/nextgen/stable/3.6

3) Build ezlupdate

For more information on this process please refer to these documents:

http://pubsvn.ez.no/nextgen/stable/3.6/support/lupdate-ezpublish3/README.txt

http://www.ez.no/ez_publish/documentation/configuration/configuration/language_and_charset/creating_a_new_translation

http://www.ez.no/br/ez_publish/download/translations/ezlupdate_and_linguist

a) Export the QT (Library) Directory (required for the compile)
-> export QTDIR="/usr/lib/qt-3.3"
b) Make Step 1
-> qmake ezlupdate.pro
c) Make Step 2 (compile)
-> make

If you get errors you may have an older version of qt or a different QTDIR location. I had problems with a) at first myself :)
If you don't have errors than everything should be good to go / continue :)


4) Build / Install php (cli) as /usr/bin/php





##############################################################################
#
##############################################################################






4) Build eZ publish

Review Build Script Options: ./bin/shell/makedist.sh --help

First Try:

./bin/shell/makedist.sh --final \
--with-release=http://pubsvn.ez.no/nextgen/stable/3.6 \
--db-name=ezph36 \
--db-user=publish \
--db-password=publish \
--db-host=localhost \
--db-type=mysql \
--mysql-user=publish \
--mysql-password=publish \
--mysql-host=localhost \
--use-working-copy          \
--help


Second Try:

./bin/shell/makedist.sh \
--db-name=ezph36 \
--db-user=publish \
--db-password=publish \
--db-host=localhost \
--db-type=mysql \
--mysql-user=publish \
--mysql-password=publish \
--mysql-host=localhost \
--build-root=/tmp/ez36   \
--final \
--with-svn-server=http://pubsvn.ez.no   \
--with-release=stable/3.6 


Final Command :

./bin/shell/makedist.sh --db-name=ezph36 --db-user=publish --db-password=publish --db-host=locally --db-type=mysql --mysql-user=publish --mysql-password=publish --mysql-host=locally --build-root=/tmp/ez36   --final --with-svn-server=http://pubsvn.ez.no   --with-release=stable/3.6


COMMAND OUTPUT:

Creating full release
Updating ezlupdate                                         [ Success ]
Connecting to MySQL using mysql://publish:***@locally
Connecting to PostgreSQL using postgresql://root@localhost
Checking out from server http://pubsvn.ez.no
Checking out trunk
SVN_PATH=http://pubsvn.ez.no/trunk
All operations are done from SVN server, official builds are possible
Distribution source files taken from /tmp/nextgen-stable/3.6
Checking db update version numbers                         [ Failure ]

************** WARNING **************

There are problems with the db update files
Run the following command to see what must be fixed
./bin/php/checkdbfiles.php

************** WARNING **************


*** HAD TO install php-cli to run the above file
chmod 775 bin/linux/php-cli


*** ALSO HAD TO customize bin/linux/common.sh to get it to run (which is hard coded like most of the svn tools to eZ systems internal resources)

RAN:     ./bin/linux/php-cli ./bin/php/checkdbfiles.php
         ./bin/linux/php-cli ./bin/php/checkdbfiles.php -qcv

*** ALSO HAD TO customize ./bin/php/checkdbfiles.php to get it to run (which is hard coded like most of the svn tools to eZ systems internal resources)


./bin/shell/makedist.sh

./bin/shell/makedist.sh --skip-db-check --skip-db-schema --skip-db-update --skip-version-check




















#-------------------------------------------------#



PROBLEM #1: Build Files are hard coded to eZ systems internal resources (zev.ez.no / svn.ez.no/svn/nextgen/ezpublish )
-> Question #1: How can we run these build scripts without customizing the build scripts every time we run them?

PROBLEM #2: Buill scripts do not allow for php-cli binary path to be passed instead it just expects that php to be php-cli
This is often not the case on most user/developer installations
-> Question #2: how can we tell the build scripts to use a custom php-cli binary sidebyside with a standard php binary? Passed Paramiter, Editing the script, Moving php to php-php and moving php-cli to php?

Problem # 2.1: This file has a problem expecting php-cli but getting standard php
./bin/php/checkdbfiles.php

Problem # 2.2: This file has a problem expecting php-cli but getting standard php
./bin/shell/phpcheck.sh



EVERY TIME I skip an option (which requires php-cli as php) i get another error ...

./bin/shell/makedist.sh --skip-db-check --skip-db-schema --skip-db-update --skip-version-check --skip-code-template-check

#----------------------------------------------#

SOOOOOOO To solve this I moved php around (not sure if this causes server problems later, i will move this back afterwards ...)

cp -a bin/linux/php-cli /usr/bin/php-cli
cp -a bin/linux/php-cli /usr/bin/php-cli

ln -s /usr/bin/php-cli /usr/bin/php
ls -la /usr/bin/php

lrwxrwxrwx  1 root root 16 Jun 13 04:05 /usr/bin/php -> /usr/bin/php-cli

Which seems to have solved the php-cli problems in the short term. 
Question: Is this the best solution from the php-developers / advanced users perspective?

#----------------------------------------------#

TTTHIS seemed to solve the problems .....








#-------------------------------------------------#












#----------------------------------------------#

CEPT SOME OF THE PREVIOUSLY REQUIRED CUSTOm MODIFCATIONS TO bin/shell/custom.sh? 
BROKE TRANSLATIONS PART

Examining settings directory                               [ Success ]
Exporting translations                                     [ Failure ]

svn export http://svn.ez.no/svn/translations/URL: http://pubsvn.ez.no/nextgen/stable/3.6/translations /tmp/ez-root/ezpublish-3.6.1/share/translations &>/dev/null
Failed to check out translations from trunk

########################

not knowing just what to do i started over (again)

./bin/shell/makedist.sh


finding my setup of the inital hacked files (see begining of makedisht/common.sh)
i find i can't build without db sql file errors (cause it's not checking against svn properly)
without skip options ...

 ./bin/shell/makedist.sh --skip-db-check --skip-db-schema --skip-db-update --skip-version-check

----------------

hrm, realizing i added anextra slash to changing eZ systems internal svn server to pubsvn server 
which kicked the first fatal error ....  translation (end) 

Per Instructions RAN...

 ./bin/linux/ezlupdate eng-US
 eng-US: 5193 known, 8 new and 0 obsoleted messages

and just in case ...

./bin/linux/ezlupdate eng-GB
eZ publish translations directory created: share/translations/eng-GB
 eng-GB: 0 known, 5201 new and 0 obsoleted messages

----------------

re run makedist ....
error didn't go away ... so ? added skip

 ./bin/shell/makedist.sh --skip-db-check --skip-db-schema --skip-db-update --skip-version-check --skip-translation

PROBLEM #3 Translations do not validate (possible svn problem?)

#-------------------------------------------------#

./bin/shell/makeaddonpackages.sh --export-path="/tmp/ez-root/ezpublish-3.6.1/packages/addons" --db-type=mysql --db-name=ezph36 --db-user=publish --db-password=publish  --db-host=localhost   --db-type=mysql
Connecting to DB using mysql://publish:***@localhost/ezph36
Failed to login with user admin
Created package contacts-3.6.1 Contacts
Attribute description was set to Adds a simple contact database, it contains companies and persons.
Attribute type was set to contentobject
Could not find content-node using path contacts
Failed adding items to package


NOTE: all above makebuild.sh should use --db-host=localhost instead of locally!!

 ./bin/shell/makedist.sh --skip-db-check --skip-db-schema --skip-db-update --skip-version-check --skip-translation  --db-host=localhost

./bin/shell/makeaddonpackages.sh --export-path="/tmp/ez-root/ezpublish-3.6.1/packages/addons" --db-type=mysql --db-name=ezph36 --db-user=publish --db-password=publish  --db-host=localhost   --db-type=mysql

./bin/shell/makeaddonpackages.sh --export-path="/tmp/ez-root/ezpublish-3.6.1/packages/addons" --db-type=mysql --db-name=ezph36 --db-user=publish --db-password=publish  --db-host=localhost   --db-type=mysql --help

 ./bin/shell/makeaddonpackages.sh --export-path="/tmp/ez-root/ezpublish-3.6.1/packages/addons" --db-type=mysql --db-name=ezpublish3svn --db-user=publish --db-password=publish  --db-host=localhost   --db-type=mysql
Connecting to DB using mysql://publish:***@localhost/ezpublish3svn
Version '' in database 'ezpublish3svn' is different from the running version 3.6.1

 ./bin/shell/makedist.sh --skip-translation  --db-host=localhost  --mysql-host=localhost --use-svn-server

./bin/shell/makedist.sh --use-svn-server --skip-translation  --db-host=localhost  --mysql-host=localhost --db-type=mysql


#-------------------------------------------------#

./bin/shell/makedist.sh --use-svn-server --skip-translation  --db-host=localhost  --mysql-host=localhost--db-type=mysql
Creating full release
Connecting to MySQL using mysql://publish:***@localhost--db-type=mysql
Connecting to PostgreSQL using postgresql://root@localhost
Using local copy from /home/web/family/site/3.6
All operations are done from SVN server, official builds are possible
Distribution source files taken from /home/web/site/3.6
Checking db update version numbers                         [ Failure ]

************** WARNING **************

There are problems with the db update files
Run the following command to see what must be fixed
./bin/php/checkdbfiles.php

************** WARNING **************

#-------------------------------------------------#

Recap?


PROBLEM #1: Build Files are hard coded to eZ systems internal resources (zev.ez.no / svn.ez.no/svn/nextgen/ezpublish )
-> Question #1: How can we run these build scripts without customizing the build scripts every time we run them?


PROBLEM #2: Buill scripts do not allow for php-cli binary path to be passed instead it just expects that php to be php-cli
This is often not the case on most user/developer installations
-> Question #2: how can we tell the build scripts to use a custom php-cli binary sidebyside with a standard php binary? Passed Paramiter, Editing the script, Moving php to php-php and moving php-cli to php?

Problem # 2.1: This file has a problem expecting php-cli but getting standard php
./bin/php/checkdbfiles.php

Problem # 2.2: This file has a problem expecting php-cli but getting standard php
./bin/shell/phpcheck.sh


PROBLEM #3 Translations do not validate (possible svn problem?)

PROBLEM #4 Addon package Errors (see above) 

#-------------------------------------------------#

Last Big Breakdown that does not work without skips:


PROBLEM #1 Build Files are hard coded to eZ systems internal resources
        Instead of accepting --option-paramiters to support commandline 
	override (suggest this in public-sdk mailling list.

PROBLEM #2 Installing php-cli as /usr/bin/php

PROBLEM #3 DB Upgrade File Version Check Errors ( Requires : --skip-version-check  to avoid (WHY!!))
         THIS IS THE #1 Build ERROR!

PROBLEM #4 Translations do not validate (possible svn problem?) (Requires: --skip-translation to avoid (WHY!@!))
         THIS IS THE #2 Build ERROR!

PROBLEM #5 Addon package Errors (see above, ralates to )

PROBLEM #10 Missing Option : Make Clean
            I see no way to make clean after the default options are entered the first time. Seems you need to remove the local copy and start over if you make a mistake :| 
	        Yet I see that their is a cache file created to hold these settings ".ezp.cache" in the checkout directory.

Question #10 : Can you add a option to reset the build to a clean state and start over without having to remove the local copy?

PROBLEM #11 Build script (4th try crom scratch build seems to have made or require now that postgres (db) be done at the same time (without skips in place) as mysql (no switch)
Question #11 : Can you add an option to build one db at a time instead of both at the same time?

EMAIL SysLogAdminList:  yum install postgresql-server.i386 postgresql-pl.i386 postgresql-contrib.i386 postgresql-devel.i386 postgresql.i386 php-pgsql.i386 postgresql-test.i386





./bin/shell/makedist.sh --db-name=ezpublish3svn --db-user=publish --db-password=publish --db-host=localhost --db-type=mysql --mysql-user=publish --mysql-password=publish --mysql-host=localhost  --final --with-svn-server=http://pubsvn.ez.no   --with-release=stable/3.6


#-------------------------------------------------#



















#---------------------------------------------#
Building eZ publish w/ Database Options
#---------------------------------------------#

# Remove any existing cache files? \
rm -rf .ezp.cache ; \

# Run Build Script
./bin/shell/makedist.sh \
 --skip-db-schema \
 --skip-db-check \
 --skip-db-update \
--use-svn-server \
--skip-translation \
\
--db-name=ezpublish3svn \
--db-user=publish \
--db-password=publish \
--db-host=localhost \
--db-type=mysql \
\
--mysql-user=publish \
--mysql-password=publish \
--mysql-host=localhost \
\
--final \


#---------------------------------------------#


Setting up Build Script (makedist.sh) DB Dependancies

Otherwise you can add these skip options to your build process 
to avoid doing this setup / work (not all db code is built/finalized)

./bin/shell/makedist.sh  --skip-db-schema --skip-db-check --skip-db-update --skip-sql-generation


1) MySQL 

2) PostgreSQL 

a) Show current databases:   \l
b) Show current users:   \du
c) Show current tables:   \d
d) Quit current connection to database (end program):   \q
e) Show current users w/ permissions:   \du
f) Access privileges for database "template1":   \dt
g) describe table attributes:   \d (tablename)
h) Show SQL Commands / Syntax:   \h (help like)
i) Show psql SQL Shortcut list:   \? 
j) psql --help ( cli text gui commands):   psql --help
k) pg_xxx other psql commands

su postgres

psql template1

CREATE DATABASE ezpublish3svn; 
commit;

CREATE USER publish;
commit;

exit; # postgres user, back to normal user session


#---------------------------------------------#

Suggestions / Patches


1) correct usage of --use-svn-server=(optional)

2) add clear options
   --clear-build-settings-cache
    rm -rf .ezp.cache

   --clear-build-root

3) DB options do not silently use the defaults when paramiters are not passed or used or needed, specificly.

--db-port
--mysql-socket

4) DB option to build only mysql or postgresql say:   --build-db-type=mysql
   Shouldn't this already exists like: --db-type=mysql


5) Editor option ? The default is vi but I use emacs :)
EDITOR='emacs'
--editor=emacs|vim|vi (defaults to vi)


6) Replace build script (bash) with eZ php / cli replacment
   At least a php replacement but a true eZ php cli might be nicer?
   Perhapse it's bash because eZ publish framework would not exist yet to use the eZ php/cli methods ...
   Yet sub / dependancy scripts do use eZ php / cli (see: ./bin/php/checkdbfiles.php)


#---------------------------------------------#


Dependancies with static options (svn server / svn options)

1) ./bin/shell/checkdbschema.sh

SCHEMA_URL="http://zev.ez.no/svn/nextgen/versions/$VERSION"
PREVIOUS_SCHEMA_URL="http://zev.ez.no/svn/nextgen/versions/$VERSION_PREVIOUS"


2) ./bin/php/checkdbfiles.php

a) $svn = "svn export http://zev.ez.no/svn/nextgen/stable/$version/update/database '$versionPath'";

b) Always kicks this error ...

 ./bin/php/checkdbfiles.php
C update/database/mysql/3.4/dbupdate-3.4.5-to-3.4.6.sql

even if the file is removed and updated ... (svn trunk error?)

#---------------------------------------------#

An interesting part of the makedist.sh script is that (just about) all
paramiters are required (non-optional) and must be passed in order to
prevent user shell prompting. (Specificly the DB / SVN Options)

#---------------------------------------------#

Another interesting note is that the option   --skip-version-check
Seems to be required to avoid the dreaded error... WHY?

ERROR:

Checking db update version numbers                         [ Failure ]

************** WARNING **************

There are problems with the db update files
Run the following command to see what must be fixed
./bin/php/checkdbfiles.php

************** WARNING **************

[root@labs 3.6]# ./bin/shell/makedist.sh --skip-version-check 

#---------------------------------------------#

Translation up to date check always fails ...

ERROR:

Examining settings directory                               [ Success ]
Exporting translations                                     [ Success ]
Processing: [24/24] translations                           [ Success ]
Validating                                                 [ Failure ]
The translations are not up to date
You must update the translations in the repository using the ezlupdate program



#---------------------------------------------#
Changelogs:                                                [ Skipped ]
Extra directories                                          [ Success ]
Creating and exporting addons                              [ Failure ]
The creation of addon packages failed
Run the following command to see what went wrong

./bin/shell/makeaddonpackages.sh --export-path="/tmp/ez-root/ezpublish-3.6.1/packages/addons" --db-type=mysql --ish3svn --db-user=publish --db-password=publish     --db-type=mysql

So instead i just skip ....

 ./bin/shell/makedist.sh --skip-version-check --skip-db-schema  --skip-db-check  --skip-db-update --skip-sql-generation --use-working-copy --skip-translation --skip-addons


This set of options created binaries (with cached ...)
 ./bin/shell/makedist.sh --skip-version-check --skip-db-schema  --skip-db-check  --skip-db-update --skip-sql-generation --use-working-copy --skip-translation --skip-addons

OUTPUT:


                                                           [ Success ]
Applying filters                                           [ Success ]
Checking SQL files for correctness                         [ Success ]
Looking for .svn directories                               [ Success ]
Looking for temp files                                     [ Success ]
Applying executable properties                             [ Success ]
Removing non-distribution files                            [ Success ]
Creating MD5 checksums                                     [ Success ]

 Building extension packages                               [ Skipped ]
Creating tar.gz file,  /tmp/ez-root/ezpublish-3.6.1.tar.gz
Creating tar.bz2 file, /tmp/ez-root/ezpublish-3.6.1.tar.bz2
Creating zip file,     /tmp/ez-root/ezpublish-3.6.1.zip

The following extensions have been packaged:



#---------------------------------------------#

Yet another Recap 

Options i have to skip to avoid errors ....
--skip-version-check  /# avoid db / postgres connection errors (first run)
--skip-db-schema  --skip-db-check  --skip-db-update --skip-sql-generation \ #(just in case? also required)
--use-working-copy \ #(can't connect to pubsvn reliably?)
--skip-translation \ #(
--skip-addons \ # (must skip addons (cause of --skip-version-check + db connection errors )

#---------------------------------------------#

Distribution source files

echo "Distribution source files taken from `$SETCOLOR_DIR`$DIST_SRC`$SETCOLOR_NORMAL`"

if [ "$SVN_EXPORT" == "svn" ]; then
    echo "All operations are done from SVN server, official builds are possible"
else
    echo "All operations are done from working copy (WC), only test builds are possible"
fi

#---------------------------------------------#

Documentation:
- Note : The order of arguments and options provided to
the script ( ./bin/shell/makedist.sh ) are vital to avoiding 
potential errors aka things not working as desired.

(Expanded Order Paragraph Descriptions and explanations)

#---------------------------------------------#


#
# *****   Copy the distribution files (using SVN property)   *****
#

if [ -z "$SKIP_CORE_FILES" ]; then
    echo
    echo "Copying directories and files"
    echo -n "`$SETCOLOR_COMMENT`Copying`$SETCOLOR_NORMAL` "

    (cd $DIST_SRC && scan_dir .)
    echo
    echo
fi


DIST_SRC
DEST_ROOT

#---------------------------------------------#
W/DB OPTIONS? (OLD)

./bin/shell/makedist.sh --db-name=ezpublish3svn --db-user=publish 
--db-password=publish --db-host=localhost --db-type=mysql --mysql-user=publish
--mysql-password=publish --mysql-host=localhost  
--final --with-svn-server=http://pubsvn.ez.no   --with-release=stable/3.6

W/DB OPTIONS? (OK)

./bin/shell/makedist.sh 
--with-svn-server=pubsvn.ez.no --with-release=3.6 --use-svn-server 
--skip-version-check --skip-db-schema  --skip-db-check  --skip-db-update 
--skip-sql-generation --skip-translation --skip-addons


W/DB OPTIONS? (OK)

./bin/shell/makedist.sh 
--with-svn-server=pubsvn.ez.no --with-release=3.6 --use-svn-server 
--skip-version-check
--db-name=ezpublish3svn --db-user=publish 
--db-password=publish --db-host=localhost --db-type=mysql --mysql-user=publish
--mysql-password=publish --mysql-host=localhost

SVN OPTIONS W/OUT DB OPTIONS?

 ./bin/shell/makedist.sh 
 --with-svn-server=pubsvn.ez.no --with-release=3.6 --use-svn-server 
 --skip-version-check --skip-db-schema  --skip-db-check  --skip-db-update --skip-sql-generation --skip-translation --skip-addons


#---------------------------------------------#

Script Modifications (GETTING SVN SOURCES into temp dir (static dir) + chdir) Worked (THROUGH EXTENTSIONTS + END OF LINE)

./bin/shell/makedist.sh --with-svn-server=pubsvn.ez.no --with-release=3.6 --use-svn-server --skip-version-check --skip-db-schema  --skip-db-check  --skip-db-update --skip-sql-generation --skip-translation --skip-addons


#---------------------------------------------#
W/OUT ADDON SKIP (W/DB SKIPS)

 ./bin/shell/makedist.sh --with-svn-server=pubsvn.ez.no --with-release=3.6 
 --use-svn-server --skip-version-check --skip-db-schema  --skip-db-check  --skip-db-update --skip-sql-generation --skip-translation

./bin/shell/makeaddonpackages.sh --export-path="/tmp/ez-root/ezpublish-3.6.1/packages/addons" --db-type=mysql --db-name=ezpublish3svn --db-user=publish --db-password=publish  --db-host=localhost   --db-type=mysql
Connecting to DB using mysql://publish:***@localhost/ezpublish3svn
./bin/shell/makeaddonpackages.sh: line 124: ./ezpm.php: No such file or directory



I think it errors because it was not in the correct directory (so i edited the makedist.sh to be in the expected directorY)

#---------------------------------------------#

[ -d $TMPDIR ] && rm -rf "$TMPDIR"
mkdir -p $TMPDIR || exit 1

#---------------------------------------------#
Without 3.6 dir in $CWD (pre existing)
---> Errors with the missing dependancy fiels ... hrm?

################

 ./bin/shell/makedist.sh --with-svn-server=pubsvn.ez.no --with-release=3.6 --use-svn-server --skip-version-check
------------| 3.6
Creating full release
Updating ezlupdate                                         [ Failure ]
Building ezlupdate executable

./bin/shell/common.sh: line 149: cd: support/lupdate-ezpublish3: No such file or directory
Failed to build ezlupdate automatically

################

 ./bin/shell/makedist.sh --with-svn-server=pubsvn.ez.no --with-release=3.6 --use-svn-server --skip-version-check

#---------------------------------------------#
[root@labs customized]# ./bin/shell/makedist.sh --with-svn-server=pubsvn.ez.no --with-release=3.6 --use-svn-server --skip-version-check
------------| 3.6
Creating full release
Updating ezlupdate                                         [ Success ]
Checking out from server pubsvn.ez.no
Checking out release 3.6
SVN_PATH=pubsvn.ez.no/nextgen/stable/3.6

Fetching external item into '3.6/share/translations'
Checked out external at revision 210.


Fetching external item into '3.6/share/locale'
Checked out external at revision 210.

Checked out revision 12225.
All operations are done from SVN server, official builds are possible
Distribution source files taken from /tmp/nextgen-3.6
stable/3.6

stable/3.6
Connecting to MySQL using mysql://publish:***@localhost
Connecting to PostgreSQL using postgresql://localhost
Checking code templates                                    [ Success ]
Checking syntax of PHP files                               [ Success ]
Running unit tests                                         [ Success ]
Checking database schemas                                  [ Failure ]
The database schema check failed
Run the following command to find out what is wrong
./bin/shell/checkdbschema.sh --mysql-user=publish --mysql-password=publish  --mysql-host=localhost    ez_tmp_makedist
[root@labs customized]# ./bin/shell/checkdbschema.sh --mysql-user=publish --mysql-password=publish  --mysql-host=localhost    ez_tmp_makedist
Connecting to MySQL using mysql://publish:***@localhost
Connecting to PostgreSQL using postgresql://localhost
MySQL: Creating
Failed to create MySQL database ez_tmp_makedist
[root@labs customized]# ./bin/shell/checkdbschema.sh --mysql-user=root --mysql-password=mysql_root_pass  --mysql-host=localhost    ez_tmp_makedist
Connecting to MySQL using mysql://root:***@localhost
Connecting to PostgreSQL using postgresql://localhost
MySQL: Creating
Failed to create MySQL database ez_tmp_makedist
[root@labs customized]# ./bin/shell/checkdbschema.sh --mysql-user=root --mysql-password="mysql_root_pass"  --mysql-host=localhost    ez_tmp_makedist
Connecting to MySQL using mysql://root:***@localhost
Connecting to PostgreSQL using postgresql://localhost
MySQL: Creating
Failed to create MySQL database ez_tmp_makedist

#---------------------------------------------#
OK so from the above block we learn the the script WANTS to create it's own
temp database (per mysql/postgres) which means it needs ROOT like db permissions (my users does not have these (jon help me fix))

./bin/shell/checkdbschema.sh --mysql-user=root --mysql-password="mysql_root_pass"  --mysql-host=localhost    ez_tmp_makedist


So instead i switch to using the root user :P hrmm ....

#---------------------------------------------#

./bin/shell/makedist.sh --with-svn-server=pubsvn.ez.no --with-release=3.6 --use-svn-server --skip-version-check

W/DB OPTIONS? (OK)

./bin/shell/makedist.sh 
--with-svn-server=pubsvn.ez.no --with-release=3.6 --use-svn-server 
--skip-version-check
--db-name=ezpublish3svn --db-user=root 
--db-password='mysql_root_pass' --db-host=localhost --db-type=mysql --mysql-user=root
--mysql-password='mysql_root_pass' --mysql-host=localhost





#---------------------------------------------#

./bin/shell/makedist.sh --with-svn-server=pubsvn.ez.no --with-release=3.6 --use-svn-server --skip-version-check --db-name=ezpublish3svn --db-user=root --db-password='mysql_root_pass' --db-host=localhost --db-type=mysql --mysql-user=root --mysql-password='mysql_root_pass' --mysql-host=localhost

###############

Results in ....

Checking database schemas                                  [ Failure ]
The database schema check failed
Run the following command to find out what is wrong

./bin/shell/checkdbschema.sh --mysql-user=root --mysql-password=mysql_root_pass  --mysql-host=localhost    ez_tmp_makedist


#---------------------------------------------#

Report bugs to <pgsql-bugs@postgresql.org>.
-bash-3.00$ createuser -adPEe publish
Enter password for new user:
Enter it again:
CREATE USER publish ENCRYPTED PASSWORD 'publish' CREATEDB CREATEUSER;
CREATE USER
-bash-3.00$ createuser -adPEe publish
-bash-3.00$ jos
-bash: jos: command not found
-bash-3.00$ jobs
-bash-3.00$ psql template1
Welcome to psql 7.4.8, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help on internal slash commands
       \g or terminate with semicolon to execute query
       \q to quit

template1=# \du
              List of database users
 User name | User ID |         Attributes
-----------+---------+----------------------------
 postgres  |       1 | superuser, create database
 publish   |     100 | superuser, create database
(2 rows)

#---------------------------------------------#

So this works really good, i think i can run the db script now?

Created MYSQL / Postgres USERS WHO are ROOT LIKE (ALL PRIVS ON SYSTEM, Create / Drop / ETC)

 ./bin/shell/makedist.sh --with-svn-server=pubsvn.ez.no --with-release=3.6 --use-svn-server --skip-version-check --db-name=ezpublish3svn --db-user=root --db-password='mysql_root_pass' --db-host=localhost --db-type=mysql --mysql-user=root --mysql-password='mysql_root_pass' --mysql-host=localhost --postgresql-user=publish --postgresql-password=publish --postgresql-host=localhost

#---------------------------------------------#

template1=# update pg_shadow set passwd='publish' where usename='publish';
UPDATE 1
template1=# update pg_shadow set passwd='publish' where usename='postgres';
UPDATE 1

########################

 psql template1 -U postgres -W (prompts for user password ::  publish  )

  psql template1 -U publish -W
########################

./bin/shell/makedist.sh --with-svn-server=pubsvn.ez.no --with-release=3.6 --use-svn-server --skip-version-check --db-name=ezpublish3svn --db-user=root --db-password='mysql_root_pass' --db-host=localhost --db-type=mysql --mysql-user=root --mysql-password='mysql_root_pass' --mysql-host=localhost --postgresql-user=publish --postgresql-password=publish --postgresql-host=localhost

still errors?

./bin/shell/checkdbschema.sh --mysql-user=root --mysql-password="\mysql_root_pass"  --mysql-host=localhost --postgresql-user=publish --postgresql-password="publish" --postgresql-host=localhost  ez_tmp_makedist


#---------------------------------------------#

[root@labs 3.6]# ./bin/shell/checkdbschema.sh --mysql-user=root --mysql-password="\mysql_root_pass"  --mysql-host=localhost --postgresql-user=publish --postgresql-password="publish" --postgresql-host=localhost  ez_tmp_makedist
[root@labs 3.6]# pwd
/tmp/nextgen-3.6/3.6
[root@labs 3.6]# ./bin/shell/checkdbschema.sh --mysql-user=root --mysql-password="\mysql_root_pass"  --mysql-host=localhost --postgresql-user=publish --postgresql-host=localhost  ez_tmp_makedist
/tmp/nextgen-3.6/3.6
Connecting to MySQL using mysql://root:***@localhost
Connecting to PostgreSQL using postgresql://publish@localhost
MySQL: Creating/tmp/nextgen-3.6/3.6--password=mysql_root_pass  -h localhost  create ez_tmp_makedist
 Initializing
PostgreSQL: Creating
createdb -U publish  -h localhost  ez_tmp_makedist

            Creatingpsql -U publish  -h localhost  ez_tmp_makedist

 Initializing
Validating
Database schemas did not match, this could mean that one of the database is missing an SQL update
Check the database difference with
./bin/php/ezsqldiff.php --source-type=mysql --source-user=root --source-password=mysql_root_pass  --source-host=localhost  --match-type=postgresql --match-user=publish   --match-host=localhost  "ez_tmp_makedist" "ez_tmp_makedist"
[root@labs 3.6]# /bin/php/ezsqldiff.php --source-type=mysql --source-user=root --source-password=mysql_root_pass  --source-host=localhost  --match-type=postgresql --match-user=publish   --match-host=localhost  "ez_tmp_makedist" "ez_tmp_makedist"
-bash: /bin/php/ezsqldiff.php: No such file or directory
[root@labs 3.6]# ./bin/php/ezsqldiff.php --source-type=mysql --source-user=root --source-password=mysql_root_pass  --source-host=localhost  --match-type=postgresql --match-user=publish   --match-host=localhost  "ez_tmp_makedist" "ez_tmp_makedist"
Could not initialize database:
* Tried database 'ez_tmp_makedist' at host 'localhost' with user 'root' and with a password
* Access denied for user 'root'@'localhost' (using password: YES)(1045)
Failed to load schema from source database
[root@labs 3.6]# jobs
[1]+  Stopped                 emacs-nox /var/lib/pgsql/data/pg_hba.conf
[2]   Stopped                 emacs-nox ~/.pgpass
[3]-  Stopped                 emacs-nox /var/lib/pgsql/data/postgresql.conf

#---------------------------------------------#

[root@labs customized]# jobs
[1]   Stopped                 emacs-nox bin/shell/common.sh
[2]   Stopped                 emacs-nox ./bin/shell/makeaddonpackages.sh
[4]   Stopped                 grep "PARAM_EZ_MYSQL_ALL" -R bin/ | less
[5]   Stopped                 grep "MYSQL_PASSWD" -R bin/ | less
[6]-  Stopped                 emacs-nox bin/shell/checkdbschema.sh
[7]+  Stopped                 emacs-nox bin/shell/sqlcommon.sh


[root@labs dev.firebright.com]# jobs
[1]   Stopped                 emacs-nox customized/bin/shell/makedist.sh
[2]-  Stopped                 emacs-nox customized/bin/shell/sqlcommon.sh
[3]+  Stopped                 emacs-nox customized/bin/shell/checkdbschema.sh


#---------------------------------------------#

 ./bin/shell/makedist.sh --with-svn-server=pubsvn.ez.no --with-release=3.6 --use-svn-server --skip-version-check --skip-db-schema --db-name=ezpublish3svn --db-user=root --db-password='mysql_root_pass' --db-host=localhost --db-type=mysql --mysql-user=root --mysql-password='mysql_root_pass' --mysql-host=localhost

Last Run CMD ....

./bin/shell/makedist.sh --with-svn-server=pubsvn.ez.no --with-release=3.6 --use-svn-server --skip-version-check --skip-db-schema --skip-db-update --skip-db-check --db-name=ezpublish3svn --db-user=root --db-password='mysql_root_pass' --db-host=localhost --db-type=mysql --mysql-user=root --mysql-password='mysql_root_pass' --mysql-host=localhost


#---------------------------------------------#

Note: Most of these build / test tools require you to run this 
from within the current working directory, meaning you can't specificy the directory to run these tests on (per script)

So you start doing makedist.sh (from any directory, if your passing the svn checkout options (best practice))
but if makedist.sh fails you must manualy cd into the /tmp/nextgen-3.6/3.6/ directory to run (the same named script (even if your modifications are not in svn (always for us, requires overright / copy) to run the subscript to find / display a problem.


Note: Unclear notification (block) of the makedist.sh log files, files created / locations used ... (table output ...)


#---------------------------------------------#

 ./bin/shell/makedist.sh --clear-settings-cache --with-svn-server=pubsvn.ez.no --with-release=3.6 --use-svn-server --skip-version-check --skip-db-schema --skip-db-update --skip-db-check --db-name=ezpublish3svn --db-user=root --db-password='mysql_root_pass' --db-host=localhost --db-type=mysql --mysql-user=root --mysql-password='mysql_root_pass' --mysql-host=localhost

#---------------------------------------------#


#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#







#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#

#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#


#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#


#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#


#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#


#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#
#---------------------------------------------#








#-------------------------------------------------#

Examples / Ideas : 

<code>./bin/shell/makedist.sh 
Usage: ./bin/shell/makedist.sh [options]

Options: -h
         --help                     This message
         --final                    Makes the release a final release
         --build-root=DIR           Set build root, default is /tmp
         --build-snapshot           Make a snapshot, this will add a build number to the name
         --with-svn-server[=SERVER] Checkout fresh repository
         --with-release=NAME        Checkout a previous release, default is trunk
         --skip-version-check       Do not check version numbers*
         --skip-php-check           Do not check PHP for syntax correctnes*
         --skip-code-template-check Do not check code templates*
         --skip-unit-tests          Do not run unit tests*
         --skip-db-schema           Do not create db schema (requires mysql and postgresql)*
         --skip-db-update           Do not run db update check*
         --skip-db-check            Do not run db schema check*
         --skip-translation         Do not run translation check*
         --skip-styles              Do not create style packages*
         --skip-addons              Do not create addon packages*
         --skip-test-framework      Do not copy test framework*
         --skip-core-files          Do not copy kernel/lib files*
         --skip-changelogs          Do not changelogs from earlier versions*
         --skip-sql-generation      Do not generate SQL files*
         --skip-extensions          Do not package extensions*
         --db-name=databasename     MySQL DB name ( default: ez_tmp_makedist )

Database options:
         --db-user=USER         DB user
         --db-password=PASSWORD DB password ( default: <empty> )
         --db-socket=SOCKET     DB socket ( default: <empty> )
         --db-host=HOST         DB host ( default: <locally> )
         --db-name=NAME         DB name
         --db-port=PORT         DB port
         --db-type=TYPE         DB type (mysql or postgresql)
         --mysql                Short for --db-type=mysql
         --postgresql           Short for --db-type=postgresql
MySQL options:
         --mysql-user=USER          MySQL DB user ( default: root )
         --mysql-password=PASSWORD  MySQL DB password ( default: <empty> )
         --mysql-socket=SOCKET      MySQL DB socket ( default: <empty> )
         --mysql-host=HOST          MySQL DB host ( default: <locally> )
         --mysql-host=PORT          MySQL DB port
PostgreSQL options:
         --postgresql-user=USER          PostgreSQL DB user ( default: postgres )
         --postgresql-password=PASSWORD  PostgreSQL DB password ( default: <empty> )
         --postgresql-host=HOST          PostgreSQL DB host ( default: <locally> )
         --postgresql-port=PORT          PostgreSQL DB port
SVN options:
         --use-svn-server           Do all operation using SVN server
         --use-working-copy         Do all operations on working copy, SVN server is not contacted

* Warning: Using these options will not make a valid distribution

Example:
./bin/shell/makedist.sh --release-sdk --with-svn-server </code>

