阳光网驿-企业信息化交流平台【DTC零售连锁全渠道解决方案】

 找回密码
 注册

QQ登录

只需一步,快速开始

扫描二维码登录本站

手机号码,快捷登录

老司机
查看: 2177|回复: 1

[原创] PostgreSQL_Win32_编译及按装

[复制链接]

该用户从未签到

发表于 2009-5-31 08:46:10 | 显示全部楼层 |阅读模式
PostgreSQL Win32 Installer

Some quick notes


Requirements
------------
1. WiX toolkit v3.0.2420 (http://wix.sourceforge.net)
2. Perl (tested with ActiveState perl 5.8.3)
3. Visual Studio 2005, including Visual C++ and MSBuild       
4. Installed tree of postgresql
5. PostgreSQL source tree, configured for MSVC build
6. MIT Kerberos for Windows (from http://web.mit.edu/kerberos/dist/index.html#KFW2.6.5)


Directory layout
----------------
bmp/    Contains bitmap images used in the installer
ca/     Source for custom action DLL
inst/   Utility files installed by the installer that are
        not included in postgresql.
package/Contains files included in ZIPs but not in the MSI
txt/    Contains textfiles used in the installer
util/   Contains utility scripts used during build
wxi/    Contains WiX include files (autogenerated)
wxs/    Contains WiX source files


Build preparations
------------------
1. Edit settings.projinc if necessary.
2. Build and install PostgreSQL. The standard options are

   ./configure \
            --with-openssl \
            --with-perl \
            --with-tcl \
            --with-python \
            --with-ldap \
            --enable-nls \
            --enable-thread-safety \
            --with-krb5 \
            --with-includes=/mingw/include/krb5

(FIXME: equivalent in MSVC build should be put here?)


Building the installer
----------------------
The installer is built using msbuild. From a visual studio commandprompt,
just run:
   msbuild

For location-specific targets, look in the local .proj files. A common
target is the clean one. To clean up the tree, simply run:
   msbuild /t:clean

in the root, or in a subdirectory.

Installing Kerberos
-------------------
1. Download the source code.
2. Compile and build src\athena\auth\krb5 using VC++ v6 (to avoid additional runtime dependencies
   that VC++ 7 and above introduce). This will build comerr32.dll and krb5_32.dll (and others that
   aren't required).
3. Convert LIBs (comerr32.lib and krb5_32.lib) from .LIB to .a for MingW:

C:\MinGW\lib>c:\msys\1.0\bin\reimp --dlltool c:\\msys\\1.0\\bin\\dlltool --as c:\\msys\\1.0\\bin\\as comerr32.lib

C:\MinGW\lib>c:\msys\1.0\bin\reimp --dlltool c:\\msys\\1.0\\bin\\dlltool --as c:\\msys\\1.0\\bin\\as krb5_32.lib

This should be run from a command prompt rather than Msys as some versions of reimp don't seem to
like msys very much!

4. Install the headers in /mingw/include/krb5 (NOT /mingw/include as there will probably be naming conflicts),
   the .a libraries in /mingw/lib, and the DLLs in /mingw/bin.




Building a release
==================

1) Open a Visual Studio command prompt and CD into the BuildTrees directory:

        cd c:\pgBuild\BuildTrees

2) Download the release tarball:

        pscp user@developer.postgresql.org:/var/spool/ftp/pub/source/vX.X.X/postgresql-X.X.X.tar.bz2 .

3) Unpack the tarball (this may need to be done using an Msys console):

        tar -jxvf postgresql-X.X.X.tar.bz2

4) CD into the msvc directory in the tarball, and copy in the config.pl and
   buildenv.bat files required:

        cd postgresql-X.X.X/src/tools/msvc
        copy c:\pgBuild\BuildEnv.pl.
        copy c:\pgBuild\config.pl .

5) Build the release:

        build

6) Check we have a good build (you may need to manually run the buildenv.bat
   script first):

        buildenv
        vcregress check

7) Delete any existing installed release from the staging directory (through
   Explorer) and then install the release:

        install c:\pgBuild\pginst-8.3\pgsql

8) Update the bundled code (pgAdmin, plDebugger, plJava, StackBuilder) in the
   installation staging directory.

9) cvs update the pgInstaller tree, and CD into the source directory. Clean
   the tree:

        cd c:\pgbuild\BuildTrees\pginst
        msbuild /t:clean

10) Edit settings.projinc and check the version number. The PGVER setting
    includes suffixes such as -beta4, but only the first two digits of the
    version number. This is normally only changed during beta/rc and *never*
    between minor versions.

11) Regenerate GUIDs if this is a pre-release, or the first of a series (eg.
    8.3.0). Essentially, if PGVER is changed (thus changing the installation
    directory, the GUIDs should be changed.

        perl util\regenguids.pl wxs\dialogs.wxs
        move wxs\dialogs.wxs.new wxs\dialogs.wxs

        perl util\regenguids.pl wxs\pginst.wxs
        move wxs\pginst.wxs.new wxs\pginst.wxs

        perl util\regenguids.pl wxi\guid.lst
        move wxi\guid.lst.new wxi\guid.lst

        perl util\regenguids.pl wrapper\wrapper.wxs
        move wrapper\wrapper.wxs.new wrapper\wrapper.wxs

        perl util\regenguids.pl settings.projinc
        move settings.projinc.new settings.projinc

12) Check the contents of package/README.txt, package/setup.bat,
    package/upgrade.bat, and correct any version numbers as required.

13) cvs commit any changes made.

14) Build the PostgreSQL docs. At present this must be done partially on a
    Unix box:

        cd postgresql-X.X.X
        ./configure
        cd doc/src/sgml
        make htmlhelp

15) Copy *.hh?, *.html and *.css to a temporary directory on the Windows
    build machine.

16) Load the htmlhelp project file into HTML Help Workshop, and on both the
    Contents and Index tabs, select an entry, and press the Up (or Down)
    button to swap it with a sibling. Then, press the opposite button to
    return it to it's original position. Finally, press the Save button. This
    forces HTML Help Workshop to reformat the files, without which the
    compiler may crash.

17) Build htmlhelp.chm, and copy it into pgsql/doc directory under the staging
    directory.

18) In the Visual Studio Command Prompt window, run msbuild in the pginst
    directory:

        msbuild

19) Test the resulting build in both upgrade and install mode.

20) Tag CVS with a tag in the format REL-X_X_X[-BETAX]

21) GPG sign the zip files using detached signatures.

22) Upload the zip files and signatures to the distribution site and verify the
    signatures.
楼主热帖
启用邀请码注册,提高发帖质量,建设交流社区

该用户从未签到

发表于 2009-6-7 16:42:23 | 显示全部楼层
think youthink youthink youthink youthink youthink youthink youthink youthink youthink youthink you
启用邀请码注册,提高发帖质量,建设交流社区
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表