]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/win32/build-depkgs-mingw32
kes Reapply my bat.conf install script in qt-console. I think I
[bacula/bacula] / bacula / src / win32 / build-depkgs-mingw32
old mode 100644 (file)
new mode 100755 (executable)
index e075400..1453090
@@ -74,9 +74,10 @@ get_source()
         ARCHIVE=`basename ${URL}`
         
         case ${ARCHIVE} in
-        *.tar.gz)       ARCHIVER="tar xzf"; [ -z "${SRC_DIR}" ] && SRC_DIR=`expr "${ARCHIVE}" : '\(.*\)\.tar\.gz'`;;
-        *.tar.bz2)      ARCHIVER="tar xjf"; [ -z "${SRC_DIR}" ] && SRC_DIR=`expr "${ARCHIVE}" : '\(.*\)\.tar\.bz2'`;;
+        *.tar.gz)       ARCHIVER="tar xzf";    [ -z "${SRC_DIR}" ] && SRC_DIR=`expr "${ARCHIVE}" : '\(.*\)\.tar\.gz'`;;
+        *.tar.bz2)      ARCHIVER="tar xjf";    [ -z "${SRC_DIR}" ] && SRC_DIR=`expr "${ARCHIVE}" : '\(.*\)\.tar\.bz2'`;;
         *.zip)          ARCHIVER="unzip -q";   [ -z "${SRC_DIR}" ] && SRC_DIR=`expr "${ARCHIVE}" : '\(.*\)\.zip'`;;
+        *.exe)          ARCHIVER="";           [ -z "${SRC_DIR}" ] && SRC_DIR=`expr "${ARCHIVE}" : '\(.*\)\.zip'`;;
         *)              echo Unsupported archive type - $ARCHIVE; exit 1;;
         esac
         
@@ -94,13 +95,21 @@ get_source()
                 fi
         fi
 
+        [ -z "${ARCHIVER}" ] && return 0
+
         if [ ! -e "${SRC_DIR}" -o "${CLOBBER_SOURCE}" = "true" ]
         then
                 rm -rf ${SRC_DIR}
-                [ "${MAKE_DIR}" = "true" ] && mkdir ${SRC_DIR} && cd ${SRC_DIR}
                 echo Extracting ${ARCHIVE}
-                ${ARCHIVER} ${ARCHIVE} &> ${ARCHIVE}.log
-                cd ${SRC_DIR}
+                if [ "${MAKE_DIR}" = "true" ]
+                then
+                        mkdir ${SRC_DIR}
+                        cd ${SRC_DIR}
+                        ${ARCHIVER} ../${ARCHIVE} > ../${ARCHIVE}.log 2>&1
+                else
+                        ${ARCHIVER} ${ARCHIVE} > ${ARCHIVE}.log 2>&1
+                        cd ${SRC_DIR}
+                fi
                 return 0
         fi
 
@@ -174,7 +183,7 @@ process_pcre()
                             --host=mingw32 \
                             --prefix=${DEPPKG_DIR} \
                             --enable-utf8 \
-                            --enable-unicode-properties &>make.log
+                            --enable-unicode-properties >make.log 2>&1
         fi
         echo Building PCRE
         do_make Makefile PREFIX=${DEPPKG_DIR} all
@@ -213,7 +222,7 @@ process_openssl()
                             shared zlib-dynamic \
                             threads \
                             --with-zlib-include=${DEPPKG_DIR}/include \
-                            mingw32 &> make.log
+                            mingw32 > make.log 2>&1
         fi
         echo Building openssl
         perl util/mkdef.pl 32 libeay no-static-engine >ms/libeay32.def
@@ -248,24 +257,32 @@ process_postgresql()
                 echo Patching postgreSQL
                 >patch.log
                 do_patch postgresql.patch
-                echo Configuring postgreSQL
+
+                # We need a native version of zic to build the timezone tables.
+                echo Configuring postgreSQL to build native zic
+                ./configure > make.log 2>&1
+
+                echo Building native zic
+                cd src/timezone
+                do_make Makefile >> make.log 2>&1
+                cp zic ../..
+                cd ../..
+                do_make GNUmakefile distclean >> make.log 2>&1
+
+                echo Configuring postgreSQL for MinGW32
+
                 ./configure --host=mingw32 \
                             --enable-shared \
                             --enable-thread-safety \
                             --prefix=${DEPPKG_DIR} \
                             --with-includes=${DEPPKG_DIR}/include:${DEPPKG_DIR}/include/pthreads \
-                            --with-libraries=${DEPPKG_DIR}/lib &> make.log
+                            --with-libraries=${DEPPKG_DIR}/lib >> make.log 2>&1
         fi
         echo Building postgreSQL
-        if [ -e /usr/sbin/zic ]; then ZIC=/usr/sbin/zic
-        elif [ -e /sbin/zic ]; then ZIC=/sbin/zic
-        elif [ -e /usr/bin/zic ]; then ZIC=/usr/bin/zic
-        elif [ -e /bin/zic ]; then ZIC=/bin/zic
-        else ZIC=./zic
-        fi
-        do_make Makefile AR=mingw32-ar DLLTOOL=mingw32-dlltool DLLWRAP=mingw32-dllwrap WINDRES=mingw32-windres PTHREAD_LIBS=-lpthreadGCE ZIC=${ZIC}
+        ZIC=`pwd`/zic
+        do_make GNUmakefile AR=mingw32-ar DLLTOOL=mingw32-dlltool DLLWRAP=mingw32-dllwrap WINDRES=mingw32-windres PTHREAD_LIBS=-lpthreadGCE ZIC=${ZIC}
         echo Installing postgreSQL
-        do_make Makefile AR=mingw32-ar DLLTOOL=mingw32-dlltool DLLWRAP=mingw32-dllwrap WINDRES=mingw32-windres PTHREAD_LIBS=-lpthreadGCE ZIC=${ZIC} install
+        do_make GNUmakefile AR=mingw32-ar DLLTOOL=mingw32-dlltool DLLWRAP=mingw32-dllwrap WINDRES=mingw32-windres PTHREAD_LIBS=-lpthreadGCE ZIC=${ZIC} install
 }
 
 process_sqlite()
@@ -310,6 +327,8 @@ process_wx()
         cp -p include/wx/generic/* ../../include/wx/generic 2>&1 | grep -v 'omitting directory'
         mkdir ../../include/wx/msw
         cp -p include/wx/msw/* ../../include/wx/msw 2>&1 | grep -v 'omitting directory'
+        mkdir ../../include/wx/msw/ole
+        cp -p include/wx/msw/ole/* ../../include/wx/msw/ole 2>&1 | grep -v 'omitting directory'
         cp -p lib/gcc_dll/*.dll ../../bin
         rm -rf ../../lib/wx_dll
         mkdir ../../lib/wx_dll
@@ -326,7 +345,7 @@ process_scons()
 {
         get_source "${URL_SCONS}" "${DIR_SCONS}" "${MKD_SCONS}"
         echo Installing scons
-        if python setup.py install --prefix=${DEPPKG_DIR}/scons &> make.log
+        if python setup.py install --prefix=${DEPPKG_DIR}/scons > make.log 2>&1
         then
                 :
         else
@@ -399,18 +418,74 @@ process_sed()
 {
         if get_source "${URL_SED}" "${DIR_SED}" "${MKD_SED}"
         then
-                echo Patching SED
+                echo Patching sed
                 >patch.log
                 do_patch sed.patch
-                echo Configuring SED
+                echo Configuring sed
+                ./configure --host=mingw32 \
+                            --prefix=${DEPPKG_DIR} \
+                            --disable-nls >make.log 2>&1
+        fi
+        echo Building sed
+        do_make Makefile all
+        echo Installing sed
+        do_make Makefile install
+}
+
+process_stab2cv()
+{
+        if get_source "${URL_STAB2CV}" "${DIR_STAB2CV}" "${MKD_STAB2CV}"
+        then
+                # echo Patching stab2cv
+                # >patch.log
+                # do_patch stab2cv.patch
+                echo Configuring stab2cv
+                ./configure --prefix=${DEPPKG_DIR}/tools \
+                            >make.log 2>&1
+        fi
+        echo Building stab2cv
+        do_make Makefile 
+        echo Installing stab2cv
+        do_make Makefile install
+}
+
+process_cmd_utils()
+{
+        if get_source "${URL_CMD_UTILS}" "${DIR_CMD_UTILS}" "${MKD_CMD_UTILS}"
+        then
+                # echo Patching cmd-utils
+                # >patch.log
+                # do_patch cmd-utils.patch
+                echo Configuring cmd-utils
                 ./configure --host=mingw32 \
                             --prefix=${DEPPKG_DIR} \
-                            --disable-nls &>make.log
-       fi
-       echo Building SED
-       do_make Makefile all
-       echo Installing SED
-       do_make Makefile install
+                            >make.log 2>&1
+        fi
+        echo Building cmd-utils
+        do_make Makefile 
+        echo Installing cmd-utils
+        do_make Makefile install
+}
+
+process_mkisofs()
+{
+        get_source "${URL_MKISOFS}" "${DIR_MKISOFS}" "${MKD_MKISOFS}"
+        echo Installing mkisofs
+        cp `basename ${URL_MKISOFS}` ${DEPPKG_DIR}/bin
+}
+
+process_dvd_rw_tools()
+{
+        if get_source "${URL_DVD_RW_TOOLS}" "${DIR_DVD_RW_TOOLS}" "${MKD_DVD_RW_TOOLS}"
+        then
+                echo Patching dvd+rw-tools
+                >patch.log
+                do_patch dvd+rw-tools.patch
+        fi
+        echo Building dvd+rw-tools
+       m4 -DOS=XMINGW32 Makefile.m4 | make -f - dvd+rw-tools >make.log 2>&1
+        echo Installing dvd+rw-tools
+       m4 -DOS=XMINGW32 Makefile.m4 | make -f - prefix=${DEPPKG_DIR} install >>make.log 2>&1
 }
 
 if [ "$#" -eq 0 ]
@@ -428,6 +503,10 @@ then
         process_mtx
         process_mt
         process_sed
+        process_stab2cv
+        process_cmd_utils
+        process_mkisofs
+        process_dvd_rw_tools
 else
         for dependency in "$@"
         do