Changes to accomodate moving to Git and to compiling on macOS 10.11
authorSteph Burckel <steph@Stephbook.local>
Sun, 11 Jul 2021 21:28:35 +0000 (17:28 -0400)
committerSteph Burckel <steph@Stephbook.local>
Sun, 11 Jul 2021 21:28:35 +0000 (17:28 -0400)
/bin/bash: q: command not found

OS X 10.6+ PCRE.pkgproj
OS X Package Builder HOWTO.txt
build.sh
common.sh
constructPkgContent.sh

index 77b9821..327541d 100755 (executable)
@@ -5,6 +5,10 @@
        <key>PACKAGES</key>
        <array>
                <dict>
+                       <key>MUST-CLOSE-APPLICATION-ITEMS</key>
+                       <array/>
+                       <key>MUST-CLOSE-APPLICATIONS</key>
+                       <false/>
                        <key>PACKAGE_FILES</key>
                        <dict>
                                <key>DEFAULT_INSTALL_LOCATION</key>
                                                                        <key>PATH_TYPE</key>
                                                                        <integer>0</integer>
                                                                        <key>PERMISSIONS</key>
-                                                                       <integer>493</integer>
+                                                                       <integer>1005</integer>
                                                                        <key>TYPE</key>
                                                                        <integer>1</integer>
                                                                        <key>UID</key>
                                                                                                                                                        <key>GID</key>
                                                                                                                                                        <integer>0</integer>
                                                                                                                                                        <key>PATH</key>
-                                                                                                                                                       <string>pkg content/usr/local/etc/privoxy/vanilla/templates/client-tags</string>
+                                                                                                                                                       <string>/Users/steph/code/OSXPackageBuilder/pkg content/usr/local/etc/privoxy/vanilla/templates/client-tags</string>
                                                                                                                                                        <key>PATH_TYPE</key>
-                                                                                                                                                       <integer>1</integer>
+                                                                                                                                                       <integer>0</integer>
                                                                                                                                                        <key>PERMISSIONS</key>
                                                                                                                                                        <integer>420</integer>
                                                                                                                                                        <key>TYPE</key>
                                                                                                                                                        <key>UID</key>
                                                                                                                                                        <integer>0</integer>
                                                                                                                                                </dict>
+                                                                                                                                               <dict>
+                                                                                                                                                       <key>CHILDREN</key>
+                                                                                                                                                       <array/>
+                                                                                                                                                       <key>GID</key>
+                                                                                                                                                       <integer>0</integer>
+                                                                                                                                                       <key>PATH</key>
+                                                                                                                                                       <string>/Users/steph/code/OSXPackageBuilder/pkg content/usr/local/etc/privoxy/vanilla/templates/edit-actions-for-url-string-filter</string>
+                                                                                                                                                       <key>PATH_TYPE</key>
+                                                                                                                                                       <integer>0</integer>
+                                                                                                                                                       <key>PERMISSIONS</key>
+                                                                                                                                                       <integer>420</integer>
+                                                                                                                                                       <key>TYPE</key>
+                                                                                                                                                       <integer>3</integer>
+                                                                                                                                                       <key>UID</key>
+                                                                                                                                                       <integer>0</integer>
+                                                                                                                                               </dict>
                                                                                                                                                <dict>
                                                                                                                                                        <key>CHILDREN</key>
                                                                                                                                                        <array/>
                                                                                                                                                        <key>UID</key>
                                                                                                                                                        <integer>0</integer>
                                                                                                                                                </dict>
-                                                                                                                                               <dict>
-                                                                                                                                                       <key>CHILDREN</key>
-                                                                                                                                                       <array/>
-                                                                                                                                                       <key>GID</key>
-                                                                                                                                                       <integer>0</integer>
-                                                                                                                                                       <key>PATH</key>
-                                                                                                                                                       <string>pkg content/usr/local/etc/privoxy/vanilla/templates/show-version</string>
-                                                                                                                                                       <key>PATH_TYPE</key>
-                                                                                                                                                       <integer>1</integer>
-                                                                                                                                                       <key>PERMISSIONS</key>
-                                                                                                                                                       <integer>420</integer>
-                                                                                                                                                       <key>TYPE</key>
-                                                                                                                                                       <integer>3</integer>
-                                                                                                                                                       <key>UID</key>
-                                                                                                                                                       <integer>0</integer>
-                                                                                                                                               </dict>
                                                                                                                                                <dict>
                                                                                                                                                        <key>CHILDREN</key>
                                                                                                                                                        <array/>
                                                                                                                                                        <key>GID</key>
                                                                                                                                                        <integer>0</integer>
                                                                                                                                                        <key>PATH</key>
-                                                                                                                                                       <string>pkg content/usr/local/share/doc/privoxy/developer-manual/cvs.html</string>
+                                                                                                                                                       <string>pkg content/usr/local/share/doc/privoxy/developer-manual/documentation.html</string>
                                                                                                                                                        <key>PATH_TYPE</key>
                                                                                                                                                        <integer>1</integer>
                                                                                                                                                        <key>PERMISSIONS</key>
                                                                                                                                                        <key>GID</key>
                                                                                                                                                        <integer>0</integer>
                                                                                                                                                        <key>PATH</key>
-                                                                                                                                                       <string>pkg content/usr/local/share/doc/privoxy/developer-manual/documentation.html</string>
+                                                                                                                                                       <string>/Users/steph/code/OSXPackageBuilder/pkg content/usr/local/share/doc/privoxy/developer-manual/git.html</string>
                                                                                                                                                        <key>PATH_TYPE</key>
-                                                                                                                                                       <integer>1</integer>
+                                                                                                                                                       <integer>0</integer>
                                                                                                                                                        <key>PERMISSIONS</key>
                                                                                                                                                        <integer>420</integer>
                                                                                                                                                        <key>TYPE</key>
                                                                                                                                                        <key>GID</key>
                                                                                                                                                        <integer>0</integer>
                                                                                                                                                        <key>PATH</key>
-                                                                                                                                                       <string>pkg content/usr/local/share/doc/privoxy/images/files-in-use.jpg</string>
+                                                                                                                                                       <string>/Users/steph/code/OSXPackageBuilder/pkg content/usr/local/share/doc/privoxy/images/privoxy.png</string>
                                                                                                                                                        <key>PATH_TYPE</key>
-                                                                                                                                                       <integer>1</integer>
-                                                                                                                                                       <key>PERMISSIONS</key>
-                                                                                                                                                       <integer>420</integer>
-                                                                                                                                                       <key>TYPE</key>
-                                                                                                                                                       <integer>3</integer>
-                                                                                                                                                       <key>UID</key>
                                                                                                                                                        <integer>0</integer>
-                                                                                                                                               </dict>
-                                                                                                                                               <dict>
-                                                                                                                                                       <key>CHILDREN</key>
-                                                                                                                                                       <array/>
-                                                                                                                                                       <key>GID</key>
-                                                                                                                                                       <integer>0</integer>
-                                                                                                                                                       <key>PATH</key>
-                                                                                                                                                       <string>pkg content/usr/local/share/doc/privoxy/images/proxy_setup.jpg</string>
-                                                                                                                                                       <key>PATH_TYPE</key>
-                                                                                                                                                       <integer>1</integer>
                                                                                                                                                        <key>PERMISSIONS</key>
                                                                                                                                                        <integer>420</integer>
                                                                                                                                                        <key>TYPE</key>
                                                                                                                                        <key>GID</key>
                                                                                                                                        <integer>0</integer>
                                                                                                                                        <key>PATH</key>
-                                                                                                                                       <string>pkg content/usr/local/share/man/man1/privoxy.1</string>
+                                                                                                                                       <string>/Users/steph/code/OSXPackageBuilder/pkg content/usr/local/share/man/man1/privoxy.8</string>
                                                                                                                                        <key>PATH_TYPE</key>
-                                                                                                                                       <integer>1</integer>
+                                                                                                                                       <integer>0</integer>
                                                                                                                                        <key>PERMISSIONS</key>
                                                                                                                                        <integer>420</integer>
                                                                                                                                        <key>TYPE</key>
                                </dict>
                                <key>PAYLOAD_TYPE</key>
                                <integer>0</integer>
+                               <key>PRESERVE_EXTENDED_ATTRIBUTES</key>
+                               <false/>
+                               <key>SHOW_INVISIBLE</key>
+                               <false/>
+                               <key>SPLIT_FORKS</key>
+                               <true/>
+                               <key>TREAT_MISSING_FILES_AS_WARNING</key>
+                               <false/>
                                <key>VERSION</key>
-                               <integer>4</integer>
+                               <integer>5</integer>
                        </dict>
                        <key>PACKAGE_SCRIPTS</key>
                        <dict>
                                <integer>1</integer>
                                <key>CONCLUSION_ACTION</key>
                                <integer>0</integer>
+                               <key>FOLLOW_SYMBOLIC_LINKS</key>
+                               <false/>
                                <key>IDENTIFIER</key>
                                <string>org.ijbswa.privoxy</string>
+                               <key>LOCATION</key>
+                               <integer>0</integer>
                                <key>NAME</key>
                                <string>OS X 10.6+ PCRE</string>
                                <key>OVERWRITE_PERMISSIONS</key>
                                <false/>
+                               <key>PAYLOAD_SIZE</key>
+                               <integer>-1</integer>
+                               <key>REFERENCE_PATH</key>
+                               <string></string>
+                               <key>RELOCATABLE</key>
+                               <false/>
+                               <key>USE_HFS+_COMPRESSION</key>
+                               <false/>
                                <key>VERSION</key>
-                               <string>3.0.26</string>
+                               <string>3.0.32</string>
                        </dict>
+                       <key>TYPE</key>
+                       <integer>0</integer>
                        <key>UUID</key>
                        <string>C4212B54-A4A8-48AF-8C06-5D4AAE91C4FF</string>
                </dict>
                </dict>
                <key>PROJECT_PRESENTATION</key>
                <dict>
+                       <key>BACKGROUND</key>
+                       <dict>
+                               <key>APPAREANCES</key>
+                               <dict>
+                                       <key>DARK_AQUA</key>
+                                       <dict/>
+                                       <key>LIGHT_AQUA</key>
+                                       <dict/>
+                               </dict>
+                               <key>SHARED_SETTINGS_FOR_ALL_APPAREANCES</key>
+                               <true/>
+                       </dict>
                        <key>INSTALLATION TYPE</key>
                        <dict>
                                <key>HIERARCHIES</key>
                                                <key>LIST</key>
                                                <array>
                                                        <dict>
+                                                               <key>CHILDREN</key>
+                                                               <array/>
                                                                <key>DESCRIPTION</key>
                                                                <array>
                                                                        <dict>
@@ -3028,6 +3052,8 @@ This release includes a bundled copy of PCRE 8.21.</string>
                                                                                        <key>IC_REQUIREMENT_CPU_POWERPC_ARCHITECTURE_TYPE</key>
                                                                                        <integer>0</integer>
                                                                                </dict>
+                                                                               <key>IC_REQUIREMENT_CHECK_TYPE</key>
+                                                                               <integer>-1</integer>
                                                                                <key>IDENTIFIER</key>
                                                                                <string>fr.whitebox.Packages.requirement.cpu</string>
                                                                                <key>MESSAGE</key>
@@ -3049,6 +3075,8 @@ This release includes a bundled copy of PCRE 8.21.</string>
                                                                                        <key>IC_REQUIREMENT_OS_MINIMUM_VERSION</key>
                                                                                        <integer>100500</integer>
                                                                                </dict>
+                                                                               <key>IC_REQUIREMENT_CHECK_TYPE</key>
+                                                                               <integer>-1</integer>
                                                                                <key>IDENTIFIER</key>
                                                                                <string>fr.whitebox.Packages.requirement.os</string>
                                                                                <key>MESSAGE</key>
@@ -3068,8 +3096,6 @@ This release includes a bundled copy of PCRE 8.21.</string>
                                                                                <string>Privoxy for OS X 10.6 and higher</string>
                                                                        </dict>
                                                                </array>
-                                                               <key>TOOLTIP</key>
-                                                               <array/>
                                                                <key>TYPE</key>
                                                                <integer>0</integer>
                                                                <key>UUID</key>
@@ -3080,8 +3106,6 @@ This release includes a bundled copy of PCRE 8.21.</string>
                                                <dict/>
                                        </dict>
                                </dict>
-                               <key>INSTALLATION TYPE</key>
-                               <integer>0</integer>
                                <key>MODE</key>
                                <integer>1</integer>
                        </dict>
@@ -3154,7 +3178,7 @@ This release includes a bundled copy of PCRE 8.21.</string>
                                                <key>VALUE</key>
                                                <dict>
                                                        <key>PATH</key>
-                                                       <string>/Users/yan/code/Privoxy/OSXPackageBuilder/pkg resources/interface texts/Introduction.txt</string>
+                                                       <string>/Users/steph/code/OSXPackageBuilder/pkg resources/interface texts/Introduction.txt</string>
                                                        <key>PATH_TYPE</key>
                                                        <integer>0</integer>
                                                </dict>
@@ -3163,8 +3187,6 @@ This release includes a bundled copy of PCRE 8.21.</string>
                        </dict>
                        <key>LICENSE</key>
                        <dict>
-                               <key>KEYWORDS</key>
-                               <dict/>
                                <key>LOCALIZATIONS</key>
                                <array>
                                        <dict>
@@ -3173,7 +3195,7 @@ This release includes a bundled copy of PCRE 8.21.</string>
                                                <key>VALUE</key>
                                                <dict>
                                                        <key>PATH</key>
-                                                       <string>/Users/yan/code/Privoxy/OSXPackageBuilder/pkg resources/interface texts/LICENSE.txt</string>
+                                                       <string>/Users/steph/code/OSXPackageBuilder/pkg resources/interface texts/LICENSE.txt</string>
                                                        <key>PATH_TYPE</key>
                                                        <integer>0</integer>
                                                </dict>
@@ -3192,7 +3214,7 @@ This release includes a bundled copy of PCRE 8.21.</string>
                                                <key>VALUE</key>
                                                <dict>
                                                        <key>PATH</key>
-                                                       <string>/Users/yan/code/Privoxy/OSXPackageBuilder/pkg resources/interface texts/ReadMe64.txt</string>
+                                                       <string>/Users/steph/code/OSXPackageBuilder/pkg resources/interface texts/ReadMe64.txt</string>
                                                        <key>PATH_TYPE</key>
                                                        <integer>0</integer>
                                                </dict>
@@ -3209,7 +3231,7 @@ This release includes a bundled copy of PCRE 8.21.</string>
                                                <key>VALUE</key>
                                                <dict>
                                                        <key>PATH</key>
-                                                       <string>/Users/yan/code/Privoxy/OSXPackageBuilder/pkg resources/interface texts/Finish Up.txt</string>
+                                                       <string>/Users/steph/code/OSXPackageBuilder/pkg resources/interface texts/Finish Up.txt</string>
                                                        <key>PATH_TYPE</key>
                                                        <integer>0</integer>
                                                </dict>
@@ -3300,19 +3322,13 @@ This release includes a bundled copy of PCRE 8.21.</string>
                                        <true/>
                                </dict>
                        </array>
-                       <key>POSTINSTALL_PATH</key>
-                       <dict/>
-                       <key>PREINSTALL_PATH</key>
-                       <dict/>
                        <key>RESOURCES</key>
                        <array/>
                        <key>ROOT_VOLUME_ONLY</key>
-                       <false/>
+                       <true/>
                </dict>
                <key>PROJECT_SETTINGS</key>
                <dict>
-                       <key>ADVANCED_OPTIONS</key>
-                       <dict/>
                        <key>BUILD_FORMAT</key>
                        <integer>0</integer>
                        <key>BUILD_PATH</key>
@@ -3492,6 +3508,10 @@ This release includes a bundled copy of PCRE 8.21.</string>
                        </array>
                        <key>NAME</key>
                        <string>Privoxy 3.0.26 64 bit</string>
+                       <key>PAYLOAD_ONLY</key>
+                       <false/>
+                       <key>TREAT_MISSING_PRESENTATION_DOCUMENTS_AS_WARNING</key>
+                       <false/>
                </dict>
        </dict>
        <key>TYPE</key>
index 147abc2..4707761 100644 (file)
@@ -5,13 +5,11 @@ This document will guide you through the complete process necessary to create a
 
 ASSUMPTIONS
 
-1. That the Privoxy CVS project is available in a folder parallel to the one containing this file.
-- If building for release it MUST have been exported from Sourceforge to a folder named 'dist', pinned at whichever release you intend to build (as per the instructions in the Privoxy developer manual)
-- If doing a general test build, 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 (or else both exist) you will be prompted to enter the source folder you wish to use when running the scripts detailed below.
+1. That the Privoxy Git project is available in a folder parallel to the one containing this file.
+- If building for release it MUST have been checked out from Git at whichever release tag you intend to build (as per the instructions in the Privoxy developer manual, i.e. git checkout v_X_Y_Z)
 2. That you have Xcode installed, including the SDKs for each OS X version you intend your package(s) to support.
-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).
-4. All references to files and folders in this document should be assumed to be within the OSXBuildSystem folder unless stated otherwise.
+3. That your build machine runs Snow Leopard (OS X 10.6) or a more recent release. PackageMaker is substantially different in Tiger and earlier versions of OS X (even the project file format is different).
+4. All references to files and folders in this document should be assumed to be within the OSXPackageBuilder folder unless stated otherwise.
 
 
 OVERVIEW OF STEPS
@@ -39,9 +37,9 @@ which will build a Universal binary containing targets for PPC, i386 and x86_64
 
 The most common usage therefore would be as follows:
 
-./build.sh snowleopardx64 -pcre
+./build.sh current -pcre
 
-which will build a binary targetting only x86_64 processors (note that OS X has supported only x86_64 since Snow Leopard).
+which will build a binary targeting only x86_64 processors (note that OS X has supported only x86_64 since Snow Leopard).
 
 Running build.sh without supplying any parameters will cause it to list all the possible options, should you have an alternative target requirement.
 
@@ -65,7 +63,7 @@ A sample command line that will build Privoxy with external PCRE to run on Snow
 This example assumes that a valid build of PCRE supporting x86_64 processors and a minimum OS X version of 10.6 is present in /usr/local/lib.
 
 
-1.2 Builds for the Sourceforge Privoxy project release set
+1.2 Builds for the Privoxy project release set
 
 Three packages are built for this target release set:
 
index d7b12dd..2f00841 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -5,7 +5,7 @@
 # Purpose     :  Build the privoxy binary, documentation and config files
 #                for the chosen target environment
 #
-# Copyright   :  Written by and Copyright (C) 2001-2012 the
+# Copyright   :  Written by and Copyright (C) 2001-2021 the
 #                Privoxy team. http://www.privoxy.org/
 #
 #                This program is free software; you can redistribute it
@@ -36,7 +36,7 @@
 # must provide target
 #
 if [ $# -eq 0 -o $# -gt 2 ]; then
-  echo "Usage: $0 lion | snowleopardx64 | snowleopard | snowleopardi386 | leopardupwards | leopard | leopardi386 | leopardppc | tiger | tigeri386 | tigerppc | panther  [-pcre]"
+  echo "Usage: $0 current | lion | snowleopardx64 | snowleopard | snowleopardi386 | leopardupwards | leopard | leopardi386 | leopardppc | tiger | tigeri386 | tigerppc | panther  [-pcre]"
   exit 1
 fi
 
@@ -44,6 +44,8 @@ fi
 # load common settings
 #
 . ./common.sh $1
+#echo "${XCODE_PATH}"
+#echo ${SYSROOT}
 
 #
 # must have Xcode
index 74dcfdc..c78f749 100755 (executable)
--- a/common.sh
+++ b/common.sh
@@ -5,7 +5,7 @@
 # Purpose     :  Establish settings common to the build and privoxy-create
 #                scripts.
 #
-# Copyright   :  Written by and Copyright (C) 2001-2012 the
+# Copyright   :  Written by and Copyright (C) 2001-2021 the
 #                Privoxy team. http://www.privoxy.org/
 #
 #                This program is free software; you can redistribute it
@@ -47,6 +47,15 @@ release_name=$1
 # NOTE: SYSROOT ought to be programmatically determined using XCODE_PATH, however since upgrading my build environment to El Capitan xcode-select returns a non-useful path, hence I am forced to set the SYSROOT explicitly for my build environment, which is now a hybrid of XCode 3.2.6 'running' on OS X 10.11. I am not going to risk upgrading XCode for fear of losing the ability to target down-level OS X versions.
 #
 case "${release_name}" in
+  # Mac OS X 10.11 (x86_64 only)
+  "current")
+    XCODE_PATH="`/usr/bin/xcode-select -print-path`"
+    SYSROOT="-isysroot ${XCODE_PATH}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk"
+    MACOSX_VERSION="-mmacosx-version-min=10.6"
+    ARCH="-arch x86_64"
+    STARTUP="LaunchDaemon"
+    CFLAGS="-mtune=x86_64 ${CFLAGS}"
+    ;;
   # Mac OS X 10.7 (x86_64 only)
   "lion")
     XCODE_PATH="`/usr/bin/xcode-select -print-path`"
@@ -233,7 +242,7 @@ case "${DIRS_FOUND}" in
        ;;
        # either both or neither found
        11|0)
-               read -p 'Could not select the Privoxy source directory. Please supply the directory name (e.g. current or dist): ' SOURCE_DIR
+               read -p 'Could not select the Privoxy source directory (it should be in a directory parallel to that containing this build script). Please supply the directory name (e.g. current or dist): ' SOURCE_DIR
        ;;
 esac
 cd OSXPackageBuilder
index ff6b617..30d93fb 100755 (executable)
@@ -51,6 +51,7 @@ echo ""
 echo ""
 echo "Copy the compiled privoxy binary from the '${SOURCE_DIR}' directory"
 echo ""
+mkdir -vp pkg\ content/usr/local/sbin
 cp -v ../${SOURCE_DIR}/privoxy pkg\ content/usr/local/sbin
 
 # Copy the configuration hierarchy from the '${SOURCE_DIR}' directory
@@ -58,6 +59,7 @@ echo ""
 echo ""
 echo "Copy most of the configuration hierarchy from the '${SOURCE_DIR}' directory"
 echo ""
+mkdir -vp pkg\ content/usr/local/etc/privoxy/vanilla
 for i in default.action default.filter match-all.action trust user.action user.filter templates; do
        if [ "$i" = "templates" ]; then
                # for the templates subfolder copy all files therein
@@ -83,6 +85,7 @@ echo ""
 echo ""
 echo "Copy the documentation hierarchy from the '${SOURCE_DIR}' directory"
 echo ""
+mkdir -vp pkg\ content/usr/local/share/doc/privoxy
 # copy the required directory hierarchies
 for i in developer-manual faq images man-page team user-manual; do
        cp -vR ../${SOURCE_DIR}/doc/webserver/$i pkg\ content/usr/local/share/doc/privoxy/$i
@@ -103,7 +106,8 @@ echo ""
 echo ""
 echo "Copy the manpage from the '${SOURCE_DIR}' directory"
 echo ""
-cp -v ../${SOURCE_DIR}/privoxy.1 pkg\ content/usr/local/share/man/man1
+mkdir -vp pkg\ content/usr/local/share/man/man1
+cp -v ../${SOURCE_DIR}/privoxy.8 pkg\ content/usr/local/share/man/man1
 
 # Optionally copy the PCRE libraries
 if [ "$1" == "-pcre" ]; then