3 This document will guide you through the complete process necessary to create a Privoxy zip package (hereafter 'package') for iOS, starting from the Privoxy source code. This package can then be sent to the maintainer of the chosen Cydia repository for processing and hosting.
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 the minimum iOS 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 iOSBuildSystem folder unless stated otherwise.
16 1. Build the privoxy binary
17 1.1 Consider whether to use external or bundled PCRE.
18 2. Construct the package contents zip file
19 3. How to install manually
23 1. Build the privoxy binary
25 Use privoxy-create.sh (run via sudo) to create the privoxy group and user; these are a prerequisite for the build process.
27 Use build.sh to build a privoxy binary for the desired minimum platform. For example:
31 will build an ARM binary that'll run on all iOS devices running iOS 4.3 and upwards.
33 Running build.sh without supplying any parameters will cause it to list all the possible options.
35 1.1 Consider whether to use external or bundled PCRE.
37 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. The recommendation is therefore to download, make and install the latest PCRE distribution to your build machine and compile Privoxy against that instead.
39 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.
42 2. Construct the package contents hierarchy
44 Use constructZip.sh to build the hierarchy of folders and files and zip them into the destination zip file - org.ijbswa.privoxy.zip. 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, use the optional switch -pcre to instruct constructPkgContent.sh to include those files.
47 3. How to install manually
49 Privoxy can only be installed and run on a jailbroken iDevice.
51 - Copy the zip file from 'pkg content' into the root directory on the iDevice. This can be achieved in many ways; I used the NetATalk Cydia package that installs the AFP file protocol on the iDevice which allows one to connect to it as a shared drive.
52 - unzip org.ijbswa.privoxy.zip
53 - change into the newly-created DEBIAN subfolder
54 - chmod the scripts to make them executable
57 - In Settings->WiFi->[your network name]->HTTP Proxy enter 127.0.0.1 for the server and 8118 for the port
59 From now on, all HTTP communications whilst on the WiFi network will pass via Privoxy's filtering.