*** empty log message ***
authorIan Silvester <iansilvester@fastmail.fm>
Mon, 27 Feb 2012 19:01:14 +0000 (19:01 +0000)
committerIan Silvester <iansilvester@fastmail.fm>
Mon, 27 Feb 2012 19:01:14 +0000 (19:01 +0000)
37 files changed:
.gitignore [new file with mode: 0644]
OS X 10.4.pmdoc/01pkg-contents.xml [new file with mode: 0644]
OS X 10.4.pmdoc/01pkg.xml [new file with mode: 0644]
OS X 10.4.pmdoc/index.xml [new file with mode: 0644]
OS X 10.5+.pmdoc/01pkg-contents.xml [new file with mode: 0644]
OS X 10.5+.pmdoc/01pkg.xml [new file with mode: 0644]
OS X 10.5+.pmdoc/index.xml [new file with mode: 0644]
OS X Package Builder HOWTO.txt [new file with mode: 0644]
Packagemaker Instructions.txt [new file with mode: 0644]
README [new file with mode: 0644]
build.sh [new file with mode: 0755]
common.sh [new file with mode: 0755]
constructPkgContent.sh [new file with mode: 0755]
pkg content skeleton/Applications/Privoxy/readme.rtfd/Screen shot 2012-01-30 at 1.12.07 PM.png [new file with mode: 0644]
pkg content skeleton/Applications/Privoxy/readme.rtfd/Screen shot 2012-01-30 at 1.23.15 PM.png [new file with mode: 0644]
pkg content skeleton/Applications/Privoxy/readme.rtfd/TXT.rtf [new file with mode: 0644]
pkg content skeleton/Applications/Privoxy/startPrivoxy.sh [new file with mode: 0755]
pkg content skeleton/Applications/Privoxy/stopPrivoxy.sh [new file with mode: 0755]
pkg content skeleton/Applications/Privoxy/uninstall.command [new file with mode: 0755]
pkg content skeleton/Library/LaunchDaemons/org.ijbswa.privoxy.plist [new file with mode: 0644]
pkg content skeleton/Library/StartupItems/Privoxy/Privoxy [new file with mode: 0755]
pkg content skeleton/Library/StartupItems/Privoxy/StartupParameters.plist [new file with mode: 0644]
pkg resources/interface texts/Finish Up.txt [new file with mode: 0644]
pkg resources/interface texts/Introduction.txt [new file with mode: 0644]
pkg resources/interface texts/LICENSE.txt [new file with mode: 0644]
pkg resources/interface texts/ReadMe.txt [new file with mode: 0644]
pkg resources/multi-binary scripts/postinstall [new file with mode: 0755]
pkg resources/multi-binary scripts/preinstall [new file with mode: 0755]
pkg resources/multi-binary scripts/readme [new file with mode: 0644]
pkg resources/single-binary scripts/postinstall [new file with mode: 0755]
pkg resources/single-binary scripts/postupgrade [new file with mode: 0755]
pkg resources/single-binary scripts/preinstall [new file with mode: 0755]
pkg resources/single-binary scripts/preupgrade [new file with mode: 0755]
pkg resources/single-binary scripts/readme [new file with mode: 0644]
privoxy-create-dscl.sh [new file with mode: 0755]
privoxy-create-nicl.sh [new file with mode: 0755]
privoxy-create.sh [new file with mode: 0755]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..40caffa
--- /dev/null
@@ -0,0 +1,28 @@
+# CVS default ignores begin
+tags
+TAGS
+.make.state
+.nse_depinfo
+*~
+#*
+.#*
+,*
+_$*
+*$
+*.old
+*.bak
+*.BAK
+*.orig
+*.rej
+.del-*
+*.a
+*.olb
+*.o
+*.obj
+*.so
+*.exe
+*.Z
+*.elc
+*.ln
+core
+# CVS default ignores end
diff --git a/OS X 10.4.pmdoc/01pkg-contents.xml b/OS X 10.4.pmdoc/01pkg-contents.xml
new file mode 100644 (file)
index 0000000..d0115f0
--- /dev/null
@@ -0,0 +1 @@
+<pkg-contents spec="1.12"><f n="pkg content" o="" g="" p="0" pt="/pkg content" m="false" t="file"/></pkg-contents>
\ No newline at end of file
diff --git a/OS X 10.4.pmdoc/01pkg.xml b/OS X 10.4.pmdoc/01pkg.xml
new file mode 100644 (file)
index 0000000..613a891
--- /dev/null
@@ -0,0 +1 @@
+<pkgref spec="1.12" uuid="7D5D8758-1F13-4CA0-9D02-BB598C664B8B"><config><identifier>org.ijbswa.privoxy3019.pkg</identifier><version>1.0</version><description></description><post-install type="none"/><requireAuthorization/><installFrom relative="true" mod="true">pkg content</installFrom><installTo>/</installTo><flags><followSymbolicLinks/><discardResourceForks/><mod>discardResourceForks</mod></flags><packageStore type="internal"></packageStore><mod>installFrom.isRelativeType</mod><mod>installTo</mod><mod>scripts.scriptsDirectoryPath.path</mod><mod>parent</mod><mod>identifier</mod><mod>installFrom.path</mod></config><scripts><scripts-dir mod="true">/Users/yan/code/Privoxy/OSXPackageBuilder/pkg resources/single-binary scripts</scripts-dir></scripts><contents><file-list>01pkg-contents.xml</file-list><filter>/CVS$</filter><filter>/\.svn$</filter><filter>/\.cvsignore$</filter><filter>/\.cvspass$</filter><filter>/\.DS_Store$</filter></contents></pkgref>
\ No newline at end of file
diff --git a/OS X 10.4.pmdoc/index.xml b/OS X 10.4.pmdoc/index.xml
new file mode 100644 (file)
index 0000000..7c4d646
--- /dev/null
@@ -0,0 +1 @@
+<pkmkdoc spec="1.12"><properties><title>Privoxy 3.0.19</title><build>/Users/yan/code/Privoxy/Privoxy 3.0.19 OS X 10.4.mpkg</build><organization>org.ijbswa.privoxy</organization><userSees ui="easy"/><min-target os="2"/><domain/></properties><distribution><versions min-spec="1.000000"/><scripts></scripts></distribution><contents><choice title="pkg content" id="choice15" starts_selected="true" starts_enabled="true" starts_hidden="false"><pkgref id="org.ijbswa.privoxy3019.pkg"/></choice></contents><resources bg-scale="none" bg-align="topleft"><locale lang="en"><resource relative="true" type="license">../current/LICENSE</resource><resource relative="true" mod="true" type="readme">pkg resources/interface texts/ReadMe.txt</resource><resource relative="true" mod="true" type="welcome">pkg resources/interface texts/Introduction.txt</resource><resource relative="true" mod="true" type="conclusion">pkg resources/interface texts/Finish Up.txt</resource></locale></resources><requirements><requirement id="tosv" operator="le" value="'10.4.11'"><message-title>Failure</message-title><message>This version of Privoxy will only install on OS X 10.4 or lower.</message></requirement></requirements><flags/><extra-files/><item type="file">01pkg.xml</item><mod>properties.systemDomain</mod><mod>properties.title</mod><mod>properties.customizeOption</mod><mod>properties.anywhereDomain</mod><mod>extraFiles</mod></pkmkdoc>
\ No newline at end of file
diff --git a/OS X 10.5+.pmdoc/01pkg-contents.xml b/OS X 10.5+.pmdoc/01pkg-contents.xml
new file mode 100644 (file)
index 0000000..2858681
--- /dev/null
@@ -0,0 +1 @@
+<pkg-contents spec="1.12"><f n="pkg content" o="root" g="wheel" p="16832" pt="/Users/yan/code/Privoxy/OSXPackageBuilder/pkg content" m="false" t="file"><f n="Applications" o="root" g="admin" p="16893"><f n="Privoxy" o="root" g="admin" p="16893"><f n="readme.rtfd" o="root" g="admin" p="16893"><f n="Screen shot 2012-01-30 at 1.12.07 PM.png" o="root" g="admin" p="33204"/><f n="Screen shot 2012-01-30 at 1.23.15 PM.png" o="root" g="admin" p="33204"/><f n="TXT.rtf" o="root" g="admin" p="33204"/></f><f n="startPrivoxy.sh" o="root" g="admin" p="33277"/><f n="stopPrivoxy.sh" o="root" g="admin" p="33277"/><f n="uninstall.command" o="root" g="admin" p="33277"/></f></f><f n="Library" o="root" g="admin" p="16893"><f n="LaunchDaemons" o="root" g="wheel" p="16877"><f n="org.ijbswa.privoxy.plist" o="root" g="wheel" p="33188"/></f><f n="StartupItems" o="root" g="wheel" p="16877"><f n="Privoxy" o="root" g="wheel" p="16893"><f n="Privoxy" o="root" g="wheel" p="33277"><mod>mode</mod></f><f n="StartupParameters.plist" o="root" g="wheel" p="33204"><mod>mode</mod></f><mod>mode</mod></f></f></f><f n="usr" o="root" g="wheel" p="16877"><f n="local" o="root" g="wheel" p="16877"><f n="etc" o="root" g="wheel" p="16877"><f n="privoxy" o="root" g="wheel" p="16893"><f n="templates" o="root" g="wheel" p="16893"/><f n="vanilla" o="root" g="wheel" p="16893"><f n="config" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="default.action" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="default.filter" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="match-all.action" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="templates" o="root" g="wheel" p="16893"><f n="blocked" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="cgi-error-404" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="cgi-error-bad-param" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="cgi-error-disabled" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="cgi-error-file" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="cgi-error-file-read-only" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="cgi-error-modified" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="cgi-error-parse" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="cgi-style.css" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="connect-failed" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="connection-timeout" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="default" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="edit-actions-add-url-form" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="edit-actions-for-url" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="edit-actions-for-url-filter" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="edit-actions-list" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="edit-actions-list-button" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="edit-actions-list-section" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="edit-actions-list-url" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="edit-actions-remove-url-form" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="edit-actions-url-form" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="forwarding-failed" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="mod-local-help" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="mod-support-and-service" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="mod-title" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="mod-unstable-warning" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="no-server-data" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="no-such-domain" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="show-request" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="show-status" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="show-status-file" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="show-url-info" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="show-version" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="templates" o="root" g="wheel" p="16893"><f n="blocked" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="cgi-error-404" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="cgi-error-bad-param" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="cgi-error-disabled" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="cgi-error-file" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="cgi-error-file-read-only" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="cgi-error-modified" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="cgi-error-parse" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="cgi-style.css" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="connect-failed" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="connection-timeout" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="default" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="edit-actions-add-url-form" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="edit-actions-for-url" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="edit-actions-for-url-filter" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="edit-actions-list" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="edit-actions-list-button" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="edit-actions-list-section" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="edit-actions-list-url" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="edit-actions-remove-url-form" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="edit-actions-url-form" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="forwarding-failed" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="mod-local-help" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="mod-support-and-service" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="mod-title" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="mod-unstable-warning" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="no-server-data" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="no-such-domain" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="show-request" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="show-status" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="show-status-file" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="show-url-info" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="show-version" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="toggle" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="toggle-mini" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="untrusted" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="url-info-osd.xml" o="root" g="wheel" p="33204"><mod>mode</mod></f><mod>mode</mod></f><f n="toggle" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="toggle-mini" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="untrusted" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="url-info-osd.xml" o="root" g="wheel" p="33204"><mod>mode</mod></f><mod>mode</mod></f><f n="trust" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="user.action" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="user.filter" o="root" g="wheel" p="33204"><mod>mode</mod></f><mod>mode</mod></f></f></f><f n="sbin" o="root" g="wheel" p="16877"><f n="privoxy" o="root" g="wheel" p="33277"/></f><f n="share" o="root" g="wheel" p="16877"><f n="doc" o="root" g="wheel" p="16877"><f n="privoxy" o="root" g="wheel" p="16893"><f n="announce.txt" o="yan" g="staff" p="33188"/><f n="AUTHORS" o="root" g="wheel" p="33204"/><f n="ChangeLog" o="root" g="wheel" p="33204"/><f n="developer-manual" o="root" g="wheel" p="16893"><f n="coding.html" o="root" g="wheel" p="33204"/><f n="contact.html" o="root" g="wheel" p="33204"/><f n="copyright.html" o="root" g="wheel" p="33204"/><f n="cvs.html" o="root" g="wheel" p="33204"/><f n="developer-manual" o="root" g="wheel" p="16893"><f n="coding.html" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="contact.html" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="copyright.html" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="cvs.html" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="documentation.html" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="index.html" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="introduction.html" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="newrelease.html" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="seealso.html" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="testing.html" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="webserver-update.html" o="root" g="wheel" p="33204"><mod>mode</mod></f><mod>mode</mod></f><f n="documentation.html" o="root" g="wheel" p="33204"/><f n="index.html" o="root" g="wheel" p="33204"/><f n="introduction.html" o="root" g="wheel" p="33204"/><f n="newrelease.html" o="root" g="wheel" p="33204"/><f n="seealso.html" o="root" g="wheel" p="33204"/><f n="testing.html" o="root" g="wheel" p="33204"/><f n="webserver-update.html" o="root" g="wheel" p="33204"/></f><f n="faq" o="root" g="wheel" p="16893"><f n="configuration.html" o="root" g="wheel" p="33204"/><f n="contact.html" o="root" g="wheel" p="33204"/><f n="copyright.html" o="root" g="wheel" p="33204"/><f n="faq" o="root" g="wheel" p="16893"><f n="configuration.html" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="contact.html" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="copyright.html" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="general.html" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="index.html" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="installation.html" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="misc.html" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="trouble.html" o="root" g="wheel" p="33204"><mod>mode</mod></f><mod>mode</mod></f><f n="general.html" o="root" g="wheel" p="33204"/><f n="index.html" o="root" g="wheel" p="33204"/><f n="installation.html" o="root" g="wheel" p="33204"/><f n="misc.html" o="root" g="wheel" p="33204"/><f n="trouble.html" o="root" g="wheel" p="33204"/></f><f n="images" o="root" g="wheel" p="16893"><f n="files-in-use.jpg" o="root" g="wheel" p="33204"/><f n="images" o="root" g="wheel" p="16893"><f n="files-in-use.jpg" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="proxy_setup.jpg" o="root" g="wheel" p="33204"><mod>mode</mod></f><mod>mode</mod></f><f n="proxy_setup.jpg" o="root" g="wheel" p="33204"/></f><f n="LICENSE" o="root" g="wheel" p="33204"/><f n="man-page" o="root" g="wheel" p="16893"><f n="man-page" o="root" g="wheel" p="16893"><f n="privoxy-man-page.html" o="root" g="wheel" p="33204"><mod>mode</mod></f><mod>mode</mod></f><f n="privoxy-man-page.html" o="root" g="wheel" p="33204"/></f><f n="p_doc.css" o="root" g="wheel" p="33204"/><f n="privoxy-index.html" o="yan" g="staff" p="33188"/><f n="README" o="root" g="wheel" p="33204"/><f n="team" o="yan" g="staff" p="16877"><f n="01stefanw.jpg" o="yan" g="staff" p="33188"/><f n="01stefanw_t.jpg" o="yan" g="staff" p="33188"/><f n="02jon.jpg" o="yan" g="staff" p="33188"/><f n="02jon_t.jpg" o="yan" g="staff" p="33188"/><f n="03andreas.jpg" o="yan" g="staff" p="33188"/><f n="03andreas_t.jpg" o="yan" g="staff" p="33188"/><f n="04rodney.jpg" o="yan" g="staff" p="33188"/><f n="04rodney_t.jpg" o="yan" g="staff" p="33188"/><f n="05david.jpg" o="yan" g="staff" p="33188"/><f n="05david_t.jpg" o="yan" g="staff" p="33188"/><f n="05member.jpg" o="yan" g="staff" p="33188"/><f n="05member_t.jpg" o="yan" g="staff" p="33188"/><f n="06member.jpg" o="yan" g="staff" p="33188"/><f n="06member_t.jpg" o="yan" g="staff" p="33188"/><f n="07member.jpg" o="yan" g="staff" p="33188"/><f n="07member_t.jpg" o="yan" g="staff" p="33188"/><f n="08member.jpg" o="yan" g="staff" p="33188"/><f n="08member_t.jpg" o="yan" g="staff" p="33188"/><f n="20member.jpg" o="yan" g="staff" p="33188"/><f n="20member_t.jpg" o="yan" g="staff" p="33188"/><f n="index.html" o="yan" g="staff" p="33188"/><f n="team" o="yan" g="staff" p="16893"><f n="01stefanw.jpg" o="yan" g="staff" p="33204"><mod>mode</mod></f><f n="01stefanw_t.jpg" o="yan" g="staff" p="33204"><mod>mode</mod></f><f n="02jon.jpg" o="yan" g="staff" p="33204"><mod>mode</mod></f><f n="02jon_t.jpg" o="yan" g="staff" p="33204"><mod>mode</mod></f><f n="03andreas.jpg" o="yan" g="staff" p="33204"><mod>mode</mod></f><f n="03andreas_t.jpg" o="yan" g="staff" p="33204"><mod>mode</mod></f><f n="04rodney.jpg" o="yan" g="staff" p="33204"><mod>mode</mod></f><f n="04rodney_t.jpg" o="yan" g="staff" p="33204"><mod>mode</mod></f><f n="05david.jpg" o="yan" g="staff" p="33204"><mod>mode</mod></f><f n="05david_t.jpg" o="yan" g="staff" p="33204"><mod>mode</mod></f><f n="05member.jpg" o="yan" g="staff" p="33204"><mod>mode</mod></f><f n="05member_t.jpg" o="yan" g="staff" p="33204"><mod>mode</mod></f><f n="06member.jpg" o="yan" g="staff" p="33204"><mod>mode</mod></f><f n="06member_t.jpg" o="yan" g="staff" p="33204"><mod>mode</mod></f><f n="07member.jpg" o="yan" g="staff" p="33204"><mod>mode</mod></f><f n="07member_t.jpg" o="yan" g="staff" p="33204"><mod>mode</mod></f><f n="08member.jpg" o="yan" g="staff" p="33204"><mod>mode</mod></f><f n="08member_t.jpg" o="yan" g="staff" p="33204"><mod>mode</mod></f><f n="20member.jpg" o="yan" g="staff" p="33204"><mod>mode</mod></f><f n="20member_t.jpg" o="yan" g="staff" p="33204"><mod>mode</mod></f><f n="index.html" o="yan" g="staff" p="33204"><mod>mode</mod></f><mod>mode</mod></f></f><f n="user-manual" o="root" g="wheel" p="16893"><f n="actions-file.html" o="root" g="wheel" p="33204"/><f n="appendix.html" o="root" g="wheel" p="33204"/><f n="config.html" o="root" g="wheel" p="33204"/><f n="configuration.html" o="root" g="wheel" p="33204"/><f n="contact.html" o="root" g="wheel" p="33204"/><f n="copyright.html" o="root" g="wheel" p="33204"/><f n="files-in-use.jpg" o="root" g="wheel" p="33204"/><f n="filter-file.html" o="root" g="wheel" p="33204"/><f n="index.html" o="root" g="wheel" p="33204"/><f n="installation.html" o="root" g="wheel" p="33204"/><f n="introduction.html" o="root" g="wheel" p="33204"/><f n="proxy2.jpg" o="root" g="wheel" p="33204"/><f n="proxy_setup.jpg" o="root" g="wheel" p="33204"/><f n="quickstart.html" o="root" g="wheel" p="33204"/><f n="seealso.html" o="root" g="wheel" p="33204"/><f n="startup.html" o="root" g="wheel" p="33204"/><f n="templates.html" o="root" g="wheel" p="33204"/><f n="user-manual" o="root" g="wheel" p="16893"><f n="actions-file.html" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="appendix.html" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="config.html" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="configuration.html" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="contact.html" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="copyright.html" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="files-in-use.jpg" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="filter-file.html" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="index.html" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="installation.html" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="introduction.html" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="proxy2.jpg" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="proxy_setup.jpg" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="quickstart.html" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="seealso.html" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="startup.html" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="templates.html" o="root" g="wheel" p="33204"><mod>mode</mod></f><f n="whatsnew.html" o="root" g="wheel" p="33204"><mod>mode</mod></f><mod>mode</mod></f><f n="whatsnew.html" o="root" g="wheel" p="33204"/></f></f></f><f n="man" o="root" g="wheel" p="16877"><f n="man1" o="root" g="wheel" p="16877"><f n="privoxy.1" o="root" g="wheel" p="33204"/></f></f></f></f></f><mod>group</mod><mod>owner</mod></f></pkg-contents>
\ No newline at end of file
diff --git a/OS X 10.5+.pmdoc/01pkg.xml b/OS X 10.5+.pmdoc/01pkg.xml
new file mode 100644 (file)
index 0000000..7976060
--- /dev/null
@@ -0,0 +1 @@
+<pkgref spec="1.12" uuid="C4F5129D-5D2C-4DE4-8A05-D5CA97A1BC16"><config><identifier>org.ijbswa.privoxy3019.pkg</identifier><version>1.0</version><description></description><post-install type="none"/><requireAuthorization/><installFrom relative="true">pkg content</installFrom><installTo>/</installTo><flags><followSymbolicLinks/><discardResourceForks/><mod>discardResourceForks</mod></flags><packageStore type="internal"></packageStore><mod>installTo</mod><mod>scripts.scriptsDirectoryPath.path</mod><mod>scripts.scriptsDirectoryPath.isRelativeType</mod><mod>identifier</mod><mod>parent</mod><mod>scripts.scriptsDirectoryPath.isAbsoluteType</mod><mod>installFrom.isRelativeType</mod></config><scripts><scripts-dir mod="true">/Users/yan/code/Privoxy/OSXPackageBuilder/pkg resources/single-binary scripts</scripts-dir></scripts><contents><file-list>01pkg-contents.xml</file-list><filter>/CVS$</filter><filter>/\.svn$</filter><filter>/\.cvsignore$</filter><filter>/\.cvspass$</filter><filter>/\.DS_Store$</filter></contents></pkgref>
\ No newline at end of file
diff --git a/OS X 10.5+.pmdoc/index.xml b/OS X 10.5+.pmdoc/index.xml
new file mode 100644 (file)
index 0000000..77fe59c
--- /dev/null
@@ -0,0 +1 @@
+<pkmkdoc spec="1.12"><properties><title>Privoxy 3.0.19</title><build>/Users/yan/code/Privoxy/Privoxy 3.0.19.pkg</build><organization>org.ijbswa.privoxy</organization><userSees ui="easy"/><min-target os="3"/><domain/></properties><distribution><versions min-spec="1.000000"/><scripts></scripts></distribution><contents><choice title="pkg content" id="choice16" starts_selected="true" starts_enabled="true" starts_hidden="false"><pkgref id="org.ijbswa.privoxy3019.pkg"/></choice></contents><resources bg-scale="none" bg-align="topleft"><locale lang="en"><resource relative="true" type="license">../current/LICENSE</resource><resource relative="true" mod="true" type="readme">pkg resources/interface texts/ReadMe.txt</resource><resource relative="true" mod="true" type="welcome">pkg resources/interface texts/Introduction.txt</resource><resource relative="true" mod="true" type="conclusion">pkg resources/interface texts/Finish Up.txt</resource></locale></resources><requirements><requirement id="tosv" operator="ge" value="'10.5'"><message-title>Failure</message-title><message>OS X 10.5 or higher required.</message></requirement></requirements><flags/><extra-files/><item type="file">01pkg.xml</item><mod>properties.systemDomain</mod><mod>properties.title</mod><mod>properties.customizeOption</mod><mod>properties.anywhereDomain</mod><mod>extraFiles</mod></pkmkdoc>
\ No newline at end of file
diff --git a/OS X Package Builder HOWTO.txt b/OS X Package Builder HOWTO.txt
new file mode 100644 (file)
index 0000000..a6284d9
--- /dev/null
@@ -0,0 +1,60 @@
+INTRODUCTION
+
+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.
+
+
+ASSUMPTIONS
+
+1. That the read-only Privoxy CVS project has been downloaded from Sourceforge, pinned at whichever release you intend to build.
+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.
+
+
+OVERVIEW OF STEPS
+
+1. Build the privoxy binary
+2. Construct the package contents hierarchy
+3. Build the package
+
+
+DETAILS
+
+1. Build the privoxy binary
+
+Use privoxy-create.sh (run via sudo) to create the privoxy group and user; these are a prerequisite for the build process.
+
+Use build.sh to build a privoxy binary for the desired (range of) platform(s). The recommended usage is:
+
+./build.sh leopardupwards
+
+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.
+
+
+2. Construct the package contents hierarchy
+
+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.
+
+Once this is done, the following files will need to be edited:
+
+pkg content/Applications/Privoxy/uninstall.command
+- the two lines that delete the package installation receipt need correcting for the Privoxy version being built
+
+pkg resources/interface texts/ReadMe.txt
+- this can be distilled from the README for the latest Privoxy project release
+
+
+3. Build the package
+
+Open OSX 10.5+.pmdoc in PackageMaker (OSX 10.4.pmdoc is supplied for Tiger since a different package format is required there). See the separate document "Packagemaker Instructions.txt" if you wish to create a package from scratch; otherwsie only the following list of entries will need to be changed to match the Privoxy version you're working with:
+
+Distribution left-menu item>Configuration>Title
+pkg content left-menu item>pkg content>Configuration>Package Identifier
+
+You will then need to navigate to the following pane:
+
+pkg content left-menu item>pkg content>Scripts
+
+and drag and drop 'pkg resources/single-binary scripts' into the 'Scripts directory' entry box. This MUST be left as an 'absolute' path due to a bug in PackageMaker; if you select 'relative to project' then the scripts will not be found nor added to the package at build time.
+
+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"
\ No newline at end of file
diff --git a/Packagemaker Instructions.txt b/Packagemaker Instructions.txt
new file mode 100644 (file)
index 0000000..eb1fcf3
--- /dev/null
@@ -0,0 +1,76 @@
+Packagemaker instructions
+
+The following gives raw information on what settings need to be edited when creating a new Privoxy package when starting from a new project in Packagemaker.
+
+At the end of the document are some additional (very) useful notes.
+
+
+Package Properties
+
+Organisation is: org.ijbswa.privoxy
+Minimum target depends on which release is being built.
+
+
+Distribution Configuration
+
+Title is, for example, Privoxy 3.0.19
+User sees easy install only
+Untick all 'Installation Destination' checkboxes to ensure root volume is selected by default (this will result in a warning when building package).
+No Description (apparently this is only displayed on the Custom Install page)
+
+N.B. I have chosen not to enforce installation to the boot volume only so as to allow more savvy users to install to a remote-connected Mac's root volume. If you'd prefer to enforce installation only to the target machine boot volume (thereby removing one installation step) you can check the 'System Volume' Installation Destination tickbox.
+
+
+Distribution Requirements
+
+Add a Target OS Version check, pass is true, OS X version depends on release being built. Make sure your target version is complete down to the minor version (e.g. 10.5.8 or 10.4.11).
+
+
+Distibution Actions
+
+Empty.
+
+
+Edit Interface
+
+Background is empty.
+Copy and paste texts from file 'pkg texts' to the relevant entry box on the left (having selected the 'embedded' radio button on the right). The license can be a File reference to ../current/LICENSE.
+
+
+Pkg Content
+
+Once the Privoxy build instructions have been completed and the 'prepare package content.sh' script has been run successfully, drag and drop the folder 'pkg content' into the Contents pane of Packagemaker.
+
+No changes need be made to the Choice: pkg content Configuration or Requirements.
+
+Click the pkg content folder icon on the left.
+
+Package: pkg content Configuration
+
+Destination is /
+No custom location
+The Package Identifier should be in the form: 'org.ijbswa.privoxy3019.pkg'. This value also needs to be plugged into the uninstall.command script since I have not yet worked out how to do that programmatically from one of the pre/postinstall scripts.
+Package Version is irrelevant.
+Restart Action: None
+Require admin authentication should be ticked.
+Open the Package Flags window (Package>Package Flags...) and tick Discard Resource Forks.
+
+Package: pkg content Content
+
+Highlight 'pkg content' then change the owner to 'root' and the group to 'wheel'. Click 'Apply Recommendations' to set the owner, group and perms of all the files within. The folders and files within /Library need to be manually tweaked to remove the group write permission.
+
+Package: pkg content Scripts
+
+Drag and drop the scripts folder to the 'Scripts directory' entry field and set 'absolute' in the cog drop-down to the right of the entry field. Note that there is a bug in PackageMaker such that if you select 'relative to project' then the scripts will not be found nor added to your package at build time.
+
+
+
+Useful Notes about PackageMaker
+
+The scripts directory contains two scripts (pre- and post- install), each of which do all that is necessary regardless of whether Privoxy is being installed fresh or over the top of an existing installation.
+
+Each script has an additional hard link (pre- and post- upgrade). In 10.5+ the upgrade scripts are unused, but for 10.4- the existing installation may be detected and in this case the Installer will look for pre- and post- upgrade scripts in the installation package.
+
+PackageMaker will bundle _all_ files in your 'pkg content' folder regardless of whether they are listed in your PackageMaker project's Contents pane or not. It is however mandatory that you set the intended ownership and permissions of the installation files, which means that whenever you wish to add or remove a file from the 'pkg content' folder you are forced to delete and re-drag-drop the pkg content element inside your PackageMaker project. Each time you do this you must re-correct the Package Identifier (hence copy it before deleting the element), re-tick 'Discard Resource Forks' in the Package Flags window, then reset the owner and group and Apply Recommendations.
+
+Apply Recommendations can make mistakes - most notably it will incorrectly give group write permission to LaunchDaemon and StartupItem files and folders. You must untick this box on all those items or else Privoxy will not start when the target machine is booted (and a scary-sounding warning message is displayed). It will however only make these mistakes if the items are NOT present on your build machine when the button is clicked.
\ No newline at end of file
diff --git a/README b/README
new file mode 100644 (file)
index 0000000..774447e
--- /dev/null
+++ b/README
@@ -0,0 +1,54 @@
+# File        :  README
+#
+# Purpose     :  Overall instructions and credits for this module.
+#
+# Copyright   :  Written by and Copyright (C) 2001-2012 the
+#                Privoxy team. http://www.privoxy.org/
+#
+#                This program is free software; you can redistribute it
+#                and/or modify it under the terms of the GNU General
+#                Public License as published by the Free Software
+#                Foundation; either version 2 of the License, or (at
+#                your option) any later version.
+#
+#                This program is distributed in the hope that it will
+#                be useful, but WITHOUT ANY WARRANTY; without even the
+#                implied warranty of MERCHANTABILITY or FITNESS FOR A
+#                PARTICULAR PURPOSE.  See the GNU General Public
+#                License for more details.
+#
+#                The GNU General Public License should be included with
+#                this file.  If not, you can view it at
+#                http://www.gnu.org/copyleft/gpl.html
+#                or write to the Free Software Foundation, Inc.,
+#                51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+#                USA
+#
+# Modification : If you modify this file please consider whether your 
+#                changes ought to be passed back to the macsetup module.
+#
+
+
+INTRODUCTION
+
+The aim of this module is to provide a framework for generating standard OS X installation packages for Privoxy, covering all supported versions of OS X (see below for details of coverage).
+
+Please refer to "OS X Package Builder HOWTO.txt" for full instructions.
+
+
+SUPPORTED PLATFORMS
+
+Theoretically this framework can create installer packages for OS X from versions 10.3 to 10.8 (and higher) inclusive, and for all three processor architectures on which OS X is supported (PowerPC, Intel x86 and Intel x86_64). Packages have so far been tested on the following platforms:
+
+10.7 x86_64
+10.6 x86_64 & x86
+10.5 x86_64, x86 & PPC
+10.4 x86 & PPC
+
+
+ATTRIBUTION
+
+This module is based on the previous work done by Mark Miller (macsetup module) and David Schmidt & John Daniels (osxsetup module), to whom I am indebted. Thanks also to Fabian Keil for occasional technical and significant licensing guidance, and to Andrew Jones, Andreas Rutkauskas, Julien Joubert and Lizik Grelier for testing.
+
+
+Ian Silvester February 2012
\ No newline at end of file
diff --git a/build.sh b/build.sh
new file mode 100755 (executable)
index 0000000..65dd23b
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,97 @@
+#!/bin/sh
+
+# File        :  build.sh
+#
+# Purpose     :  Build the privoxy binary, documentation and config files
+#                for the chosen target environment
+#
+# Copyright   :  Written by and Copyright (C) 2001-2012 the
+#                Privoxy team. http://www.privoxy.org/
+#
+#                This program is free software; you can redistribute it
+#                and/or modify it under the terms of the GNU General
+#                Public License as published by the Free Software
+#                Foundation; either version 2 of the License, or (at
+#                your option) any later version.
+#
+#                This program is distributed in the hope that it will
+#                be useful, but WITHOUT ANY WARRANTY; without even the
+#                implied warranty of MERCHANTABILITY or FITNESS FOR A
+#                PARTICULAR PURPOSE.  See the GNU General Public
+#                License for more details.
+#
+#                The GNU General Public License should be included with
+#                this file.  If not, you can view it at
+#                http://www.gnu.org/copyleft/gpl.html
+#                or write to the Free Software Foundation, Inc.,
+#                51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+#                USA
+#
+# Modification : If you modify this file please consider whether your 
+#                changes ought to be passed back to the macsetup module.
+#
+
+#
+# must provide target
+#
+if [ $# -eq 0 -o $# -gt 1 ]; then
+  echo "Usage: $0 lion | snowleopard64 | snowleopard | leopardupwards | leopard | tiger | panther"
+  exit 1
+fi
+
+#
+# load common settings
+#
+. ./common.sh $1
+
+#
+# must have Xcode
+#
+if [ -z ${XCODE_PATH} ]; then
+  echo "Error: this release of Mac OS X not supported."
+  exit 1
+fi
+
+#
+# use default options
+#
+OPTS=${OPTS}
+
+#
+# check if privoxy group and user exist?
+#
+if [ -z ${GNAME} -o -z ${UNAME} ]; then
+  echo ""
+  echo "Error: a privoxy group and user do not exist."
+  echo "A privoxy group and user must be created before continuing."
+  echo "Review the README file for instructions on creating a privoxy group and user."
+  exit 1
+else
+  echo ""
+  echo "Notice: an existing privoxy group and user was found."
+fi
+
+#
+# configure privoxy
+#
+echo ""
+echo "Notice: configuring the privoxy software."
+cd ../current
+/usr/bin/autoheader
+/usr/bin/autoconf
+/usr/bin/env CFLAGS="${CFLAGS} ${SYSROOT} ${ARCH} ${MACOSX_VERSION}" LDFLAGS="${LDFLAGS} ${SYSROOT} ${ARCH} ${MACOSX_VERSION}" ./configure ${OPTS}
+
+#
+# clean, then make privoxy
+#
+echo ""
+echo "Notice: building the privoxy software."
+/usr/bin/make clean
+/usr/bin/make
+
+#
+# modify config file
+#
+/usr/bin/awk '{sub(/logfile.*logfile$/,"logfile logfile.log"); print}' ../current/config > ../current/config.tmp
+/bin/mv ../current/config.tmp ../current/config
+
diff --git a/common.sh b/common.sh
new file mode 100755 (executable)
index 0000000..320ac17
--- /dev/null
+++ b/common.sh
@@ -0,0 +1,149 @@
+#!/bin/sh
+
+# File        :  common.sh
+#
+# Purpose     :  Establish settings common to the build and privoxy-create
+#                scripts.
+#
+# Copyright   :  Written by and Copyright (C) 2001-2012 the
+#                Privoxy team. http://www.privoxy.org/
+#
+#                This program is free software; you can redistribute it
+#                and/or modify it under the terms of the GNU General
+#                Public License as published by the Free Software
+#                Foundation; either version 2 of the License, or (at
+#                your option) any later version.
+#
+#                This program is distributed in the hope that it will
+#                be useful, but WITHOUT ANY WARRANTY; without even the
+#                implied warranty of MERCHANTABILITY or FITNESS FOR A
+#                PARTICULAR PURPOSE.  See the GNU General Public
+#                License for more details.
+#
+#                The GNU General Public License should be included with
+#                this file.  If not, you can view it at
+#                http://www.gnu.org/copyleft/gpl.html
+#                or write to the Free Software Foundation, Inc.,
+#                51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+#                USA
+#
+# Modification : If you modify this file please consider whether your 
+#                changes ought to be passed back to the macsetup module.
+#
+
+#========================================
+#  target specific settings
+#========================================
+
+#
+# mac os x release name
+#
+release_name=$1
+
+#
+# check the release name
+#
+case "${release_name}" in
+  # Mac OS X 10.7 (64bit only)
+  "lion")
+    XCODE_PATH="`/usr/bin/xcode-select -print-path`"
+    SYSROOT="-isysroot ${XCODE_PATH}/SDKs/MacOSX10.7.sdk"
+    MACOSX_VERSION="-mmacosx-version-min=10.7"
+    ARCH="-arch x86_64"
+    STARTUP="LaunchDaemon"
+    ;;
+  # Mac OS X 10.6 64bit
+  "snowleopard64")
+    XCODE_PATH="`/usr/bin/xcode-select -print-path`"
+    SYSROOT="-isysroot ${XCODE_PATH}/SDKs/MacOSX10.6.sdk"
+    MACOSX_VERSION="-mmacosx-version-min=10.6"
+    ARCH="-arch x86_64"
+    STARTUP="LaunchDaemon"
+    ;;
+  # Mac OS X 10.6
+  "snowleopard")
+    XCODE_PATH="`/usr/bin/xcode-select -print-path`"
+    SYSROOT="-isysroot ${XCODE_PATH}/SDKs/MacOSX10.6.sdk"
+    MACOSX_VERSION="-mmacosx-version-min=10.6"
+    ARCH="-arch i386"
+    STARTUP="LaunchDaemon"
+    ;;
+  # Mac OS X 10.5 and all later releases
+  "leopardupwards")
+    XCODE_PATH="`/usr/bin/xcode-select -print-path`"
+    SYSROOT="-isysroot ${XCODE_PATH}/SDKs/MacOSX10.5.sdk"
+    MACOSX_VERSION="-mmacosx-version-min=10.5"
+    ARCH="-arch x86_64 -arch i386 -arch ppc"
+    STARTUP="LaunchDaemon"
+    ;;
+  # Mac OS X 10.5
+  "leopard")
+    XCODE_PATH="`/usr/bin/xcode-select -print-path`"
+    SYSROOT="-isysroot ${XCODE_PATH}/SDKs/MacOSX10.5.sdk"
+    MACOSX_VERSION="-mmacosx-version-min=10.5"
+    ARCH="-arch i386 -arch ppc"
+    STARTUP="LaunchDaemon"
+    ;;
+  # Mac OS X 10.4
+  "tiger")
+    XCODE_PATH="/Developer"
+    SYSROOT="-isysroot ${XCODE_PATH}/SDKs/MacOSX10.4u.sdk"
+    MACOSX_VERSION="-mmacosx-version-min=10.4"
+    ARCH="-arch i386 -arch ppc"
+    STARTUP="LaunchDaemon"
+    ;;
+  # Mac OS X 10.3
+  "panther")
+    XCODE_PATH="/Developer"
+    SYSROOT="-isysroot ${XCODE_PATH}/SDKs/MacOSX10.3.9.sdk"
+    MACOSX_VERSION="-mmacosx-version-min=10.3"
+    ARCH="-arch ppc"
+    STARTUP="StartupItem"
+    ;;
+  # default
+  *)
+    XCODE_PATH=""
+    SYSROOT=""
+    MACOSX_VERSION=""
+    ARCH=""
+    STARTUP=""
+    ;;
+esac
+
+
+#========================================
+#  host specific settings
+#========================================
+
+#
+# darwin os major release number
+#
+darwin_major_rel_num="`/usr/bin/uname -r | /usr/bin/sed 's/\..*//'`"
+
+#
+# check the release number
+#
+case "${darwin_major_rel_num}" in
+  # Mac OS X 10.7, 10.6, 10.5
+  11|10|9)
+    GNAME="`/usr/bin/dscl /Local/Default -list /groups | /usr/bin/grep -E '^(_)?privoxy?'`"
+    UNAME="`/usr/bin/dscl /Local/Default -list /users | /usr/bin/grep -E '^(_)?privoxy?'`"
+    SCRIPT="privoxy-create-dscl.sh"
+    OPTS="--with-user=_privoxy --with-group=_privoxy"
+    ;;
+  # Mac OS X 10.4, 10.3
+  8|7)
+    GNAME="`/usr/bin/nireport . /groups name | /usr/bin/grep -E '^privoxy?'`"
+    UNAME="`/usr/bin/nireport . /users name | /usr/bin/grep -E '^privoxy?'`"
+    SCRIPT="privoxy-create-nicl.sh"
+    OPTS="--with-user=privoxy --with-group=privoxy"
+    ;;
+  # default
+  *)
+    GNAME=""
+    UNAME=""
+    SCRIPT=""
+    OPTS=""
+    ;;
+esac
+
diff --git a/constructPkgContent.sh b/constructPkgContent.sh
new file mode 100755 (executable)
index 0000000..0ca51a1
--- /dev/null
@@ -0,0 +1,99 @@
+#!/bin/sh
+
+# File        :  constructPkgContent.sh
+#
+# Purpose     :  Create the hierarchy of folders and files that will 
+#                comprise the installation package.
+#
+# Copyright   :  Written by and Copyright (C) 2001-2012 the
+#                Privoxy team. http://www.privoxy.org/
+#
+#                This program is free software; you can redistribute it
+#                and/or modify it under the terms of the GNU General
+#                Public License as published by the Free Software
+#                Foundation; either version 2 of the License, or (at
+#                your option) any later version.
+#
+#                This program is distributed in the hope that it will
+#                be useful, but WITHOUT ANY WARRANTY; without even the
+#                implied warranty of MERCHANTABILITY or FITNESS FOR A
+#                PARTICULAR PURPOSE.  See the GNU General Public
+#                License for more details.
+#
+#                The GNU General Public License should be included with
+#                this file.  If not, you can view it at
+#                http://www.gnu.org/copyleft/gpl.html
+#                or write to the Free Software Foundation, Inc.,
+#                51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+#                USA
+#
+# Modification : If you modify this file please consider whether your 
+#                changes ought to be passed back to the macsetup module.
+#
+
+# 1. Remove existing 'pkg content' folder if found
+echo ""
+echo "Remove existing 'pkg content' folder if found"
+echo ""
+rm -rf pkg\ content
+
+# 1. Copy the package skeleton (the unchanging content) to a new folder named 'pkg content'
+echo ""
+echo ""
+echo "Copy the package skeleton (the unchanging content) to a new folder named 'pkg content'"
+echo ""
+cp -vR pkg\ content\ skeleton pkg\ content
+
+# 2. Copy the compiled privoxy binary from the 'current' project
+echo ""
+echo ""
+echo "Copy the compiled privoxy binary from the 'current' project"
+echo ""
+cp -v ../current/privoxy pkg\ content/usr/local/sbin
+
+# 3. Copy the configuration hierarchy from the 'current' project
+echo ""
+echo ""
+echo "Copy the configuration hierarchy from the 'current' project"
+echo ""
+for i in default.action default.filter match-all.action config trust user.action user.filter templates; do
+       if [ "$i" = "templates" ]; then
+               # for the templates subfolder copy all files therein
+               cp -vR ../current/$i pkg\ content/usr/local/etc/privoxy/vanilla/$i
+       else
+               # for all regular files just copy them across
+               cp -v ../current/$i pkg\ content/usr/local/etc/privoxy/vanilla/$i
+       fi
+done
+
+# 4. Copy the documentation hierarchy from the 'current' project
+echo ""
+echo ""
+echo "Copy the documentation hierarchy from the 'current' project"
+echo ""
+# copy the required directory hierarchies
+for i in developer-manual faq images man-page team user-manual; do
+       cp -vR ../current/doc/webserver/$i pkg\ content/usr/local/share/doc/privoxy/$i
+done
+# copy the top-level files
+for i in announce.txt p_doc.css privoxy-index.html; do
+       cp -v ../current/doc/webserver/$i pkg\ content/usr/local/share/doc/privoxy/$i
+done
+# copy the project's AUTHORS, ChangeLog, LICENSE and README files
+for i in AUTHORS ChangeLog LICENSE README; do
+       cp -v ../current/$i pkg\ content/usr/local/share/doc/privoxy/$i
+done
+
+# 5. Copy the manpage from the 'current' project
+echo ""
+echo ""
+echo "Copy the manpage from the 'current' project"
+echo ""
+cp -v ../current/privoxy.1 pkg\ content/usr/local/share/man/man1
+
+# 6. Remove unnecessary CVS administration files
+echo ""
+echo ""
+echo "Remove CVS administration files"
+echo ""
+find pkg\ content -name CVS.sandboxinfo -exec rm -rf {} \;
diff --git a/pkg content skeleton/Applications/Privoxy/readme.rtfd/Screen shot 2012-01-30 at 1.12.07 PM.png b/pkg content skeleton/Applications/Privoxy/readme.rtfd/Screen shot 2012-01-30 at 1.12.07 PM.png
new file mode 100644 (file)
index 0000000..1bab055
Binary files /dev/null and b/pkg content skeleton/Applications/Privoxy/readme.rtfd/Screen shot 2012-01-30 at 1.12.07 PM.png differ
diff --git a/pkg content skeleton/Applications/Privoxy/readme.rtfd/Screen shot 2012-01-30 at 1.23.15 PM.png b/pkg content skeleton/Applications/Privoxy/readme.rtfd/Screen shot 2012-01-30 at 1.23.15 PM.png
new file mode 100644 (file)
index 0000000..d1f697b
Binary files /dev/null and b/pkg content skeleton/Applications/Privoxy/readme.rtfd/Screen shot 2012-01-30 at 1.23.15 PM.png differ
diff --git a/pkg content skeleton/Applications/Privoxy/readme.rtfd/TXT.rtf b/pkg content skeleton/Applications/Privoxy/readme.rtfd/TXT.rtf
new file mode 100644 (file)
index 0000000..5a12cd0
--- /dev/null
@@ -0,0 +1,118 @@
+{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;\red255\green19\blue25;}
+\margl1440\margr1440\vieww21240\viewh13460\viewkind0
+\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural
+
+\f0\b\fs34 \cf2 \
+You must make the following change in order to start using Privoxy!
+\b0\fs24 \cf0 \
+\
+\
+
+\b\fs26 Setting up your web browser(s) to use Privoxy
+\b0\fs24 \
+\
+In order for Privoxy to filter web content for you, it must be set up as a proxy for your web browser. To do this for most web browsers (Safari, Chrome, Camino - see later in this readme for other browsers) go into your System Preferences.. Network.. preference pane. If the padlock at the bottom-left of the window is locked, you'll need to click it and enter your password to makes changes, then click 'Advanced' and click on the Proxies tab. In both the Web Proxy (HTTP) 
+\b and
+\b0  Secure Web Proxy (HTTPS) entries, add the value 127.0.0.1 in the Web Proxy Server box and 8118 in the box to it's right (see screenshot below). Click 'OK' and then 'Apply' and you're all set!\
+\
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
+\cf0 {{\NeXTGraphic Screen shot 2012-01-30 at 1.12.07 PM.png \width13300 \height10400
+}¬}\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
+\cf0 \
+\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural
+\cf0 \
+\
+Firefox and Opera have their proxy server settings within the application, for Firefox you'll find the settings at:\
+\
+Firefox > Preferences > Network > Settings > Manual Proxy Configuration\
+\
+and for Opera at:\
+\
+Opera > Preferences > Advanced > Network > Proxy Servers\
+\
+\
+\
+
+\b\fs26 Checking that Privoxy is working for you
+\b0\fs24 \
+\
+Simply point your web browser here:\
+\
+\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural
+{\field{\*\fldinst{HYPERLINK "http://config.privoxy.org/"}}{\fldrslt \cf0 http://config.privoxy.org/}}\
+\
+If you see a page like the following screenshot then all is well and Privoxy is filtering web content for you.
+\b\fs26 \
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
+
+\b0\fs24 \cf0 {{\NeXTGraphic Screen shot 2012-01-30 at 1.23.15 PM.png \width25300 \height12660
+}¬}\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
+
+\b\fs26 \cf0 \
+\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural
+\cf0 \
+\
+\
+Configuring Privoxy
+\b0\fs24 \
+\
+You can access your Privoxy installation configuration at:\
+\
+\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural
+{\field{\*\fldinst{HYPERLINK "http://config.privoxy.org/"}}{\fldrslt \cf0 http://config.privoxy.org/}}\
+\
+Note that to make configuration changes here you first have to manually enable this feature. This is done by setting parameter enable-edit-actions to the value 1 in {\field{\*\fldinst{HYPERLINK "file:///usr/local/etc/privoxy/config"}}{\fldrslt Privoxy's config file}}, which you'll need to edit as an administrator in order to save your changes. Full documentation for Privoxy can be found here:\
+\
+\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural
+{\field{\*\fldinst{HYPERLINK "file:///usr/local/share/doc/privoxy/"}}{\fldrslt \cf0 file:///usr/local/share/doc/privoxy/}}  (a good place to start is index.html or README)\
+\
+\
+\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural
+
+\b\fs26 \cf0 \
+Merging an existing configuration
+\b0\fs24 \
+\
+If you already had Privoxy installed prior to this installation, then your configuration is unchanged. It is possible however that the configuration files supplied with this new installation contain new options that your existing configuration files do not. If you wish to manually merge your settings into the new files you will find them all at /usr/local/etc/privoxy/\
+\
+\
+\
+
+\b\fs26 Uninstallation
+\b0 \
+
+\fs24 \
+To remove Privoxy once it has been installed, first of all reconfigure your web browser(s) not to use Privoxy as a proxy (see the top of this file for details). Once you're happy that you're not using Privoxy any more you can run its uninstall script.\
+\
+To do this, open a Terminal window then enter the following commands:\
+\
+cd /Applications/Privoxy\
+sudo ./uninstall.command\
+\
+You will be prompted for your password, since the script requires super-user privileges to run. If your account is not an administrator account, then the script won't work; you'll need to log in using an administrator account and try again. If you have already dragged the Privoxy application folder to the trash, use the 'Put Back' feature to restore it or else recreate the Privoxy folder in your Applications folder, drag the uninstall.command file from the trash to that folder and proceed as above.\
+\
+\
+\
+
+\b Thanks\
+
+\b0 \
+This installer is based on previous work done by Mark Miller, David Schmidt and John Daniels, to whom I am indebted. Thanks also to Fabian Keil for occasional technical and significant licensing guidance, and to Andrew Jones, Andreas Rutkauskas, Julien Joubert and Lizik Grelier for testing.\
+\
+\
+\
+
+\b Copyright and Licensing\
+
+\b0 \
+All files that comprise this installation of Privoxy are written by and Copyright (C) 2001-2012 the Privoxy team. http://www.privoxy.org/\
+\
+\pard\pardeftab720\ql\qnatural
+\cf0 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\
+\
+This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. \'a0See the GNU General Public License for more details.\
+\
+The GNU General Public License should be included with this file. \'a0If not, you can view it at http://www.gnu.org/copyleft/gpl.html or write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA\
+}
\ No newline at end of file
diff --git a/pkg content skeleton/Applications/Privoxy/startPrivoxy.sh b/pkg content skeleton/Applications/Privoxy/startPrivoxy.sh
new file mode 100755 (executable)
index 0000000..761aa2e
--- /dev/null
@@ -0,0 +1,61 @@
+#!/bin/sh
+
+# File        :  startPrivoxy.sh
+#
+# Purpose     :  Uses the method appropriate to the host OS X version
+#                to start Privoxy
+#
+# Copyright   :  Written by and Copyright (C) 2001-2012 the
+#                Privoxy team. http://www.privoxy.org/
+#
+#                This program is free software; you can redistribute it
+#                and/or modify it under the terms of the GNU General
+#                Public License as published by the Free Software
+#                Foundation; either version 2 of the License, or (at
+#                your option) any later version.
+#
+#                This program is distributed in the hope that it will
+#                be useful, but WITHOUT ANY WARRANTY; without even the
+#                implied warranty of MERCHANTABILITY or FITNESS FOR A
+#                PARTICULAR PURPOSE.  See the GNU General Public
+#                License for more details.
+#
+#                The GNU General Public License should be included with
+#                this file.  If not, you can view it at
+#                http://www.gnu.org/copyleft/gpl.html
+#                or write to the Free Software Foundation, Inc.,
+#                51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+#                USA
+#
+# Modification : If you modify this file please consider whether your 
+#                changes ought to be passed back to the macsetup module.
+#
+
+root_UID=0   # Root has $UID 0.
+
+if [ "$UID" -eq "$root_UID" ]; then
+       # what is the kernel version
+       darwin_major_rel_num="`/usr/bin/uname -r | /usr/bin/sed 's/\..*//'`"
+       case "${darwin_major_rel_num}" in
+               # Mac OS X 10.7, 10.6, 10.5
+               11|10|9)
+                       /bin/launchctl load /Library/LaunchDaemons/org.ijbswa.privoxy.plist
+               ;;
+               # Mac OS X 10.4, 10.3
+               8|7)
+                       /Library/StartupItems/Privoxy/Privoxy start
+               ;;
+               # default
+               *)
+               ;;
+       esac
+else
+       echo
+  echo This script requires administrator privileges.
+       echo "Please run it from Terminal, using an administrator account, as follows:"
+       echo
+       echo "sudo /Applications/Privoxy/startPrivoxy.sh"
+       echo
+fi
+
+exit 0
\ No newline at end of file
diff --git a/pkg content skeleton/Applications/Privoxy/stopPrivoxy.sh b/pkg content skeleton/Applications/Privoxy/stopPrivoxy.sh
new file mode 100755 (executable)
index 0000000..a8052f0
--- /dev/null
@@ -0,0 +1,62 @@
+#!/bin/sh
+
+# File        :  stopPrivoxy.sh
+#
+# Purpose     :  Uses the method appropriate to the host OS X version
+#                to stop Privoxy
+#
+# Copyright   :  Written by and Copyright (C) 2001-2012 the
+#                Privoxy team. http://www.privoxy.org/
+#
+#                This program is free software; you can redistribute it
+#                and/or modify it under the terms of the GNU General
+#                Public License as published by the Free Software
+#                Foundation; either version 2 of the License, or (at
+#                your option) any later version.
+#
+#                This program is distributed in the hope that it will
+#                be useful, but WITHOUT ANY WARRANTY; without even the
+#                implied warranty of MERCHANTABILITY or FITNESS FOR A
+#                PARTICULAR PURPOSE.  See the GNU General Public
+#                License for more details.
+#
+#                The GNU General Public License should be included with
+#                this file.  If not, you can view it at
+#                http://www.gnu.org/copyleft/gpl.html
+#                or write to the Free Software Foundation, Inc.,
+#                51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+#                USA
+#
+# Modification : If you modify this file please consider whether your 
+#                changes ought to be passed back to the macsetup module.
+#
+
+
+root_UID=0   # Root has $UID 0.
+
+if [ "$UID" -eq "$root_UID" ]; then
+       # what is the kernel version
+       darwin_major_rel_num="`/usr/bin/uname -r | /usr/bin/sed 's/\..*//'`"
+       case "${darwin_major_rel_num}" in
+               # Mac OS X 10.7, 10.6, 10.5
+               11|10|9)
+                       /bin/launchctl unload /Library/LaunchDaemons/org.ijbswa.privoxy.plist
+               ;;
+               # Mac OS X 10.4, 10.3
+               8|7)
+                       /Library/StartupItems/Privoxy/Privoxy stop
+               ;;
+               # default
+               *)
+               ;;
+       esac
+else
+       echo
+  echo This script requires administrator privileges.
+       echo "Please run it from Terminal, using an administrator account, as follows:"
+       echo
+       echo "sudo /Applications/Privoxy/stopPrivoxy.sh"
+       echo
+fi
+
+exit 0
\ No newline at end of file
diff --git a/pkg content skeleton/Applications/Privoxy/uninstall.command b/pkg content skeleton/Applications/Privoxy/uninstall.command
new file mode 100755 (executable)
index 0000000..1112c00
--- /dev/null
@@ -0,0 +1,145 @@
+#!/bin/sh
+
+# File        :  uninstall.command
+#
+# Purpose     :  Remove the Privoxy application and (optionally) its  
+#                configuration files from the target system
+#
+# Copyright   :  Written by and Copyright (C) 2001-2012 the
+#                Privoxy team. http://www.privoxy.org/
+#
+#                This program is free software; you can redistribute it
+#                and/or modify it under the terms of the GNU General
+#                Public License as published by the Free Software
+#                Foundation; either version 2 of the License, or (at
+#                your option) any later version.
+#
+#                This program is distributed in the hope that it will
+#                be useful, but WITHOUT ANY WARRANTY; without even the
+#                implied warranty of MERCHANTABILITY or FITNESS FOR A
+#                PARTICULAR PURPOSE.  See the GNU General Public
+#                License for more details.
+#
+#                The GNU General Public License should be included with
+#                this file.  If not, you can view it at
+#                http://www.gnu.org/copyleft/gpl.html
+#                or write to the Free Software Foundation, Inc.,
+#                51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+#                USA
+#
+# Modification : If you modify this file please consider whether your 
+#                changes ought to be passed back to the macsetup module.
+#
+
+root_UID=0   # Root has $UID 0.
+
+if [ "$UID" -eq "$root_UID" ]; then
+       echo  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+       echo 'About to remove the Privoxy application.  Are you sure? (Y/N)'
+       echo  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+       read ANSWER
+       if (test z$ANSWER = zY) || (test z$ANSWER = zy) then
+               echo  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+               echo 'Last chance.  Removing Privoxy...  Are you sure? (Y/N)'
+               echo  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+               read ANSWER
+               if (test z$ANSWER = zY) || (test z$ANSWER = zy) then
+                       echo Stopping Privoxy.
+                       kill `ps -ax | grep /privoxy | grep -v grep | awk '{ print $1 }'` 2> /dev/null
+                       # Remove items common to all OS X versions
+                       echo Deleting Privoxy and its documentation
+                       # Delete binary
+                       rm -f /usr/local/sbin/privoxy
+                       # Delete documention
+                       rm -rf /usr/local/share/doc/privoxy
+                       # Delete manpage
+                       rm -f /usr/local/share/man/man1/privoxy.1
+                       # Optionally delete config files
+                       echo  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+                       echo 'Delete configuration files? (Y/N)'
+                       echo  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+                       read ANSWER
+                       if (test z$ANSWER = zY) || (test z$ANSWER = zy) then
+                               rm -rf /usr/local/etc/privoxy
+                       fi
+                       # Delete log files
+                       rm -rf /var/log/privoxy
+                       # Delete folder from /Applications
+                       rm -rf /Applications/Privoxy
+                       
+                       # Delete all items referenced by the installation package
+                       echo 'Delete package installation receipt (ignore errors relating to other bundle identifiers).'
+                       # TODO overwrite PKGNAME during postinstall execution with the name of the package being installed.
+                       # In the meantime, the package name must be manually entered for each release.
+                       #pkgutil --forget PKGNAME
+                       # if OS X 10.5 or newer then use the new pkgutil command else simply delete the receipt file
+                       if [ -x /usr/sbin/pkgutil ]; then
+                               pkgutil --forget org.ijbswa.privoxy3019.pkg
+                       else
+                               rm -rf /Library/Receipts/Privoxy\ 3.0.19\ OS\ X\ 10.4.pkg
+                       fi
+
+                       # Check the Trash, just in case the user manually removed the only obvious item from /Applications
+                       if [ -d ~/.Trash/Privoxy ]; then
+                               echo Removing Privoxy from the trash.
+                               rm -rf ~/.Trash/Privoxy
+                       fi
+
+                       # Delete host-dependent items - first ascertain OS X version
+                       darwin_major_rel_num="`/usr/bin/uname -r | /usr/bin/sed 's/\..*//'`"
+
+                       case "${darwin_major_rel_num}" in
+                               # Mac OS X 10.7, 10.6, 10.5
+                               11|10|9)
+                                       # Delete Privoxy LaunchDaemon
+                                       echo 'Delete Privoxy LaunchDaemon (an error will be thrown regarding "no such process")'
+                                       /bin/launchctl unload /Library/LaunchDaemons/org.ijbswa.privoxy.plist
+                                       /bin/launchctl remove /Library/LaunchDaemons/org.ijbswa.privoxy.plist
+                                       rm -f /Library/LaunchDaemons/org.ijbswa.privoxy.plist
+                                       # The installer might have disabled a previous Privoxy LaunchDaemon
+                                       rm -rf /Library/LaunchDaemons/Disabled/org.ijbswa.privoxy.plist
+                                       # There might have previously been a StartupItem installed
+                                       rm -rf /Library/StartupItems/Privoxy
+                                       # There might have previously been a disabled Privoxy StartupItem
+                                       rm -rf /Library/StartupItems/Disabled/Privoxy
+                                       # Remove user and group
+                                       echo Removing privoxy user and group
+                                       dscl /Local/Default -delete /Users/_privoxy
+                                       dscl /Local/Default -delete /Groups/_privoxy
+                               ;;
+                               # Mac OS X 10.4, 10.3
+                               8|7)
+                                       # Delete Privoxy StartupItem
+                                       echo Delete Privoxy StartupItem
+                                       rm -rf /Library/StartupItems/Privoxy
+                                       # The installer might have disabled a previous Privoxy StartupItem
+                                       rm -rf /Library/StartupItems/Disabled/Privoxy
+                                       # Remove user and group
+                                       echo Removing privoxy user and group
+                                       niutil -destroy / /groups/privoxy
+                                       niutil -destroy / /users/privoxy
+                               ;;
+                               # default
+                               *)
+                               ;;
+                       esac
+
+                       # Despite the various errors that may have been thrown, give the user a good feeling!
+                       echo
+                       echo Uninstallation complete.
+               else 
+                       echo Uninstall aborted.
+               fi
+       else
+               echo Uninstall aborted.
+       fi
+else
+       echo
+  echo This script requires administrator privileges.
+       echo "Please run it from Terminal, using an administrator account, as follows:"
+       echo
+       echo "sudo /Applications/Privoxy/uninstall.command"
+       echo
+fi
+
+exit 0
\ No newline at end of file
diff --git a/pkg content skeleton/Library/LaunchDaemons/org.ijbswa.privoxy.plist b/pkg content skeleton/Library/LaunchDaemons/org.ijbswa.privoxy.plist
new file mode 100644 (file)
index 0000000..f2af9d5
--- /dev/null
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>Label</key>
+       <string>org.ijbswa.privoxy</string>
+       <key>ProgramArguments</key>
+       <array>
+               <string>/usr/local/sbin/privoxy</string>
+               <string>--no-daemon</string>
+               <string>/usr/local/etc/privoxy/config</string>
+       </array>
+       <key>UserName</key>
+       <string>privoxy</string>
+       <key>GroupName</key>
+       <string>privoxy</string>
+       <key>StandardOutPath</key>
+       <string>/var/log/privoxy/logfile.log</string>
+       <key>StandardErrorPath</key>
+       <string>/var/log/privoxy/logfile.log</string>
+       <key>RunAtLoad</key>
+       <true/>
+</dict>
+</plist>
diff --git a/pkg content skeleton/Library/StartupItems/Privoxy/Privoxy b/pkg content skeleton/Library/StartupItems/Privoxy/Privoxy
new file mode 100755 (executable)
index 0000000..9339bc5
--- /dev/null
@@ -0,0 +1,71 @@
+#!/bin/bash
+
+# File        :  Privoxy
+#
+# Purpose     :  A startupitem launch/relaunch/terminate script
+#
+# Copyright   :  Written by and Copyright (C) 2001-2012 the
+#                Privoxy team. http://www.privoxy.org/
+#
+#                This program is free software; you can redistribute it
+#                and/or modify it under the terms of the GNU General
+#                Public License as published by the Free Software
+#                Foundation; either version 2 of the License, or (at
+#                your option) any later version.
+#
+#                This program is distributed in the hope that it will
+#                be useful, but WITHOUT ANY WARRANTY; without even the
+#                implied warranty of MERCHANTABILITY or FITNESS FOR A
+#                PARTICULAR PURPOSE.  See the GNU General Public
+#                License for more details.
+#
+#                The GNU General Public License should be included with
+#                this file.  If not, you can view it at
+#                http://www.gnu.org/copyleft/gpl.html
+#                or write to the Free Software Foundation, Inc.,
+#                51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+#                USA
+#
+# Modification : If you modify this file please consider whether your 
+#                changes ought to be passed back to the macsetup module.
+#
+
+. /etc/rc.common
+
+PRIVOXY_PATH=/usr/local/sbin
+PRIVOXY_PIDFILE=/var/run/privoxy.pid
+PRIVOXY_USER=privoxy
+PRIVOXY_CONFIG=/usr/local/etc/privoxy/config
+
+StartService ()
+{
+    if [ -x ${PRIVOXY_PATH}/privoxy ]; then
+        if ! pid=$(GetPID privoxy); then
+            echo "Starting privacy enhancing proxy"
+
+            ${PRIVOXY_PATH}/privoxy --pidfile ${PRIVOXY_PIDFILE} --user ${PRIVOXY_USER} ${PRIVOXY_CONFIG} 2>&1
+        fi
+    fi
+}
+
+StopService ()
+{
+    if pid=$(GetPID privoxy); then
+        echo "Stopping privacy enhancing proxy"
+        kill -TERM "${pid}"
+    else
+        echo "privoxy is not running."
+    fi
+}
+
+RestartService ()
+{
+    if pid=$(GetPID privoxy); then
+        echo "Restarting privacy enhancing proxy"
+        kill -HUP "${pid}"
+    else
+        StartService
+    fi
+}
+
+RunService "$1"
diff --git a/pkg content skeleton/Library/StartupItems/Privoxy/StartupParameters.plist b/pkg content skeleton/Library/StartupItems/Privoxy/StartupParameters.plist
new file mode 100644 (file)
index 0000000..b4574ac
--- /dev/null
@@ -0,0 +1,11 @@
+{
+  Description     = "Privoxy";
+  Provides        = ("Privacy enhancing proxy");
+  Requires        = ("Network", "Resolver");
+  OrderPreference = "None";
+  Messages =
+  {
+    start = "Starting Privoxy";
+    stop  = "Stopping Privoxy";
+  };
+}
diff --git a/pkg resources/interface texts/Finish Up.txt b/pkg resources/interface texts/Finish Up.txt
new file mode 100644 (file)
index 0000000..babc6c6
--- /dev/null
@@ -0,0 +1,4 @@
+Now that Privoxy is installed you must configure your web browser(s) to use it. Please refer to the readme file in 
+/Applications/Privoxy for details of how to do this (it should have just opened automatically).
+
+If you have installed Privoxy over a previous installation, your existing configuration has been preserved. The configuration files supplied with this install will have a '.new' extension and it is up to you to merge these into your existing configuration files.
\ No newline at end of file
diff --git a/pkg resources/interface texts/Introduction.txt b/pkg resources/interface texts/Introduction.txt
new file mode 100644 (file)
index 0000000..585cac4
--- /dev/null
@@ -0,0 +1,11 @@
+Privoxy is a non-caching web proxy with advanced filtering capabilities for enhancing privacy, modifying web page data and HTTP headers, controlling access, and removing ads and other obnoxious Internet junk. Privoxy has a flexible configuration and can be customized to suit individual needs and tastes. It has application for both stand-alone systems and multi-user networks.
+
+Privoxy is Free Software and licensed under the GNU GPLv2.
+
+Privoxy is an associated project of Software in the Public Interest (SPI).
+
+Helping hands and donations are welcome:
+
+  * http://www.privoxy.org/faq/general.html#PARTICIPATE
+
+  * http://www.privoxy.org/faq/general.html#DONATE
\ No newline at end of file
diff --git a/pkg resources/interface texts/LICENSE.txt b/pkg resources/interface texts/LICENSE.txt
new file mode 100644 (file)
index 0000000..d511905
--- /dev/null
@@ -0,0 +1,339 @@
+                   GNU GENERAL PUBLIC LICENSE
+                      Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                           Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                   GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+                           NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+                    END OF TERMS AND CONDITIONS
+
+           How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/pkg resources/interface texts/ReadMe.txt b/pkg resources/interface texts/ReadMe.txt
new file mode 100644 (file)
index 0000000..8875e81
--- /dev/null
@@ -0,0 +1,3 @@
+December 2011, Privoxy 3.0.19 stable is released.
+
+This is a bugfix release for version 3.0.18 and as such should be installed by all users of Privoxy. No new features are included. Please see the ChangeLog file or the "What's New in this Release" section in the User Manual for details.
\ No newline at end of file
diff --git a/pkg resources/multi-binary scripts/postinstall b/pkg resources/multi-binary scripts/postinstall
new file mode 100755 (executable)
index 0000000..2b0b370
--- /dev/null
@@ -0,0 +1,146 @@
+#!/bin/sh
+
+# File        :  postinstall
+#
+# Purpose     :  execute all tasks necessary following installation of Privoxy's files
+#
+# Copyright   :  Written by and Copyright (C) 2001-2012 the
+#                Privoxy team. http://www.privoxy.org/
+#
+#                This program is free software; you can redistribute it
+#                and/or modify it under the terms of the GNU General
+#                Public License as published by the Free Software
+#                Foundation; either version 2 of the License, or (at
+#                your option) any later version.
+#
+#                This program is distributed in the hope that it will
+#                be useful, but WITHOUT ANY WARRANTY; without even the
+#                implied warranty of MERCHANTABILITY or FITNESS FOR A
+#                PARTICULAR PURPOSE.  See the GNU General Public
+#                License for more details.
+#
+#                The GNU General Public License should be included with
+#                this file.  If not, you can view it at
+#                http://www.gnu.org/copyleft/gpl.html
+#                or write to the Free Software Foundation, Inc.,
+#                51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+#                USA
+#
+# Modification : If you modify this file please consider whether your 
+#                changes ought to be passed back to the macsetup module.
+#
+
+#  This postinstall script:
+#  1. Moves config files into place, respecting any existing user config
+#  2. Creates links to documentation in the app folder
+#  3. Detects the version of OS X on which we're installing
+#  4. Creates the logfile if not found and sets its ownership and persmissions
+#  5. Disables the startup method not necessary for the host's OS X version and start Privoxy
+#  6. Writes the package name into the uninstall script
+#  7. Opens the readme.rtf file for the user to read
+
+# preinstall created this file; continue to append to it in this script
+logfile='/var/privoxy_installation.log'
+
+#  1. Move config files into place, setting ownership and permissions, respecting any existing user config
+#
+for i in default.action default.filter match-all.action config trust user.action user.filter templates; do
+       if [ "$i" = "default.action" ] || [ "$i" = "default.filter" ] || [ "$i" = "match-all.action" ] ; then
+               # for the files a Mac user is very unlikely to have changed, overwrite existing, older versions
+               echo 'Installing config file (overwriting existing file if present):' $i >> ${logfile}
+               /bin/rm -f /usr/local/etc/privoxy/$i
+               /usr/bin/install -c -m 0664 -o privoxy -g privoxy /usr/local/etc/privoxy/vanilla/$i /usr/local/etc/privoxy || exit 1;
+       elif [ "$i" = "templates" ]; then
+               # for the templates subfolder copy across all the templates as .new if they already exist
+               for j in `ls -A /usr/local/etc/privoxy/vanilla/templates`; do
+                       if [ -s "/usr/local/etc/privoxy/templates/"$j ]; then
+                               # if the template exists in the destination then copy it in as <filename>.new
+                               echo 'Installing template file with .new extension:' $j >> ${logfile}
+                               /usr/bin/install -c -m 0664 -o privoxy -g privoxy /usr/local/etc/privoxy/vanilla/templates/$j /usr/local/etc/privoxy/templates/$j.new || exit 1
+                       else
+                               # if the template doesn't exist in the destination then just copy it across
+                               echo 'Installing template file:' $j >> ${logfile}
+                               /usr/bin/install -c -m 0664 -o privoxy -g privoxy /usr/local/etc/privoxy/vanilla/templates/$j /usr/local/etc/privoxy/templates/$j || exit 1
+                       fi
+               done
+       elif [ -s "/usr/local/etc/privoxy/"$i ]; then
+               # for all other files, if they already exist in the destination then copy them in as <filename>.new
+               echo 'Installing config file with .new extension:' $i >> ${logfile}
+               /usr/bin/install -c -m 0664 -o privoxy -g privoxy /usr/local/etc/privoxy/vanilla/$i /usr/local/etc/privoxy/$i.new || exit 1
+       else
+               # for all files that don't already exist just copy them across
+               echo 'Installing config file:' $i >> ${logfile}
+               /usr/bin/install -c -m 0664 -o privoxy -g privoxy /usr/local/etc/privoxy/vanilla/$i /usr/local/etc/privoxy || exit 1
+       fi
+done
+# delete the vanilla config files
+/bin/rm -rf /usr/local/etc/privoxy/vanilla >> ${logfile} 2>&1
+
+# 2. Create links to documentation and log file in the app folder
+#
+ln /usr/local/share/doc/privoxy/AUTHORS /Applications/Privoxy/
+ln /usr/local/share/doc/privoxy/ChangeLog /Applications/Privoxy/
+ln -s /usr/local/share/doc/privoxy/index.html /Applications/Privoxy/Privoxy\ Documentation.html
+ln /usr/local/share/doc/privoxy/LICENSE /Applications/Privoxy/
+ln -s /var/log/privoxy/logfile.log /Applications/Privoxy/logfile.log
+
+# 3. Detect the version of OS X on which we're installing
+#
+darwin_major_rel_num="`/usr/bin/uname -r | /usr/bin/sed 's/\..*//'`"
+
+# 4. Create logfile if not found and set its ownership and persmissions
+#
+if [ ! -d /var/log/privoxy ]; then
+       echo 'Creating Privoxy logfile directory' >> ${logfile}
+       /bin/mkdir -m 0755 /var/log/privoxy >> ${logfile} 2>&1
+fi
+echo 'Creating Privoxy logfile and setting owner and permissions' >> ${logfile}
+/usr/bin/touch /var/log/privoxy/logfile.log >> ${logfile} 2>&1
+/usr/sbin/chown privoxy:privoxy /var/log/privoxy/logfile.log >> ${logfile} 2>&1
+/bin/chmod 0644 /var/log/privoxy/logfile.log >> ${logfile} 2>&1
+
+# 5. Disable the startup method not necessary for the host's OS X version and start Privoxy
+#
+case "${darwin_major_rel_num}" in
+  # Mac OS X 10.7, 10.6, 10.5
+  11|10|9)
+               # disable Privoxy StartupItem
+               if [ ! -d /Library/StartupItems/Disabled ]; then
+                       echo 'Delete the Privoxy StartupItem since it is not required for this OS X version' >> ${logfile}
+                       /bin/mkdir -m 0755 /Library/StartupItems/Disabled
+               fi
+               /bin/mv -f /Library/StartupItems/Privoxy /Library/StartupItems/Disabled
+               # start Privoxy using launchd (must be run as a logged-in user, not root)
+               echo 'Start Privoxy via the LaunchDaemon' >> ${logfile}
+               /bin/launchctl load /Library/LaunchDaemons/org.ijbswa.privoxy.plist >> ${logfile} 2>&1
+  ;;
+  # Mac OS X 10.4, 10.3
+  8|7)
+               # can safely delete this since these older OS X releases do not support launchd anyway
+               echo 'Delete the Privoxy LaunchDaemon since it is not required for this OS X version' >> ${logfile}
+               /bin/rm -f /Library/LaunchDaemons/org.ijbswa.privoxy.plist
+               # start Privoxy using StartupItem
+               echo 'Start Privoxy via the StartupItem' >> ${logfile}
+               /Library/StartupItems/Privoxy/Privoxy start >> ${logfile} 2>&1
+  ;;
+  # default
+  *)
+    ;;
+esac
+
+# 6. Write the package name into the uninstall script
+#
+# strip substrings from the front and back of the script path to obtain the package identifier
+package_identifier=${0#/*p}
+package_identifier=${package_identifier#/*/}
+package_identifier=${package_identifier#S*/}
+package_identifier=${package_identifier%.*l}
+# search and replace in the uninstall script
+sed -i 's/PKGNAME/$package_identifier/g' /Applications/Privoxy/uninstall.command >> ${logfile} 2>&1
+
+# 7. Open the readme.rtf file for the user to read
+/usr/bin/su $USER -c "/usr/bin/open /Applications/Privoxy/readme.rtfd"
+
+/bin/mv ${logfile} /Applications/Privoxy/install.log
+
+exit 0
diff --git a/pkg resources/multi-binary scripts/preinstall b/pkg resources/multi-binary scripts/preinstall
new file mode 100755 (executable)
index 0000000..f613861
--- /dev/null
@@ -0,0 +1,181 @@
+#!/bin/sh
+
+# File        :  preinstall
+#
+# Purpose     :  execute all tasks necessary prior to installation of Privoxy's files
+#
+# Copyright   :  Written by and Copyright (C) 2001-2012 the
+#                Privoxy team. http://www.privoxy.org/
+#
+#                This program is free software; you can redistribute it
+#                and/or modify it under the terms of the GNU General
+#                Public License as published by the Free Software
+#                Foundation; either version 2 of the License, or (at
+#                your option) any later version.
+#
+#                This program is distributed in the hope that it will
+#                be useful, but WITHOUT ANY WARRANTY; without even the
+#                implied warranty of MERCHANTABILITY or FITNESS FOR A
+#                PARTICULAR PURPOSE.  See the GNU General Public
+#                License for more details.
+#
+#                The GNU General Public License should be included with
+#                this file.  If not, you can view it at
+#                http://www.gnu.org/copyleft/gpl.html
+#                or write to the Free Software Foundation, Inc.,
+#                51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+#                USA
+#
+# Modification : If you modify this file please consider whether your 
+#                changes ought to be passed back to the macsetup module.
+#
+
+#  This preinstall script:
+#  1. Shuts down Privoxy if it's running
+#  2. Detects the version of OS X on which we're installing
+#  3. Creates the privoxy group and user
+#  4. Backs up any existing log & configuration files
+
+# create installation log file
+logfile='/var/privoxy_installation.log'
+echo 'Privoxy installation on' `/bin/date` > ${logfile}
+
+# 1. Stop the Privoxy service if it's running
+#
+# The following will only return a value if there is a process whose name contains '/privoxy'
+# We need the / so as to exclude the scripts that'll be running during installtion
+privoxy_pid=`ps -ax | grep /privoxy | grep -v grep | awk '{ print $1 }'`
+# if privoxy_pid is a number (reroute stderr to dump "integer expression expected" error which'll be thrown if Privoxy isn't running)
+if [ "$privoxy_pid" -gt 0 ] 2>/dev/null; then
+       # try using the appropriate startup method to stop it (else it might simply restart)
+       if [ `/bin/launchctl list | /usr/bin/grep "org.ijbswa.privoxy" | /usr/bin/awk '{print $3}'` ]; then
+               echo 'Stopping Privoxy via LaunchDaemon.' >> ${logfile}
+               /bin/launchctl unload /Library/LaunchDaemons/org.ijbswa.privoxy.plist >> ${logfile} 2>&1
+               # give Privoxy a chance to shut down
+               sleep 3
+       fi
+       privoxy_pid=`ps -ax | grep privoxy | grep -v grep | awk '{ print $1 }'`
+       if [ "$privoxy_pid" -gt 0 ] 2>/dev/null; then
+               if [ -f /Library/StartupItems/Privoxy/Privoxy ]; then
+                       echo 'Stopping Privoxy via StartupItem.' >> ${logfile}
+                       /Library/StartupItems/Privoxy/Privoxy stop >> ${logfile} 2>&1
+                       # give Privoxy a chance to shut down
+                       sleep 3
+               fi
+               # If neither of the above shutdown methods (installed by a prior 'approved' installer) work,
+               # then shut down Privoxy the Unix way
+               privoxy_pid=`ps -ax | grep privoxy | grep -v grep | awk '{ print $1 }'`
+               if [ "$privoxy_pid" -gt 0 ] 2>/dev/null; then
+                       echo 'Privoxy not shutting down via OS X startup methods, doing it the Unix way.' >> ${logfile}
+                       /bin/kill -TERM "${privoxy_pid}" >> ${logfile} 2>&1
+                       # give Privoxy a chance to shut down
+                       sleep 3
+                       # if Privoxy is still running then terminate it aggressively
+                       privoxy_pid=`ps -ax | grep privoxy | grep -v grep | awk '{ print $1 }'`
+                       if [ "$privoxy_pid" -gt 0 ] 2>/dev/null; then
+                               echo 'Privoxy still not shutting down so must be hung. Killing it aggressively.' >> ${logfile}
+                               /bin/kill -KILL "${privoxy_pid}" >> ${logfile} 2>&1
+                               /bin/rm -f /var/run/privoxy.pid
+                       fi
+               fi
+       fi
+else
+       echo 'Privoxy not running.' >> ${logfile}
+fi
+
+# 2. Detect the version of OS X on which we're installing
+#
+darwin_major_rel_num="`/usr/bin/uname -r | /usr/bin/sed 's/\..*//'`"
+echo 'Darwin major release version is:' ${darwin_major_rel_num} >> ${logfile}
+
+# 3. Create the privoxy group and user (using the host-specific command to do so)
+#
+case "${darwin_major_rel_num}" in
+  # Mac OS X 10.7, 10.6, 10.5
+  11|10|9)
+    GNAME="`/usr/bin/dscl /Local/Default -list /groups | /usr/bin/grep -E '^(_)?privoxy?'`"
+    UNAME="`/usr/bin/dscl /Local/Default -list /users | /usr/bin/grep -E '^(_)?privoxy?'`"
+       # create group if it does not exist
+       if [ -z ${GNAME} ]; then
+         GID1="`/usr/bin/dscl /Local/Default -list /groups gid | /usr/bin/awk '{print $2}' | /usr/bin/sort -n | /usr/bin/tail -1`"
+         Privoxy_GID="`/bin/expr ${GID1} + 1`"
+               echo 'Creating privoxy group using dscl' >> ${logfile}
+         /usr/bin/dscl /Local/Default -create /Groups/privoxy >> ${logfile} 2>&1
+         /usr/bin/dscl /Local/Default -append /Groups/privoxy RecordName privoxy >> ${logfile} 2>&1
+         /usr/bin/dscl /Local/Default -create /Groups/privoxy Password "*" >> ${logfile} 2>&1
+         /usr/bin/dscl /Local/Default -create /Groups/privoxy PrimaryGroupID ${Privoxy_GID} >> ${logfile} 2>&1
+               /usr/bin/dscl /Local/Default -create /Groups/privoxy RealName "privoxy users" >> ${logfile} 2>&1
+       fi
+       # create user if it does not exist
+       if [ -z ${UNAME} ]; then
+         UID1="`/usr/bin/dscl /Local/Default -list /users uid | /usr/bin/awk '{print $2}' | /usr/bin/sort -n | /usr/bin/tail -1`"
+         Privoxy_UID="`/bin/expr ${UID1} + 1`"
+               echo 'Creating privoxy user using dscl' >> ${logfile}
+         /usr/bin/dscl /Local/Default -create /Users/privoxy >> ${logfile} 2>&1
+         /usr/bin/dscl /Local/Default -append /Users/privoxy RecordName privoxy >> ${logfile} 2>&1
+         /usr/bin/dscl /Local/Default -create /Users/privoxy NFSHomeDirectory /var/empty >> ${logfile} 2>&1
+         /usr/bin/dscl /Local/Default -create /Users/privoxy Password "*" >> ${logfile} 2>&1
+         /usr/bin/dscl /Local/Default -create /Users/privoxy PrimaryGroupID ${Privoxy_GID} >> ${logfile} 2>&1
+         /usr/bin/dscl /Local/Default -create /Users/privoxy RealName "privoxy server" >> ${logfile} 2>&1
+         /usr/bin/dscl /Local/Default -create /Users/privoxy UniqueID ${Privoxy_UID} >> ${logfile} 2>&1
+         /usr/bin/dscl /Local/Default -create /Users/privoxy UserShell /usr/bin/false >> ${logfile} 2>&1
+       fi
+  ;;
+  # Mac OS X 10.4, 10.3
+  8|7)
+    GNAME="`/usr/bin/nireport . /groups name | /usr/bin/grep -E '^privoxy?'`"
+    UNAME="`/usr/bin/nireport . /users name | /usr/bin/grep -E '^privoxy?'`"
+       # create group if it does not exist
+       if [ -z ${GNAME} ]; then
+         GID1="`/usr/bin/nireport . /groups gid | /usr/bin/sort -n | /usr/bin/tail -1`"
+         Privoxy_GID="`/bin/expr ${GID1} + 1`"
+               echo 'Creating privoxy group using nicl' >> ${logfile}
+         /usr/bin/nicl . -create /groups/privoxy >> ${logfile} 2>&1
+         /usr/bin/nicl . -create /groups/privoxy passwd "*" >> ${logfile} 2>&1
+         /usr/bin/nicl . -create /groups/privoxy gid ${Privoxy_GID} >> ${logfile} 2>&1
+       fi
+       # create user if it does not exist
+       if [ -z ${UNAME} ]; then
+         UID1="`/usr/bin/nireport . /users uid | /usr/bin/sort -n | /usr/bin/tail -1`"
+         Privoxy_UID="`/bin/expr ${UID1} + 1`"
+               echo 'Creating privoxy user using nicl' >> ${logfile}
+         /usr/bin/nicl . -create /users/privoxy >> ${logfile} 2>&1
+         /usr/bin/nicl . -create /users/privoxy passwd "*" >> ${logfile} 2>&1
+         /usr/bin/nicl . -create /users/privoxy uid ${Privoxy_UID} >> ${logfile} 2>&1
+         /usr/bin/nicl . -create /users/privoxy gid ${Privoxy_GID} >> ${logfile} 2>&1
+         /usr/bin/nicl . -create /users/privoxy change 0 >> ${logfile} 2>&1
+         /usr/bin/nicl . -create /users/privoxy expire 0 >> ${logfile} 2>&1
+         /usr/bin/nicl . -create /users/privoxy realname "Privoxy Web Proxy" >> ${logfile} 2>&1
+         /usr/bin/nicl . -create /users/privoxy home /var/empty >> ${logfile} 2>&1
+         /usr/bin/nicl . -create /users/privoxy shell /usr/bin/false >> ${logfile} 2>&1
+         /usr/bin/nicl . -create /users/privoxy _shadow_passwd "" >> ${logfile} 2>&1
+       fi
+  ;;
+  # default
+  *)
+    GNAME=""
+    UNAME=""
+    ;;
+esac
+
+# 4. Back up any existing log & configuration files
+#
+if [ -f /var/log/privoxy/logfile.log ]; then
+       echo 'Backing up existing logfile' >> ${logfile}
+  /bin/cp /var/log/privoxy/logfile.log /var/log/privoxy/logfile.old >> ${logfile} 2>&1
+       /usr/sbin/chown privoxy:privoxy /var/log/privoxy/logfile.old >> ${logfile} 2>&1
+fi
+if [ -d /usr/local/etc/privoxy ]; then
+       for i in config match-all.action trust user.action user.filter; do
+               echo 'Backing up existing config file:' ${i} >> ${logfile}
+               if [ -f /usr/local/etc/privoxy/$i ]; then
+                       /bin/cp /usr/local/etc/privoxy/$i /usr/local/etc/privoxy/$i.old >> ${logfile} 2>&1
+                       /usr/sbin/chown privoxy:privoxy /usr/local/etc/privoxy/$i.old >> ${logfile} 2>&1
+               fi
+       done
+       echo 'Backing up existing config templates' >> ${logfile}
+       /bin/cp -R /usr/local/etc/privoxy/templates /usr/local/etc/privoxy/templates.old >> ${logfile} 2>&1
+       /usr/sbin/chown -R privoxy:privoxy /usr/local/etc/privoxy/templates.old >> ${logfile} 2>&1
+fi
+
+exit 0
diff --git a/pkg resources/multi-binary scripts/readme b/pkg resources/multi-binary scripts/readme
new file mode 100644 (file)
index 0000000..7938b28
--- /dev/null
@@ -0,0 +1,35 @@
+# File        :  readme
+#
+# Purpose     :  Explain the content of the multi-binary scripts folder
+#
+# Copyright   :  Written by and Copyright (C) 2001-2012 the
+#                Privoxy team. http://www.privoxy.org/
+#
+#                This program is free software; you can redistribute it
+#                and/or modify it under the terms of the GNU General
+#                Public License as published by the Free Software
+#                Foundation; either version 2 of the License, or (at
+#                your option) any later version.
+#
+#                This program is distributed in the hope that it will
+#                be useful, but WITHOUT ANY WARRANTY; without even the
+#                implied warranty of MERCHANTABILITY or FITNESS FOR A
+#                PARTICULAR PURPOSE.  See the GNU General Public
+#                License for more details.
+#
+#                The GNU General Public License should be included with
+#                this file.  If not, you can view it at
+#                http://www.gnu.org/copyleft/gpl.html
+#                or write to the Free Software Foundation, Inc.,
+#                51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+#                USA
+#
+# Modification : If you modify this file please consider whether your 
+#                changes ought to be passed back to the macsetup module.
+#
+
+These multi-binary pre/postinstall scripts are unfinished, and indeed now lack features present in the single-binary versions since development focussed there after the fork.
+
+The intent was to compile multiple single-architecture binaries targeting each OS X release then detect the target OS X version and processor architecture at install time, copying into place only the one necessary binary. The benefit of this approach would be one single installer package for ALL OS X versions and reduced cruft on the target machine.
+
+They are left in the project as the basis for potential future development, but would need to have only their unique parts merged into the latest version of the single-binary scripts.
\ No newline at end of file
diff --git a/pkg resources/single-binary scripts/postinstall b/pkg resources/single-binary scripts/postinstall
new file mode 100755 (executable)
index 0000000..91e2cdd
--- /dev/null
@@ -0,0 +1,142 @@
+#!/bin/sh
+
+# File        :  postinstall
+#
+# Purpose     :  execute all tasks necessary following installation of 
+#                Privoxy's files
+#
+# Copyright   :  Written by and Copyright (C) 2001-2012 the
+#                Privoxy team. http://www.privoxy.org/
+#
+#                This program is free software; you can redistribute it
+#                and/or modify it under the terms of the GNU General
+#                Public License as published by the Free Software
+#                Foundation; either version 2 of the License, or (at
+#                your option) any later version.
+#
+#                This program is distributed in the hope that it will
+#                be useful, but WITHOUT ANY WARRANTY; without even the
+#                implied warranty of MERCHANTABILITY or FITNESS FOR A
+#                PARTICULAR PURPOSE.  See the GNU General Public
+#                License for more details.
+#
+#                The GNU General Public License should be included with
+#                this file.  If not, you can view it at
+#                http://www.gnu.org/copyleft/gpl.html
+#                or write to the Free Software Foundation, Inc.,
+#                51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+#                USA
+#
+# Modification : If you modify this file please consider whether your 
+#                changes ought to be passed back to the macsetup module.
+#
+
+#  This postinstall script:
+#
+#  1. Moves config files into place, respecting any existing user config
+#  2. Creates links to documentation in the app folder
+#  3. Detects the version of OS X on which we're installing
+#  4. Creates the logfile if not found and sets its ownership and persmissions
+#  5. Disables the startup method not necessary for the host's OS X version and start Privoxy
+#  6. Writes the package name into the uninstall script
+#  7. Opens the readme.rtf file for the user to read
+
+# preinstall created this file; continue to append to it in this script
+logfile='/var/privoxy_installation.log'
+
+#  1. Move config files into place, setting ownership and permissions, respecting any existing user config
+#
+for i in default.action default.filter match-all.action config trust user.action user.filter templates; do
+       if [ "$i" = "default.action" ] || [ "$i" = "default.filter" ] || [ "$i" = "match-all.action" ] ; then
+               # for the files a Mac user is very unlikely to have changed, overwrite existing, older versions
+               echo 'Installing config file (overwriting existing file if present):' $i >> ${logfile}
+               /bin/rm -f /usr/local/etc/privoxy/$i
+               /usr/bin/install -c -m 0664 -o privoxy -g privoxy /usr/local/etc/privoxy/vanilla/$i /usr/local/etc/privoxy || exit 1;
+       elif [ "$i" = "templates" ]; then
+               # for the templates subfolder copy across all the templates as .new if they already exist
+               for j in `ls -A /usr/local/etc/privoxy/vanilla/templates`; do
+                       if [ -s "/usr/local/etc/privoxy/templates/"$j ]; then
+                               # if the template exists in the destination then copy it in as <filename>.new
+                               echo 'Installing template file with .new extension:' $j >> ${logfile}
+                               /usr/bin/install -c -m 0664 -o privoxy -g privoxy /usr/local/etc/privoxy/vanilla/templates/$j /usr/local/etc/privoxy/templates/$j.new || exit 1
+                       else
+                               # if the template doesn't exist in the destination then just copy it across
+                               echo 'Installing template file:' $j >> ${logfile}
+                               /usr/bin/install -c -m 0664 -o privoxy -g privoxy /usr/local/etc/privoxy/vanilla/templates/$j /usr/local/etc/privoxy/templates/$j || exit 1
+                       fi
+               done
+       elif [ -s "/usr/local/etc/privoxy/"$i ]; then
+               # for all other files, if they already exist in the destination then copy them in as <filename>.new
+               echo 'Installing config file with .new extension:' $i >> ${logfile}
+               /usr/bin/install -c -m 0664 -o privoxy -g privoxy /usr/local/etc/privoxy/vanilla/$i /usr/local/etc/privoxy/$i.new || exit 1
+       else
+               # for all files that don't already exist just copy them across
+               echo 'Installing config file:' $i >> ${logfile}
+               /usr/bin/install -c -m 0664 -o privoxy -g privoxy /usr/local/etc/privoxy/vanilla/$i /usr/local/etc/privoxy || exit 1
+       fi
+done
+# delete the vanilla config files
+/bin/rm -rf /usr/local/etc/privoxy/vanilla >> ${logfile} 2>&1
+
+# 2. Create links to documentation and log file in the app folder
+#
+ln /usr/local/share/doc/privoxy/AUTHORS /Applications/Privoxy/
+ln /usr/local/share/doc/privoxy/ChangeLog /Applications/Privoxy/
+ln -s /usr/local/share/doc/privoxy/privoxy-index.html /Applications/Privoxy/Privoxy\ Documentation.html
+ln /usr/local/share/doc/privoxy/LICENSE /Applications/Privoxy/
+ln -s /var/log/privoxy/logfile.log /Applications/Privoxy/logfile.log
+
+# 3. Detect the version of OS X on which we're installing
+#
+darwin_major_rel_num="`/usr/bin/uname -r | /usr/bin/sed 's/\..*//'`"
+
+# 4. Create logfile if not found and set its ownership and persmissions
+#
+if [ ! -d /var/log/privoxy ]; then
+       echo 'Creating Privoxy logfile directory' >> ${logfile}
+       /bin/mkdir -m 0755 /var/log/privoxy >> ${logfile} 2>&1
+fi
+echo 'Creating Privoxy logfile and setting owner and permissions' >> ${logfile}
+/usr/bin/touch /var/log/privoxy/logfile.log >> ${logfile} 2>&1
+/usr/sbin/chown privoxy:privoxy /var/log/privoxy/logfile.log >> ${logfile} 2>&1
+/bin/chmod 0644 /var/log/privoxy/logfile.log >> ${logfile} 2>&1
+
+# 5. Disable the startup method not necessary for the host's OS X version and start Privoxy
+#
+case "${darwin_major_rel_num}" in
+  # Mac OS X 10.7, 10.6, 10.5
+  11|10|9)
+               # delete Privoxy StartupItem
+               echo 'Delete the Privoxy StartupItem since it is not required for this OS X version' >> ${logfile}
+               if [ -d /Library/StartupItems/Disabled/Privoxy ]; then
+                       /bin/rm -rf /Library/StartupItems/Disabled/Privoxy >> ${logfile} 2>&1
+               fi
+               /bin/rm -rf /Library/StartupItems/Privoxy >> ${logfile} 2>&1
+               # start Privoxy using launchd
+               echo 'Start Privoxy via the LaunchDaemon' >> ${logfile}
+               /bin/launchctl load /Library/LaunchDaemons/org.ijbswa.privoxy.plist >> ${logfile} 2>&1
+  ;;
+  # Mac OS X 10.4, 10.3
+  8|7)
+               # can safely delete this since these older OS X releases do not support launchd anyway
+               echo 'Delete the Privoxy LaunchDaemon since it is not required for this OS X version' >> ${logfile}
+               /bin/rm -f /Library/LaunchDaemons/org.ijbswa.privoxy.plist
+               # start Privoxy using StartupItem
+               echo 'Start Privoxy via the StartupItem' >> ${logfile}
+               /Library/StartupItems/Privoxy/Privoxy start >> ${logfile} 2>&1
+  ;;
+  # default
+  *)
+    ;;
+esac
+
+# 6. Write the package name into the uninstall script
+#
+#TODO
+
+# 7. Open the readme.rtf file for the user to read
+/usr/bin/su $USER -c "/usr/bin/open /Applications/Privoxy/readme.rtfd"
+
+/bin/mv ${logfile} /Applications/Privoxy/install.log
+
+exit 0
diff --git a/pkg resources/single-binary scripts/postupgrade b/pkg resources/single-binary scripts/postupgrade
new file mode 100755 (executable)
index 0000000..91e2cdd
--- /dev/null
@@ -0,0 +1,142 @@
+#!/bin/sh
+
+# File        :  postinstall
+#
+# Purpose     :  execute all tasks necessary following installation of 
+#                Privoxy's files
+#
+# Copyright   :  Written by and Copyright (C) 2001-2012 the
+#                Privoxy team. http://www.privoxy.org/
+#
+#                This program is free software; you can redistribute it
+#                and/or modify it under the terms of the GNU General
+#                Public License as published by the Free Software
+#                Foundation; either version 2 of the License, or (at
+#                your option) any later version.
+#
+#                This program is distributed in the hope that it will
+#                be useful, but WITHOUT ANY WARRANTY; without even the
+#                implied warranty of MERCHANTABILITY or FITNESS FOR A
+#                PARTICULAR PURPOSE.  See the GNU General Public
+#                License for more details.
+#
+#                The GNU General Public License should be included with
+#                this file.  If not, you can view it at
+#                http://www.gnu.org/copyleft/gpl.html
+#                or write to the Free Software Foundation, Inc.,
+#                51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+#                USA
+#
+# Modification : If you modify this file please consider whether your 
+#                changes ought to be passed back to the macsetup module.
+#
+
+#  This postinstall script:
+#
+#  1. Moves config files into place, respecting any existing user config
+#  2. Creates links to documentation in the app folder
+#  3. Detects the version of OS X on which we're installing
+#  4. Creates the logfile if not found and sets its ownership and persmissions
+#  5. Disables the startup method not necessary for the host's OS X version and start Privoxy
+#  6. Writes the package name into the uninstall script
+#  7. Opens the readme.rtf file for the user to read
+
+# preinstall created this file; continue to append to it in this script
+logfile='/var/privoxy_installation.log'
+
+#  1. Move config files into place, setting ownership and permissions, respecting any existing user config
+#
+for i in default.action default.filter match-all.action config trust user.action user.filter templates; do
+       if [ "$i" = "default.action" ] || [ "$i" = "default.filter" ] || [ "$i" = "match-all.action" ] ; then
+               # for the files a Mac user is very unlikely to have changed, overwrite existing, older versions
+               echo 'Installing config file (overwriting existing file if present):' $i >> ${logfile}
+               /bin/rm -f /usr/local/etc/privoxy/$i
+               /usr/bin/install -c -m 0664 -o privoxy -g privoxy /usr/local/etc/privoxy/vanilla/$i /usr/local/etc/privoxy || exit 1;
+       elif [ "$i" = "templates" ]; then
+               # for the templates subfolder copy across all the templates as .new if they already exist
+               for j in `ls -A /usr/local/etc/privoxy/vanilla/templates`; do
+                       if [ -s "/usr/local/etc/privoxy/templates/"$j ]; then
+                               # if the template exists in the destination then copy it in as <filename>.new
+                               echo 'Installing template file with .new extension:' $j >> ${logfile}
+                               /usr/bin/install -c -m 0664 -o privoxy -g privoxy /usr/local/etc/privoxy/vanilla/templates/$j /usr/local/etc/privoxy/templates/$j.new || exit 1
+                       else
+                               # if the template doesn't exist in the destination then just copy it across
+                               echo 'Installing template file:' $j >> ${logfile}
+                               /usr/bin/install -c -m 0664 -o privoxy -g privoxy /usr/local/etc/privoxy/vanilla/templates/$j /usr/local/etc/privoxy/templates/$j || exit 1
+                       fi
+               done
+       elif [ -s "/usr/local/etc/privoxy/"$i ]; then
+               # for all other files, if they already exist in the destination then copy them in as <filename>.new
+               echo 'Installing config file with .new extension:' $i >> ${logfile}
+               /usr/bin/install -c -m 0664 -o privoxy -g privoxy /usr/local/etc/privoxy/vanilla/$i /usr/local/etc/privoxy/$i.new || exit 1
+       else
+               # for all files that don't already exist just copy them across
+               echo 'Installing config file:' $i >> ${logfile}
+               /usr/bin/install -c -m 0664 -o privoxy -g privoxy /usr/local/etc/privoxy/vanilla/$i /usr/local/etc/privoxy || exit 1
+       fi
+done
+# delete the vanilla config files
+/bin/rm -rf /usr/local/etc/privoxy/vanilla >> ${logfile} 2>&1
+
+# 2. Create links to documentation and log file in the app folder
+#
+ln /usr/local/share/doc/privoxy/AUTHORS /Applications/Privoxy/
+ln /usr/local/share/doc/privoxy/ChangeLog /Applications/Privoxy/
+ln -s /usr/local/share/doc/privoxy/privoxy-index.html /Applications/Privoxy/Privoxy\ Documentation.html
+ln /usr/local/share/doc/privoxy/LICENSE /Applications/Privoxy/
+ln -s /var/log/privoxy/logfile.log /Applications/Privoxy/logfile.log
+
+# 3. Detect the version of OS X on which we're installing
+#
+darwin_major_rel_num="`/usr/bin/uname -r | /usr/bin/sed 's/\..*//'`"
+
+# 4. Create logfile if not found and set its ownership and persmissions
+#
+if [ ! -d /var/log/privoxy ]; then
+       echo 'Creating Privoxy logfile directory' >> ${logfile}
+       /bin/mkdir -m 0755 /var/log/privoxy >> ${logfile} 2>&1
+fi
+echo 'Creating Privoxy logfile and setting owner and permissions' >> ${logfile}
+/usr/bin/touch /var/log/privoxy/logfile.log >> ${logfile} 2>&1
+/usr/sbin/chown privoxy:privoxy /var/log/privoxy/logfile.log >> ${logfile} 2>&1
+/bin/chmod 0644 /var/log/privoxy/logfile.log >> ${logfile} 2>&1
+
+# 5. Disable the startup method not necessary for the host's OS X version and start Privoxy
+#
+case "${darwin_major_rel_num}" in
+  # Mac OS X 10.7, 10.6, 10.5
+  11|10|9)
+               # delete Privoxy StartupItem
+               echo 'Delete the Privoxy StartupItem since it is not required for this OS X version' >> ${logfile}
+               if [ -d /Library/StartupItems/Disabled/Privoxy ]; then
+                       /bin/rm -rf /Library/StartupItems/Disabled/Privoxy >> ${logfile} 2>&1
+               fi
+               /bin/rm -rf /Library/StartupItems/Privoxy >> ${logfile} 2>&1
+               # start Privoxy using launchd
+               echo 'Start Privoxy via the LaunchDaemon' >> ${logfile}
+               /bin/launchctl load /Library/LaunchDaemons/org.ijbswa.privoxy.plist >> ${logfile} 2>&1
+  ;;
+  # Mac OS X 10.4, 10.3
+  8|7)
+               # can safely delete this since these older OS X releases do not support launchd anyway
+               echo 'Delete the Privoxy LaunchDaemon since it is not required for this OS X version' >> ${logfile}
+               /bin/rm -f /Library/LaunchDaemons/org.ijbswa.privoxy.plist
+               # start Privoxy using StartupItem
+               echo 'Start Privoxy via the StartupItem' >> ${logfile}
+               /Library/StartupItems/Privoxy/Privoxy start >> ${logfile} 2>&1
+  ;;
+  # default
+  *)
+    ;;
+esac
+
+# 6. Write the package name into the uninstall script
+#
+#TODO
+
+# 7. Open the readme.rtf file for the user to read
+/usr/bin/su $USER -c "/usr/bin/open /Applications/Privoxy/readme.rtfd"
+
+/bin/mv ${logfile} /Applications/Privoxy/install.log
+
+exit 0
diff --git a/pkg resources/single-binary scripts/preinstall b/pkg resources/single-binary scripts/preinstall
new file mode 100755 (executable)
index 0000000..953a45c
--- /dev/null
@@ -0,0 +1,181 @@
+#!/bin/sh
+
+# File        :  preinstall
+#
+# Purpose     :  execute all tasks necessary prior to installation of Privoxy's files
+#
+# Copyright   :  Written by and Copyright (C) 2001-2012 the
+#                Privoxy team. http://www.privoxy.org/
+#
+#                This program is free software; you can redistribute it
+#                and/or modify it under the terms of the GNU General
+#                Public License as published by the Free Software
+#                Foundation; either version 2 of the License, or (at
+#                your option) any later version.
+#
+#                This program is distributed in the hope that it will
+#                be useful, but WITHOUT ANY WARRANTY; without even the
+#                implied warranty of MERCHANTABILITY or FITNESS FOR A
+#                PARTICULAR PURPOSE.  See the GNU General Public
+#                License for more details.
+#
+#                The GNU General Public License should be included with
+#                this file.  If not, you can view it at
+#                http://www.gnu.org/copyleft/gpl.html
+#                or write to the Free Software Foundation, Inc.,
+#                51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+#                USA
+#
+# Modification : If you modify this file please consider whether your 
+#                changes ought to be passed back to the macsetup module.
+#
+
+#  This preinstall script:
+#  1. Shuts down Privoxy if it's running
+#  2. Detects the version of OS X on which we're installing
+#  3. Creates the privoxy group and user
+#  4. Backs up any existing log & configuration files
+
+# create installation log file
+logfile='/var/privoxy_installation.log'
+echo 'Privoxy installation on' `/bin/date` > ${logfile}
+
+# 1. Stop the Privoxy service if it's running
+#
+# The following will only return a value if there is a process whose name contains '/privoxy'
+# We need the / so as to exclude the scripts that'll be running during installtion
+privoxy_pid=`ps -ax | grep /privoxy | grep -v grep | awk '{ print $1 }'`
+# if privoxy_pid is a number (reroute stderr to dump "integer expression expected" error which'll be thrown if Privoxy isn't running)
+if [ "$privoxy_pid" -gt 0 ] 2>/dev/null; then
+       # try using the appropriate startup method to stop it (else it might simply restart)
+       if [ `/bin/launchctl list | /usr/bin/grep "org.ijbswa.privoxy" | /usr/bin/awk '{print $3}'` ]; then
+               echo 'Stopping Privoxy via LaunchDaemon.' >> ${logfile}
+               /bin/launchctl unload /Library/LaunchDaemons/org.ijbswa.privoxy.plist >> ${logfile} 2>&1
+               # give Privoxy a chance to shut down
+               sleep 3
+       fi
+       privoxy_pid=`ps -ax | grep privoxy | grep -v grep | awk '{ print $1 }'`
+       if [ "$privoxy_pid" -gt 0 ] 2>/dev/null; then
+               if [ -f /Library/StartupItems/Privoxy/Privoxy ]; then
+                       echo 'Stopping Privoxy via StartupItem.' >> ${logfile}
+                       /Library/StartupItems/Privoxy/Privoxy stop >> ${logfile} 2>&1
+                       # give Privoxy a chance to shut down
+                       sleep 3
+               fi
+               # If neither of the above shutdown methods (installed by a prior 'approved' installer) work,
+               # then shut down Privoxy the Unix way
+               privoxy_pid=`ps -ax | grep privoxy | grep -v grep | awk '{ print $1 }'`
+               if [ "$privoxy_pid" -gt 0 ] 2>/dev/null; then
+                       echo 'Privoxy not shutting down via OS X startup methods, doing it the Unix way.' >> ${logfile}
+                       /bin/kill -TERM "${privoxy_pid}" >> ${logfile} 2>&1
+                       # give Privoxy a chance to shut down
+                       sleep 3
+                       # if Privoxy is still running then terminate it aggressively
+                       privoxy_pid=`ps -ax | grep privoxy | grep -v grep | awk '{ print $1 }'`
+                       if [ "$privoxy_pid" -gt 0 ] 2>/dev/null; then
+                               echo 'Privoxy still not shutting down so must be hung. Killing it aggressively.' >> ${logfile}
+                               /bin/kill -KILL "${privoxy_pid}" >> ${logfile} 2>&1
+                               /bin/rm -f /var/run/privoxy.pid
+                       fi
+               fi
+       fi
+else
+       echo 'Privoxy not running.' >> ${logfile}
+fi
+
+# 2. Detect the version of OS X on which we're installing
+#
+darwin_major_rel_num="`/usr/bin/uname -r | /usr/bin/sed 's/\..*//'`"
+echo 'Darwin major release version is:' ${darwin_major_rel_num} >> ${logfile}
+
+# 3. Create the privoxy group and user (using the host-specific command to do so)
+#
+case "${darwin_major_rel_num}" in
+  # Mac OS X 10.7, 10.6, 10.5
+  11|10|9)
+    GNAME="`/usr/bin/dscl /Local/Default -list /groups | /usr/bin/grep -E '^(_)?privoxy?'`"
+    UNAME="`/usr/bin/dscl /Local/Default -list /users | /usr/bin/grep -E '^(_)?privoxy?'`"
+       # create group if it does not exist
+       if [ -z ${GNAME} ]; then
+         GID1="`/usr/bin/dscl /Local/Default -list /groups gid | /usr/bin/awk '{print $2}' | /usr/bin/sort -n | /usr/bin/tail -1`"
+         Privoxy_GID="`/bin/expr ${GID1} + 1`"
+               echo 'Creating privoxy group using dscl' >> ${logfile}
+         /usr/bin/dscl /Local/Default -create /Groups/_privoxy >> ${logfile} 2>&1
+         /usr/bin/dscl /Local/Default -append /Groups/_privoxy RecordName privoxy >> ${logfile} 2>&1
+         /usr/bin/dscl /Local/Default -create /Groups/_privoxy Password "*" >> ${logfile} 2>&1
+         /usr/bin/dscl /Local/Default -create /Groups/_privoxy PrimaryGroupID ${Privoxy_GID} >> ${logfile} 2>&1
+               /usr/bin/dscl /Local/Default -create /Groups/_privoxy RealName "privoxy users" >> ${logfile} 2>&1
+       fi
+       # create user if it does not exist
+       if [ -z ${UNAME} ]; then
+         UID1="`/usr/bin/dscl /Local/Default -list /users uid | /usr/bin/awk '{print $2}' | /usr/bin/sort -n | /usr/bin/tail -1`"
+         Privoxy_UID="`/bin/expr ${UID1} + 1`"
+               echo 'Creating privoxy user using dscl' >> ${logfile}
+         /usr/bin/dscl /Local/Default -create /Users/_privoxy >> ${logfile} 2>&1
+         /usr/bin/dscl /Local/Default -append /Users/_privoxy RecordName privoxy >> ${logfile} 2>&1
+         /usr/bin/dscl /Local/Default -create /Users/_privoxy NFSHomeDirectory /var/empty >> ${logfile} 2>&1
+         /usr/bin/dscl /Local/Default -create /Users/_privoxy Password "*" >> ${logfile} 2>&1
+         /usr/bin/dscl /Local/Default -create /Users/_privoxy PrimaryGroupID ${Privoxy_GID} >> ${logfile} 2>&1
+         /usr/bin/dscl /Local/Default -create /Users/_privoxy RealName "privoxy server" >> ${logfile} 2>&1
+         /usr/bin/dscl /Local/Default -create /Users/_privoxy UniqueID ${Privoxy_UID} >> ${logfile} 2>&1
+         /usr/bin/dscl /Local/Default -create /Users/_privoxy UserShell /usr/bin/false >> ${logfile} 2>&1
+       fi
+  ;;
+  # Mac OS X 10.4, 10.3
+  8|7)
+    GNAME="`/usr/bin/nireport . /groups name | /usr/bin/grep -E '^privoxy?'`"
+    UNAME="`/usr/bin/nireport . /users name | /usr/bin/grep -E '^privoxy?'`"
+       # create group if it does not exist
+       if [ -z ${GNAME} ]; then
+         GID1="`/usr/bin/nireport . /groups gid | /usr/bin/sort -n | /usr/bin/tail -1`"
+         Privoxy_GID="`/bin/expr ${GID1} + 1`"
+               echo 'Creating privoxy group using nicl' >> ${logfile}
+         /usr/bin/nicl . -create /groups/privoxy >> ${logfile} 2>&1
+         /usr/bin/nicl . -create /groups/privoxy passwd "*" >> ${logfile} 2>&1
+         /usr/bin/nicl . -create /groups/privoxy gid ${Privoxy_GID} >> ${logfile} 2>&1
+       fi
+       # create user if it does not exist
+       if [ -z ${UNAME} ]; then
+         UID1="`/usr/bin/nireport . /users uid | /usr/bin/sort -n | /usr/bin/tail -1`"
+         Privoxy_UID="`/bin/expr ${UID1} + 1`"
+               echo 'Creating privoxy user using nicl' >> ${logfile}
+         /usr/bin/nicl . -create /users/privoxy >> ${logfile} 2>&1
+         /usr/bin/nicl . -create /users/privoxy passwd "*" >> ${logfile} 2>&1
+         /usr/bin/nicl . -create /users/privoxy uid ${Privoxy_UID} >> ${logfile} 2>&1
+         /usr/bin/nicl . -create /users/privoxy gid ${Privoxy_GID} >> ${logfile} 2>&1
+         /usr/bin/nicl . -create /users/privoxy change 0 >> ${logfile} 2>&1
+         /usr/bin/nicl . -create /users/privoxy expire 0 >> ${logfile} 2>&1
+         /usr/bin/nicl . -create /users/privoxy realname "Privoxy Web Proxy" >> ${logfile} 2>&1
+         /usr/bin/nicl . -create /users/privoxy home /var/empty >> ${logfile} 2>&1
+         /usr/bin/nicl . -create /users/privoxy shell /usr/bin/false >> ${logfile} 2>&1
+         /usr/bin/nicl . -create /users/privoxy _shadow_passwd "" >> ${logfile} 2>&1
+       fi
+  ;;
+  # default
+  *)
+    GNAME=""
+    UNAME=""
+    ;;
+esac
+
+# 4. Back up any existing log & configuration files
+#
+if [ -f /var/log/privoxy/logfile.log ]; then
+       echo 'Backing up existing logfile' >> ${logfile}
+  /bin/cp /var/log/privoxy/logfile.log /var/log/privoxy/logfile.old >> ${logfile} 2>&1
+       /usr/sbin/chown privoxy:privoxy /var/log/privoxy/logfile.old >> ${logfile} 2>&1
+fi
+if [ -d /usr/local/etc/privoxy ]; then
+       for i in config match-all.action trust user.action user.filter; do
+               echo 'Backing up existing config file:' ${i} >> ${logfile}
+               if [ -f /usr/local/etc/privoxy/$i ]; then
+                       /bin/cp /usr/local/etc/privoxy/$i /usr/local/etc/privoxy/$i.old >> ${logfile} 2>&1
+                       /usr/sbin/chown privoxy:privoxy /usr/local/etc/privoxy/$i.old >> ${logfile} 2>&1
+               fi
+       done
+       echo 'Backing up existing config templates' >> ${logfile}
+       /bin/cp -R /usr/local/etc/privoxy/templates /usr/local/etc/privoxy/templates.old >> ${logfile} 2>&1
+       /usr/sbin/chown -R privoxy:privoxy /usr/local/etc/privoxy/templates.old >> ${logfile} 2>&1
+fi
+
+exit 0
diff --git a/pkg resources/single-binary scripts/preupgrade b/pkg resources/single-binary scripts/preupgrade
new file mode 100755 (executable)
index 0000000..953a45c
--- /dev/null
@@ -0,0 +1,181 @@
+#!/bin/sh
+
+# File        :  preinstall
+#
+# Purpose     :  execute all tasks necessary prior to installation of Privoxy's files
+#
+# Copyright   :  Written by and Copyright (C) 2001-2012 the
+#                Privoxy team. http://www.privoxy.org/
+#
+#                This program is free software; you can redistribute it
+#                and/or modify it under the terms of the GNU General
+#                Public License as published by the Free Software
+#                Foundation; either version 2 of the License, or (at
+#                your option) any later version.
+#
+#                This program is distributed in the hope that it will
+#                be useful, but WITHOUT ANY WARRANTY; without even the
+#                implied warranty of MERCHANTABILITY or FITNESS FOR A
+#                PARTICULAR PURPOSE.  See the GNU General Public
+#                License for more details.
+#
+#                The GNU General Public License should be included with
+#                this file.  If not, you can view it at
+#                http://www.gnu.org/copyleft/gpl.html
+#                or write to the Free Software Foundation, Inc.,
+#                51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+#                USA
+#
+# Modification : If you modify this file please consider whether your 
+#                changes ought to be passed back to the macsetup module.
+#
+
+#  This preinstall script:
+#  1. Shuts down Privoxy if it's running
+#  2. Detects the version of OS X on which we're installing
+#  3. Creates the privoxy group and user
+#  4. Backs up any existing log & configuration files
+
+# create installation log file
+logfile='/var/privoxy_installation.log'
+echo 'Privoxy installation on' `/bin/date` > ${logfile}
+
+# 1. Stop the Privoxy service if it's running
+#
+# The following will only return a value if there is a process whose name contains '/privoxy'
+# We need the / so as to exclude the scripts that'll be running during installtion
+privoxy_pid=`ps -ax | grep /privoxy | grep -v grep | awk '{ print $1 }'`
+# if privoxy_pid is a number (reroute stderr to dump "integer expression expected" error which'll be thrown if Privoxy isn't running)
+if [ "$privoxy_pid" -gt 0 ] 2>/dev/null; then
+       # try using the appropriate startup method to stop it (else it might simply restart)
+       if [ `/bin/launchctl list | /usr/bin/grep "org.ijbswa.privoxy" | /usr/bin/awk '{print $3}'` ]; then
+               echo 'Stopping Privoxy via LaunchDaemon.' >> ${logfile}
+               /bin/launchctl unload /Library/LaunchDaemons/org.ijbswa.privoxy.plist >> ${logfile} 2>&1
+               # give Privoxy a chance to shut down
+               sleep 3
+       fi
+       privoxy_pid=`ps -ax | grep privoxy | grep -v grep | awk '{ print $1 }'`
+       if [ "$privoxy_pid" -gt 0 ] 2>/dev/null; then
+               if [ -f /Library/StartupItems/Privoxy/Privoxy ]; then
+                       echo 'Stopping Privoxy via StartupItem.' >> ${logfile}
+                       /Library/StartupItems/Privoxy/Privoxy stop >> ${logfile} 2>&1
+                       # give Privoxy a chance to shut down
+                       sleep 3
+               fi
+               # If neither of the above shutdown methods (installed by a prior 'approved' installer) work,
+               # then shut down Privoxy the Unix way
+               privoxy_pid=`ps -ax | grep privoxy | grep -v grep | awk '{ print $1 }'`
+               if [ "$privoxy_pid" -gt 0 ] 2>/dev/null; then
+                       echo 'Privoxy not shutting down via OS X startup methods, doing it the Unix way.' >> ${logfile}
+                       /bin/kill -TERM "${privoxy_pid}" >> ${logfile} 2>&1
+                       # give Privoxy a chance to shut down
+                       sleep 3
+                       # if Privoxy is still running then terminate it aggressively
+                       privoxy_pid=`ps -ax | grep privoxy | grep -v grep | awk '{ print $1 }'`
+                       if [ "$privoxy_pid" -gt 0 ] 2>/dev/null; then
+                               echo 'Privoxy still not shutting down so must be hung. Killing it aggressively.' >> ${logfile}
+                               /bin/kill -KILL "${privoxy_pid}" >> ${logfile} 2>&1
+                               /bin/rm -f /var/run/privoxy.pid
+                       fi
+               fi
+       fi
+else
+       echo 'Privoxy not running.' >> ${logfile}
+fi
+
+# 2. Detect the version of OS X on which we're installing
+#
+darwin_major_rel_num="`/usr/bin/uname -r | /usr/bin/sed 's/\..*//'`"
+echo 'Darwin major release version is:' ${darwin_major_rel_num} >> ${logfile}
+
+# 3. Create the privoxy group and user (using the host-specific command to do so)
+#
+case "${darwin_major_rel_num}" in
+  # Mac OS X 10.7, 10.6, 10.5
+  11|10|9)
+    GNAME="`/usr/bin/dscl /Local/Default -list /groups | /usr/bin/grep -E '^(_)?privoxy?'`"
+    UNAME="`/usr/bin/dscl /Local/Default -list /users | /usr/bin/grep -E '^(_)?privoxy?'`"
+       # create group if it does not exist
+       if [ -z ${GNAME} ]; then
+         GID1="`/usr/bin/dscl /Local/Default -list /groups gid | /usr/bin/awk '{print $2}' | /usr/bin/sort -n | /usr/bin/tail -1`"
+         Privoxy_GID="`/bin/expr ${GID1} + 1`"
+               echo 'Creating privoxy group using dscl' >> ${logfile}
+         /usr/bin/dscl /Local/Default -create /Groups/_privoxy >> ${logfile} 2>&1
+         /usr/bin/dscl /Local/Default -append /Groups/_privoxy RecordName privoxy >> ${logfile} 2>&1
+         /usr/bin/dscl /Local/Default -create /Groups/_privoxy Password "*" >> ${logfile} 2>&1
+         /usr/bin/dscl /Local/Default -create /Groups/_privoxy PrimaryGroupID ${Privoxy_GID} >> ${logfile} 2>&1
+               /usr/bin/dscl /Local/Default -create /Groups/_privoxy RealName "privoxy users" >> ${logfile} 2>&1
+       fi
+       # create user if it does not exist
+       if [ -z ${UNAME} ]; then
+         UID1="`/usr/bin/dscl /Local/Default -list /users uid | /usr/bin/awk '{print $2}' | /usr/bin/sort -n | /usr/bin/tail -1`"
+         Privoxy_UID="`/bin/expr ${UID1} + 1`"
+               echo 'Creating privoxy user using dscl' >> ${logfile}
+         /usr/bin/dscl /Local/Default -create /Users/_privoxy >> ${logfile} 2>&1
+         /usr/bin/dscl /Local/Default -append /Users/_privoxy RecordName privoxy >> ${logfile} 2>&1
+         /usr/bin/dscl /Local/Default -create /Users/_privoxy NFSHomeDirectory /var/empty >> ${logfile} 2>&1
+         /usr/bin/dscl /Local/Default -create /Users/_privoxy Password "*" >> ${logfile} 2>&1
+         /usr/bin/dscl /Local/Default -create /Users/_privoxy PrimaryGroupID ${Privoxy_GID} >> ${logfile} 2>&1
+         /usr/bin/dscl /Local/Default -create /Users/_privoxy RealName "privoxy server" >> ${logfile} 2>&1
+         /usr/bin/dscl /Local/Default -create /Users/_privoxy UniqueID ${Privoxy_UID} >> ${logfile} 2>&1
+         /usr/bin/dscl /Local/Default -create /Users/_privoxy UserShell /usr/bin/false >> ${logfile} 2>&1
+       fi
+  ;;
+  # Mac OS X 10.4, 10.3
+  8|7)
+    GNAME="`/usr/bin/nireport . /groups name | /usr/bin/grep -E '^privoxy?'`"
+    UNAME="`/usr/bin/nireport . /users name | /usr/bin/grep -E '^privoxy?'`"
+       # create group if it does not exist
+       if [ -z ${GNAME} ]; then
+         GID1="`/usr/bin/nireport . /groups gid | /usr/bin/sort -n | /usr/bin/tail -1`"
+         Privoxy_GID="`/bin/expr ${GID1} + 1`"
+               echo 'Creating privoxy group using nicl' >> ${logfile}
+         /usr/bin/nicl . -create /groups/privoxy >> ${logfile} 2>&1
+         /usr/bin/nicl . -create /groups/privoxy passwd "*" >> ${logfile} 2>&1
+         /usr/bin/nicl . -create /groups/privoxy gid ${Privoxy_GID} >> ${logfile} 2>&1
+       fi
+       # create user if it does not exist
+       if [ -z ${UNAME} ]; then
+         UID1="`/usr/bin/nireport . /users uid | /usr/bin/sort -n | /usr/bin/tail -1`"
+         Privoxy_UID="`/bin/expr ${UID1} + 1`"
+               echo 'Creating privoxy user using nicl' >> ${logfile}
+         /usr/bin/nicl . -create /users/privoxy >> ${logfile} 2>&1
+         /usr/bin/nicl . -create /users/privoxy passwd "*" >> ${logfile} 2>&1
+         /usr/bin/nicl . -create /users/privoxy uid ${Privoxy_UID} >> ${logfile} 2>&1
+         /usr/bin/nicl . -create /users/privoxy gid ${Privoxy_GID} >> ${logfile} 2>&1
+         /usr/bin/nicl . -create /users/privoxy change 0 >> ${logfile} 2>&1
+         /usr/bin/nicl . -create /users/privoxy expire 0 >> ${logfile} 2>&1
+         /usr/bin/nicl . -create /users/privoxy realname "Privoxy Web Proxy" >> ${logfile} 2>&1
+         /usr/bin/nicl . -create /users/privoxy home /var/empty >> ${logfile} 2>&1
+         /usr/bin/nicl . -create /users/privoxy shell /usr/bin/false >> ${logfile} 2>&1
+         /usr/bin/nicl . -create /users/privoxy _shadow_passwd "" >> ${logfile} 2>&1
+       fi
+  ;;
+  # default
+  *)
+    GNAME=""
+    UNAME=""
+    ;;
+esac
+
+# 4. Back up any existing log & configuration files
+#
+if [ -f /var/log/privoxy/logfile.log ]; then
+       echo 'Backing up existing logfile' >> ${logfile}
+  /bin/cp /var/log/privoxy/logfile.log /var/log/privoxy/logfile.old >> ${logfile} 2>&1
+       /usr/sbin/chown privoxy:privoxy /var/log/privoxy/logfile.old >> ${logfile} 2>&1
+fi
+if [ -d /usr/local/etc/privoxy ]; then
+       for i in config match-all.action trust user.action user.filter; do
+               echo 'Backing up existing config file:' ${i} >> ${logfile}
+               if [ -f /usr/local/etc/privoxy/$i ]; then
+                       /bin/cp /usr/local/etc/privoxy/$i /usr/local/etc/privoxy/$i.old >> ${logfile} 2>&1
+                       /usr/sbin/chown privoxy:privoxy /usr/local/etc/privoxy/$i.old >> ${logfile} 2>&1
+               fi
+       done
+       echo 'Backing up existing config templates' >> ${logfile}
+       /bin/cp -R /usr/local/etc/privoxy/templates /usr/local/etc/privoxy/templates.old >> ${logfile} 2>&1
+       /usr/sbin/chown -R privoxy:privoxy /usr/local/etc/privoxy/templates.old >> ${logfile} 2>&1
+fi
+
+exit 0
diff --git a/pkg resources/single-binary scripts/readme b/pkg resources/single-binary scripts/readme
new file mode 100644 (file)
index 0000000..f3307f5
--- /dev/null
@@ -0,0 +1,36 @@
+# File        :  readme
+#
+# Purpose     :  Explain the content of the single-binary scripts folder 
+#
+# Copyright   :  Written by and Copyright (C) 2001-2012 the
+#                Privoxy team. http://www.privoxy.org/
+#
+#                This program is free software; you can redistribute it
+#                and/or modify it under the terms of the GNU General
+#                Public License as published by the Free Software
+#                Foundation; either version 2 of the License, or (at
+#                your option) any later version.
+#
+#                This program is distributed in the hope that it will
+#                be useful, but WITHOUT ANY WARRANTY; without even the
+#                implied warranty of MERCHANTABILITY or FITNESS FOR A
+#                PARTICULAR PURPOSE.  See the GNU General Public
+#                License for more details.
+#
+#                The GNU General Public License should be included with
+#                this file.  If not, you can view it at
+#                http://www.gnu.org/copyleft/gpl.html
+#                or write to the Free Software Foundation, Inc.,
+#                51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+#                USA
+#
+# Modification : If you modify this file please consider whether your 
+#                changes ought to be passed back to the macsetup module.
+#
+
+These single-binary pre/postinstall scripts are the ones currently used by the supplied PackageMaker projects (OS X 10.4.pmdoc and OS X 10.5+.pmdoc).
+
+Pre/postupgrade are hard links to their respective install version since the pre/postinstall scripts handle both fresh install and upgrade cases. Be careful when editing pre/postinstall that the hard links still work; many editors (including Xcode) break the hard link when editing a file, meaning you'd need to delete pre/postupgrade and recreate the links as follows:
+
+ln preinstall preupgrade
+ln postinstall postupgrade
\ No newline at end of file
diff --git a/privoxy-create-dscl.sh b/privoxy-create-dscl.sh
new file mode 100755 (executable)
index 0000000..a984b0c
--- /dev/null
@@ -0,0 +1,76 @@
+#!/bin/sh
+
+# File        :  privoxy-create-dscl.sh
+#
+# Purpose     :  Create the privoxy group and user for OS X 10.5,6,7,8
+#
+# Copyright   :  Written by and Copyright (C) 2001-2012 the
+#                Privoxy team. http://www.privoxy.org/
+#
+#                This program is free software; you can redistribute it
+#                and/or modify it under the terms of the GNU General
+#                Public License as published by the Free Software
+#                Foundation; either version 2 of the License, or (at
+#                your option) any later version.
+#
+#                This program is distributed in the hope that it will
+#                be useful, but WITHOUT ANY WARRANTY; without even the
+#                implied warranty of MERCHANTABILITY or FITNESS FOR A
+#                PARTICULAR PURPOSE.  See the GNU General Public
+#                License for more details.
+#
+#                The GNU General Public License should be included with
+#                this file.  If not, you can view it at
+#                http://www.gnu.org/copyleft/gpl.html
+#                or write to the Free Software Foundation, Inc.,
+#                51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+#                USA
+#
+# Modification : If you modify this file please consider whether your 
+#                changes ought to be passed back to the macsetup module.
+#
+
+#
+# check for existing privoxy group and user
+#
+gname="`/usr/bin/dscl /Local/Default -list /groups | /usr/bin/grep -E '^(_)?privoxy?'`"
+uname="`/usr/bin/dscl /Local/Default -list /users | /usr/bin/grep -E '^(_)?privoxy?'`"
+
+#
+# create group
+#
+if [ -z ${gname} ]; then
+  echo "Notice: creating a privoxy group."
+  gid1="`/usr/bin/dscl /Local/Default -list /groups gid | /usr/bin/awk '{print $2}' | /usr/bin/sort -n | /usr/bin/tail -1`"
+  gid="`/bin/expr ${gid1} + 1`"
+
+  /usr/bin/dscl /Local/Default -create /Groups/_privoxy
+  /usr/bin/dscl /Local/Default -append /Groups/_privoxy RecordName privoxy
+  /usr/bin/dscl /Local/Default -create /Groups/_privoxy Password "*"
+  /usr/bin/dscl /Local/Default -create /Groups/_privoxy PrimaryGroupID ${gid}
+  /usr/bin/dscl /Local/Default -create /Groups/_privoxy RealName "privoxy users"
+else
+  echo "Notice: a privoxy group already exists."
+fi
+
+#
+# create user
+#
+if [ -z ${uname} ]; then
+  echo "Notice: creating a privoxy user."
+  uid1="`/usr/bin/dscl /Local/Default -list /users uid | /usr/bin/awk '{print $2}' | /usr/bin/sort -n | /usr/bin/tail -1`"
+  uid="`/bin/expr ${uid1} + 1`"
+
+  /usr/bin/dscl /Local/Default -create /Users/_privoxy
+  /usr/bin/dscl /Local/Default -append /Users/_privoxy RecordName privoxy
+  /usr/bin/dscl /Local/Default -create /Users/_privoxy NFSHomeDirectory /var/empty
+  /usr/bin/dscl /Local/Default -create /Users/_privoxy Password "*"
+  /usr/bin/dscl /Local/Default -create /Users/_privoxy PrimaryGroupID ${gid}
+  /usr/bin/dscl /Local/Default -create /Users/_privoxy RealName "privoxy server"
+  /usr/bin/dscl /Local/Default -create /Users/_privoxy UniqueID ${uid}
+  /usr/bin/dscl /Local/Default -create /Users/_privoxy UserShell /usr/bin/false
+else
+  echo "Notice: a privoxy user already exists."
+fi
+
+exit 0
diff --git a/privoxy-create-nicl.sh b/privoxy-create-nicl.sh
new file mode 100755 (executable)
index 0000000..5015b77
--- /dev/null
@@ -0,0 +1,76 @@
+#!/bin/sh
+
+# File        :  privoxy-create-nicl.sh
+#
+# Purpose     :  Create the privoxy group and user for OS X 10.3,4
+#
+# Copyright   :  Written by and Copyright (C) 2001-2012 the
+#                Privoxy team. http://www.privoxy.org/
+#
+#                This program is free software; you can redistribute it
+#                and/or modify it under the terms of the GNU General
+#                Public License as published by the Free Software
+#                Foundation; either version 2 of the License, or (at
+#                your option) any later version.
+#
+#                This program is distributed in the hope that it will
+#                be useful, but WITHOUT ANY WARRANTY; without even the
+#                implied warranty of MERCHANTABILITY or FITNESS FOR A
+#                PARTICULAR PURPOSE.  See the GNU General Public
+#                License for more details.
+#
+#                The GNU General Public License should be included with
+#                this file.  If not, you can view it at
+#                http://www.gnu.org/copyleft/gpl.html
+#                or write to the Free Software Foundation, Inc.,
+#                51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+#                USA
+#
+# Modification : If you modify this file please consider whether your 
+#                changes ought to be passed back to the macsetup module.
+#
+
+#
+# check for existing privoxy group and user
+#
+gname="`/usr/bin/nireport . /groups name | /usr/bin/grep -E '^privoxy?'`"
+uname="`/usr/bin/nireport . /users name | /usr/bin/grep -E '^privoxy?'`"
+
+#
+# create group
+#
+if [ -z ${gname} ]; then
+  echo "Notice: creating a privoxy group."
+  gid1="`/usr/bin/nireport . /groups gid | /usr/bin/sort -n | /usr/bin/tail -1`"
+  gid="`/bin/expr ${gid1} + 1`"
+
+  /usr/bin/nicl . -create /groups/privoxy
+  /usr/bin/nicl . -create /groups/privoxy passwd "*"
+  /usr/bin/nicl . -create /groups/privoxy gid ${gid}
+else
+  echo "Notice: a privoxy group already exists."
+fi
+
+#
+# create user
+#
+if [ -z ${uname} ]; then
+  echo "Notice: creating a privoxy user."
+  uid1="`/usr/bin/nireport . /users uid | /usr/bin/sort -n | /usr/bin/tail -1`"
+  uid="`/bin/expr ${uid1} + 1`"
+
+  /usr/bin/nicl . -create /users/privoxy
+  /usr/bin/nicl . -create /users/privoxy passwd "*"
+  /usr/bin/nicl . -create /users/privoxy uid ${uid}
+  /usr/bin/nicl . -create /users/privoxy gid ${gid}
+  /usr/bin/nicl . -create /users/privoxy change 0
+  /usr/bin/nicl . -create /users/privoxy expire 0
+  /usr/bin/nicl . -create /users/privoxy realname "Privoxy Web Proxy"
+  /usr/bin/nicl . -create /users/privoxy home /var/empty
+  /usr/bin/nicl . -create /users/privoxy shell /usr/bin/false
+  /usr/bin/nicl . -create /users/privoxy _shadow_passwd ""
+else
+  echo "Notice: a privoxy user already exists."
+fi
+
+exit 0
diff --git a/privoxy-create.sh b/privoxy-create.sh
new file mode 100755 (executable)
index 0000000..60376f6
--- /dev/null
@@ -0,0 +1,59 @@
+#!/bin/sh
+
+# File        :  privoxy-create.sh
+#
+# Purpose     :  Identify the OS X version and call the appropriate
+#                script to generate the privoxy group and user
+#
+# Copyright   :  Written by and Copyright (C) 2001-2012 the
+#                Privoxy team. http://www.privoxy.org/
+#
+#                This program is free software; you can redistribute it
+#                and/or modify it under the terms of the GNU General
+#                Public License as published by the Free Software
+#                Foundation; either version 2 of the License, or (at
+#                your option) any later version.
+#
+#                This program is distributed in the hope that it will
+#                be useful, but WITHOUT ANY WARRANTY; without even the
+#                implied warranty of MERCHANTABILITY or FITNESS FOR A
+#                PARTICULAR PURPOSE.  See the GNU General Public
+#                License for more details.
+#
+#                The GNU General Public License should be included with
+#                this file.  If not, you can view it at
+#                http://www.gnu.org/copyleft/gpl.html
+#                or write to the Free Software Foundation, Inc.,
+#                51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+#                USA
+#
+# Modification : If you modify this file please consider whether your 
+#                changes ought to be passed back to the macsetup module.
+#
+
+#
+# 'sudo' check
+#
+uid="`/usr/bin/id -u`"
+if [ ${uid} -ne 0 ]; then
+  echo "Error: insufficient privileges."
+  echo "This script must be executed with the 'sudo' command."
+  echo "Review the README file for instructions on creating a privoxy group and user."
+  exit 1
+fi
+
+#
+# load common settings
+#
+. ./common.sh
+
+#
+# create a privoxy group and user
+#
+if [ ! -z ${SCRIPT} ]; then
+  /bin/sh ./${SCRIPT}
+else
+  echo "Error: a privoxy group and user cannot be created."
+  echo "This release of Mac OS X is not supported."
+fi
+