| 44 | | if test "x$RELEASE_VERSION" = "x" ; then |
|---|
| 45 | | echo "Please provide version number. For example:" |
|---|
| 46 | | echo "./makedist 1.7alpha" |
|---|
| 47 | | echo "To provide automatic CVS snapshot version number use:" |
|---|
| 48 | | echo './makedist `./midgard-cvs-version`' |
|---|
| 49 | | exit |
|---|
| | 19 | export MIDGARD_RELEASE_VERSION=$1 |
|---|
| | 20 | export MIDGARD_MAKEDIST_ROOT=$PWD |
|---|
| | 21 | export MIDGARD_CORE_PREFIX="/usr/local" |
|---|
| | 22 | export MIDGARD_ALL_IN_ONE_PKG="Midgard_AllinOne-${MIDGARD_RELEASE_VERSION}" |
|---|
| | 23 | export MIDGARD_ALL_IN_ONE_DIR="${PWD}/${MIDGARD_ALL_IN_ONE_PKG}" |
|---|
| | 24 | export MIDGARD_MAKEDIST_ROOT=${PWD} |
|---|
| | 25 | export MIDGARD_MAKEDIST_LOG="${PWD}/makedist.log" |
|---|
| | 26 | |
|---|
| | 27 | if test "x$MIDGARD_RELEASE_VERSION" = "x" ; then |
|---|
| | 28 | |
|---|
| | 29 | RELEASE_VERSION=`grep AC_INIT core/midgard/configure.in | sed 's|[^,]*\,\[*||' | sed 's|])||'` |
|---|
| | 30 | export MIDGARD_RELEASE_VERSION=$RELEASE_VERSION |
|---|
| | 31 | export MIDGARD_ALL_IN_ONE_DIR="${PWD}/Midgard_AllinOne-${MIDGARD_RELEASE_VERSION}" |
|---|
| | 32 | cd httpd/apache2 |
|---|
| | 33 | cat configure.in | sed "s|^AC_INIT.*|AC_INIT(\[midgard-apache2\],\[$RELEASE_VERSION\])|1" > $TMPFILE |
|---|
| | 34 | mv $TMPFILE configure.in |
|---|
| | 35 | cd $MIDGARD_MAKEDIST_ROOT |
|---|
| | 36 | echo "" |
|---|
| | 37 | echo "Release version not defined. Using $MIDGARD_RELEASE_VERSION" |
|---|
| | 38 | echo "" |
|---|
| | 39 | sleep 2 |
|---|
| | 40 | else |
|---|
| | 41 | cd core/midgard/ |
|---|
| | 42 | cat configure.in | sed "s|^AC_INIT.*|AC_INIT(\[midgard-core\],\[$RELEASE_VERSION\])|1" > $TMPFILE |
|---|
| | 43 | mv $TMPFILE configure.in |
|---|
| | 44 | cd $MIDGARD_MAKEDIST_ROOT |
|---|
| | 45 | |
|---|
| | 46 | cd httpd/apache2 |
|---|
| | 47 | cat configure.in | sed "s|^AC_INIT.*|AC_INIT(\[midgard-apache2\],\[$RELEASE_VERSION\])|1" > $TMPFILE |
|---|
| | 48 | mv $TMPFILE configure.in |
|---|
| | 49 | cd $MIDGARD_MAKEDIST_ROOT |
|---|
| 59 | | if test "$*" = $RELEASE_VERSION; then |
|---|
| 60 | | BUILD="midgard apache1 apache2 php4 data php5" |
|---|
| 61 | | DO_MONSTER="1" |
|---|
| 62 | | else |
|---|
| 63 | | BUILD="$*" |
|---|
| 64 | | DO_MONSTER="" |
|---|
| 65 | | fi |
|---|
| 66 | | |
|---|
| 67 | | BUILDMIDGARD="no" |
|---|
| 68 | | BUILDAPACHE2="no" |
|---|
| 69 | | BUILDDATA="no" |
|---|
| 70 | | BUILDPHP4="no" |
|---|
| 71 | | |
|---|
| 72 | | for p in $BUILD; do |
|---|
| 73 | | if [ "$p" = "midgard" ] || [ "$p" = "core" ]; then BUILDMIDGARD="yes"; fi |
|---|
| 74 | | if test $p = "apache2" ; then BUILDAPACHE2="yes"; fi |
|---|
| 75 | | if test $p = "data" ; then BUILDDATA="yes"; fi |
|---|
| 76 | | if test $p = "php4" ; then BUILDPHP4="yes"; fi |
|---|
| 77 | | if test $p = "php5" ; then BUILDPHP5="yes"; fi |
|---|
| 78 | | done |
|---|
| 79 | | |
|---|
| 80 | | # Find GNU autotools |
|---|
| 81 | | for dir in /usr/local/gnu-autotools/bin /usr/bin /usr/local/bin; do |
|---|
| 82 | | test -z "$ACLOCAL" -a -x "$dir/aclocal" && ACLOCAL="$dir/aclocal" |
|---|
| 83 | | test -z "$AUTOMAKE" -a -x "$dir/automake" && AUTOMAKE="$dir/automake" |
|---|
| 84 | | test -z "$AUTOCONF" -a -x "$dir/autoconf" && AUTOCONF="$dir/autoconf" |
|---|
| 85 | | test -z "$LIBTOOLIZE" -a -x "$dir/libtoolize" && LIBTOOLIZE="$dir/libtoolize" |
|---|
| 86 | | test -z "$AUTOHEADER" -a -x "$dir/autoheader" && AUTOHEADER="$dir/autoheader" |
|---|
| 87 | | for am in 1.9 1.8 1.7 1.6; do |
|---|
| 88 | | test -z "$ACLOCAL" -a -x "$dir/aclocal-$am" && ACLOCAL="$dir/aclocal-$am" |
|---|
| 89 | | test -z "$AUTOMAKE" -a -x "$dir/automake-$am" && AUTOMAKE="$dir/automake-$am" |
|---|
| 90 | | done |
|---|
| 91 | | done |
|---|
| 92 | | test -z "$ACLOCAL" && ACLOCAL=aclocal; export ACLOCAL |
|---|
| 93 | | test -z "$AUTOMAKE" && AUTOMAKE=automake; export AUTOMAKE |
|---|
| 94 | | test -z "$AUTOCONF" && AUTOCONF=autoconf; export AUTOCONF |
|---|
| 95 | | test -z "$LIBTOOLIZE" && LIBTOOLIZE=libtoolize; export LIBTOOLIZE |
|---|
| 96 | | test -z "$AUTOHEADER" && AUTOHEADER=autoheader; export AUTOHEADER |
|---|
| 97 | | echo "Using ACLOCAL=$ACLOCAL" |
|---|
| 98 | | echo "Using AUTOMAKE=$AUTOMAKE" |
|---|
| 99 | | echo "Using AUTOCONF=$AUTOCONF" |
|---|
| 100 | | echo "Using LIBTOOLIZE=$LIBTOOLIZE" |
|---|
| 101 | | echo "Using AUTOHEADER=$AUTOHEADER" |
|---|
| 102 | | |
|---|
| 103 | | |
|---|
| 104 | | if [ $USE_BSD = "1" ]; then |
|---|
| 105 | | cp `$ACLOCAL --print-ac-dir | sed 's/gnu-autotools\///'`/pkg.m4 `$ACLOCAL --print-ac-dir` |
|---|
| 106 | | PATH=$PATH:/usr/local/gnu-autotools/bin; export PATH |
|---|
| 107 | | find . \( \( \( -name .svn -type d \) -or \( -name CVS -type d \) \) -o -name .cvsignore \) -exec rm -rf {} + |
|---|
| 108 | | else |
|---|
| 109 | | find . \( \( \( -name .svn -type d \) -or \( -name CVS -type d \) \) -o -name .cvsignore \) -exec rm -rf {} \; |
|---|
| 110 | | fi |
|---|
| 111 | | |
|---|
| 112 | | set -ex |
|---|
| 113 | | |
|---|
| 114 | | if [ -d "$MONSTER_TAR" ];then |
|---|
| 115 | | rm -rf ${MONSTER_TAR}* |
|---|
| 116 | | fi |
|---|
| 117 | | if [ -f "${MONSTER_TAR}.tar.$BEXT" ];then |
|---|
| 118 | | rm ${MONSTER_TAR}.tar.$BEXT |
|---|
| 119 | | fi |
|---|
| 120 | | if [ -n "$DO_MONSTER" ]; then |
|---|
| 121 | | mkdir $MONSTER_TAR |
|---|
| 122 | | fi |
|---|
| 123 | | |
|---|
| 124 | | if test $BUILDMIDGARD = "yes" -a -d core/midgard; then |
|---|
| 125 | | # remove all midgard-core like tarballs |
|---|
| 126 | | rm -rf midgard-core-* |
|---|
| 127 | | cd core/midgard/ |
|---|
| 128 | | |
|---|
| 129 | | # Update version number |
|---|
| 130 | | cat configure.in | sed "s|^AC_INIT.*|AC_INIT(\[midgard-core\],\[$RELEASE_VERSION\])|1" > $TMPFILE |
|---|
| 131 | | mv $TMPFILE configure.in |
|---|
| 132 | | autoreconf -i |
|---|
| 133 | | chmod +x configure |
|---|
| 134 | | |
|---|
| 135 | | # Make tarball |
|---|
| 136 | | ./configure |
|---|
| 137 | | if [ $USE_BSD = "1" ]; then |
|---|
| 138 | | gmake dist |
|---|
| 139 | | else |
|---|
| 140 | | make dist |
|---|
| 141 | | fi |
|---|
| 142 | | |
|---|
| 143 | | # Copy midgard-core to monster file |
|---|
| 144 | | if [ -n "$DO_MONSTER" ]; then |
|---|
| 145 | | tar -xjvf midgard-core-$RELEASE_VERSION.tar.bz2 |
|---|
| 146 | | cp -r midgard-core-$RELEASE_VERSION $SRCDIR/$MONSTER_TAR/ |
|---|
| 147 | | rm -rf midgard-core-$RELEASE_VERSION |
|---|
| 148 | | fi |
|---|
| 149 | | mv midgard-core-$RELEASE_VERSION.tar.bz2 $SRCDIR/ |
|---|
| 150 | | cd $SRCDIR |
|---|
| 151 | | fi |
|---|
| 152 | | |
|---|
| 153 | | if test $BUILDAPACHE2 = "yes" -a -d httpd/apache2 ; then |
|---|
| 154 | | # remove all midgard-apache2 like tarballs |
|---|
| 155 | | rm -rf midgard-apache2-* |
|---|
| 156 | | cd httpd/apache2 |
|---|
| 157 | | |
|---|
| 158 | | # Update version number |
|---|
| 159 | | cat configure.in | sed "s|^AC_INIT.*|AC_INIT(\[midgard-apache2\],\[$RELEASE_VERSION\])|1" > $TMPFILE |
|---|
| 160 | | mv $TMPFILE configure.in |
|---|
| 161 | | autoreconf -i |
|---|
| 162 | | chmod +x configure |
|---|
| 163 | | |
|---|
| 164 | | # Make tarball |
|---|
| 165 | | ./configure --with-midgard-config=../../core/midgard/midgard-config |
|---|
| 166 | | make dist |
|---|
| 167 | | |
|---|
| 168 | | # Copy midgard-apache2 to monster file |
|---|
| 169 | | if [ -n "$DO_MONSTER" ]; then |
|---|
| 170 | | tar -xjvf midgard-apache2-$RELEASE_VERSION.tar.bz2 |
|---|
| 171 | | cp -r midgard-apache2-$RELEASE_VERSION $SRCDIR/$MONSTER_TAR/ |
|---|
| 172 | | rm -rf midgard-apache2-$RELEASE_VERSION |
|---|
| 173 | | fi |
|---|
| 174 | | mv midgard-apache2-$RELEASE_VERSION.tar.bz2 $SRCDIR/ |
|---|
| 175 | | cd $SRCDIR |
|---|
| 176 | | fi |
|---|
| 177 | | |
|---|
| 178 | | # data package generation |
|---|
| 179 | | if test $BUILDDATA = "yes" -a -d data ; then |
|---|
| 180 | | # remove all midgard-data like tarballs |
|---|
| 181 | | rm -rf midgard-data-* |
|---|
| 182 | | cd data |
|---|
| 183 | | |
|---|
| 184 | | # Update version number |
|---|
| 185 | | cat configure.ac | sed "s|^AC_INIT.*|AC_INIT(\[midgard-data\],\[$RELEASE_VERSION\])|1" > $TMPFILE |
|---|
| 186 | | mv $TMPFILE configure.ac |
|---|
| 187 | | autoreconf -i |
|---|
| 188 | | chmod +x configure |
|---|
| 189 | | # Make tarball |
|---|
| 190 | | ./configure --with-midgard-config=../core/midgard/midgard-config |
|---|
| 191 | | make dist |
|---|
| 192 | | |
|---|
| 193 | | # Copy midgard-data to monster file |
|---|
| 194 | | if [ -n "$DO_MONSTER" ]; then |
|---|
| 195 | | tar -xjvf midgard-data-$RELEASE_VERSION.tar.bz2 |
|---|
| 196 | | cp -r midgard-data-$RELEASE_VERSION $SRCDIR/$MONSTER_TAR/ |
|---|
| 197 | | rm -rf midgard-data-$RELEASE_VERSION |
|---|
| 198 | | fi |
|---|
| 199 | | mv midgard-data-$RELEASE_VERSION.tar.bz2 $SRCDIR/ |
|---|
| 200 | | cd $SRCDIR |
|---|
| 201 | | fi |
|---|
| 202 | | |
|---|
| 203 | | if test $BUILDPHP4 = "yes" -a -d apis/php4; then |
|---|
| 204 | | rm -rf midgard-php4-${RELEASE_VERSION}* |
|---|
| 205 | | cp -r apis/php4 midgard-php4-$RELEASE_VERSION |
|---|
| 206 | | if [ -n "$DO_MONSTER" ]; then |
|---|
| 207 | | cp -r midgard-php4-$RELEASE_VERSION $MONSTER_TAR |
|---|
| 208 | | fi |
|---|
| 209 | | tar $TAROPTS midgard-php4-$RELEASE_VERSION.tar midgard-php4-$RELEASE_VERSION |
|---|
| 210 | | $COMPRESS midgard-php4-$RELEASE_VERSION.tar |
|---|
| 211 | | rm -rf midgard-php4-$RELEASE_VERSION |
|---|
| 212 | | fi |
|---|
| 213 | | |
|---|
| 214 | | if [ -n "$DO_MONSTER" ]; then |
|---|
| 215 | | tar $TAROPTS $MONSTER_TAR.tar $MONSTER_TAR |
|---|
| 216 | | $COMPRESS $MONSTER_TAR.tar |
|---|
| 217 | | rm -rf $MONSTER_TAR |
|---|
| 218 | | fi |
|---|
| | 60 | make all |
|---|