3 # File : constructPkgContent.sh
5 # Purpose : Create the hierarchy of folders and files that will
6 # comprise the installation package.
8 # Copyright : Written by and Copyright (C) 2001-2012 the
9 # Privoxy team. http://www.privoxy.org/
11 # This program is free software; you can redistribute it
12 # and/or modify it under the terms of the GNU General
13 # Public License as published by the Free Software
14 # Foundation; either version 2 of the License, or (at
15 # your option) any later version.
17 # This program is distributed in the hope that it will
18 # be useful, but WITHOUT ANY WARRANTY; without even the
19 # implied warranty of MERCHANTABILITY or FITNESS FOR A
20 # PARTICULAR PURPOSE. See the GNU General Public
21 # License for more details.
23 # The GNU General Public License should be included with
24 # this file. If not, you can view it at
25 # http://www.gnu.org/copyleft/gpl.html
26 # or write to the Free Software Foundation, Inc.,
27 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
30 # Modification : If you modify this file please consider whether your
31 # changes ought to be passed back to the macsetup module.
34 # Remove existing 'pkg content' folder if found
36 echo "Remove existing 'pkg content' folder if found"
39 # Copy the package skeleton (the unchanging content) to a new folder named 'pkg content'
41 echo "Copy the package skeleton (the unchanging content) to a new folder named 'pkg content'"
43 cp -vR pkg\ content\ skeleton pkg\ content
45 # Replace the version number placeholders in the uninstallation script
47 echo "Replace the version number placeholders in the uninstallation script"
49 VERSION=`perl findversion.pl ../current/ChangeLog`
50 sed "s/PRIVOXY_VERSION/${VERSION}/g" pkg\ content\ skeleton/Applications/Privoxy/uninstall.command > pkg\ content/Applications/Privoxy/uninstall.command
52 # Copy the compiled privoxy binary from the 'current' project
55 echo "Copy the compiled privoxy binary from the 'current' project"
57 cp -v ../current/privoxy pkg\ content/usr/local/sbin
59 # Copy the configuration hierarchy from the 'current' project
62 echo "Copy most of the configuration hierarchy from the 'current' project"
64 for i in default.action default.filter match-all.action trust user.action user.filter templates; do
65 if [ "$i" = "templates" ]; then
66 # for the templates subfolder copy all files therein
67 cp -vR ../current/$i pkg\ content/usr/local/etc/privoxy/vanilla/$i
69 # for all regular files just copy them across
70 cp -v ../current/$i pkg\ content/usr/local/etc/privoxy/vanilla/$i
74 # Enter the correct values for confdir and logdir into the config file
77 echo "Copy the config file from the 'current' project, modifying the confdir and logdir in passing"
79 sed 's/confdir ./confdir \/usr\/local\/etc\/privoxy/g' ../current/config > pkg\ content/usr/local/etc/privoxy/vanilla/config_temp
80 sed 's/logdir ./logdir \/var\/log\/privoxy/g' pkg\ content/usr/local/etc/privoxy/vanilla/config_temp > pkg\ content/usr/local/etc/privoxy/vanilla/config
81 rm -f pkg\ content/usr/local/etc/privoxy/vanilla/config_temp
83 # Copy the documentation hierarchy from the 'current' project
86 echo "Copy the documentation hierarchy from the 'current' project"
88 # copy the required directory hierarchies
89 for i in developer-manual faq images man-page team user-manual; do
90 cp -vR ../current/doc/webserver/$i pkg\ content/usr/local/share/doc/privoxy/$i
92 # copy the top-level files
93 for i in announce.txt p_doc.css privoxy-index.html; do
94 cp -v ../current/doc/webserver/$i pkg\ content/usr/local/share/doc/privoxy/$i
96 # copy the project's AUTHORS, ChangeLog, LICENSE and README files
97 for i in AUTHORS ChangeLog LICENSE README; do
98 cp -v ../current/$i pkg\ content/usr/local/share/doc/privoxy/$i
101 # Copy the manpage from the 'current' project
104 echo "Copy the manpage from the 'current' project"
106 cp -v ../current/privoxy.1 pkg\ content/usr/local/share/man/man1
108 # Remove CVS administration files
111 echo "Remove CVS administration files"
113 find pkg\ content -name CVS.sandboxinfo -exec rm -rf {} \;
114 find pkg\ content -name CVS -exec rm -rf {} \;