Further clarification of external PCRE build requirements
[OSXPackageBuilder.git] / OS X Package Builder HOWTO.txt
1 INTRODUCTION
2
3 This document will guide you through the complete process necessary to create a Privoxy installer package (hereafter 'package') for any OS X version, starting from the Privoxy source code.
4
5
6 ASSUMPTIONS
7
8 1. That the Privoxy CVS project is available in a folder parallel to the one containing this file. If building for release it should have been exported from Sourceforge to a folder named 'dist', pinned at whichever release you intend to build (as per the instructions in the developer manual), you might have simply checked out the head of the CVS project to a folder named 'current'. If you are using a folder name other than these two you will be prompted to enter it.
9 2. That you have Xcode installed, including the SDKs for each OS X version you intend your package(s) to support.
10 3. That your build machine runs Snow Leopard (OS X 10.6). It will likely work equally well on Leopard or Lion (or later), but PackageMaker is substantially different in Tiger and earlier versions of OS X (even the project file format is different).
11 4. All references to files and folders in this document should be assumed to be within the OSXBuildSystem folder unless stated otherwise.
12
13
14 OVERVIEW OF STEPS
15
16 1. Build the privoxy binary
17 1.1 Consider whether to use external or bundled PCRE.
18 2. Construct the package contents hierarchy
19 3. Build the package
20
21
22 DETAILS
23
24 1. Build the privoxy binary
25
26 Use privoxy-create.sh (run via sudo) to create the privoxy group and user; these are a prerequisite for the build process.
27
28 Use build.sh to build a privoxy binary for the desired (range of) platform(s). The simplest usage is:
29
30 ./build.sh leopardupwards
31
32 which will build a Universal binary containing targets for PPC, i386 and x86_64 processor architectures that'll run on all Macintosh OS X versions from 10.5 (Leopard) and upwards. If however you would prefer to, for example, build a binary that runs solely on 64 bit Intel processors, you could instead use:
33
34 ./build.sh snowleopard64
35
36 Running build.sh without supplying any parameters will cause it to list all the possible options.
37
38 1.1 Consider whether to use external or bundled PCRE.
39
40 Privoxy uses the Perl Compatible Regular Expressions (PCRE) library when matching its rules against the folder-and-file part of a target URL. Privoxy ships with a bundled PCRE library that, whilst convenient, is very out of date (version 3). The recommendation is therefore to download, make and install the latest PCRE distribution to your build machine and compile Privoxy against that instead.
41
42 build.sh takes an optional second parameter (-pcre) which tells it to look for an installation of the PCRE library in the standard location on the build machine (/usr/local/lib). The obvious corrollary is that you must have downloaded, configured, made and installed PCRE before building Privoxy if you wish to link to the external library.
43
44 There are two important further considerations that this approach brings. Firstly, you must ensure when building PCRE that you build it to support the same minimum version of OS X that you wish Privoxy to support (note that by default PCRE will assume the OS X version of the build machine is the minimum version to be supported). Failure to observe this will mean that, whilst Privoxy will still build, the external PCRE check will fail and you will end up compiling in the bundled PCRE, not linking to the external PCRE library as you'd intended.
45
46 The second consideration when using external PCRE is that the PCRE build process allows only single-architecture libraries to be built, which means that your Privoxy binary can also only be single-architecture. The outcome of not following this rule would be as above; you will succeed in building Privoxy but it will compile in the bundled PCRE rather than linking to the external library.
47
48
49
50 2. Construct the package contents hierarchy
51
52 Use constructPkgContent.sh to build the hierarchy of folders and files necessary for building the package. This will construct a new folder named 'pkg content' and copy in the binary, documentation and supporting files. If you are bundling an external PCRE fileset (i.e. if you built privoxy to use an external PCRE library), use the optional switch -pcre to instruct constructPkgContent.sh to include the libpcre fileset, which it will source from the standard installed location on the build machine (/usr/local/lib).
53
54 Once this is done, the file 'pkg resources/interface texts/ReadMe.txt' will need to be edited to give a precis of what this release of Privoxy brings. This can be distilled from the README for the latest Privoxy project release.
55
56
57
58 3. Build the package
59
60 Three different Packagemaker project files are supplied, though the procedure is the same regardless of which you need to use:
61
62 - OS X 10.5+ PCRE.pmdoc - if you have built Privoxy against an external PCRE library (see 1.1 above).
63 - OS X 10.5+.pmdoc - if you are using the bundled PCRE library.
64 - OS X 10.4.pmdoc - for Tiger builds with the bundled PCRE library.
65
66 Refer to the separate document "Packagemaker Instructions.txt" for complete instructions, however the following item is all that needs to be changed if you are building a package for a newer version of Privoxy:
67
68 'pkg content left-menu item>pkg content>Configuration>Package Version'
69
70 Finally click the 'Build' button at screen top-left. The package filename is up to you but I recommend "Privoxy <version>.pkg", e.g. "Privoxy 3.0.19.pkg". For the down-level release I have used "Privoxy <version> OS X 10.4.mpkg"