f81a01daa2a8f983cbbe7560dfc78ed8581548c2
[OSXPackageBuilder.git] / constructPkgContent.sh
1 #!/bin/sh
2
3 # File        :  constructPkgContent.sh
4 #
5 # Purpose     :  Create the hierarchy of folders and files that will 
6 #                comprise the installation package.
7 #
8 # Copyright   :  Written by and Copyright (C) 2001-2012 the
9 #                Privoxy team. http://www.privoxy.org/
10 #
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.
16 #
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.
22 #
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,
28 #                USA
29 #
30 # Modification : If you modify this file please consider whether your 
31 #                changes ought to be passed back to the macsetup module.
32 #
33
34 # 1. Remove existing 'pkg content' folder if found
35 echo ""
36 echo "Remove existing 'pkg content' folder if found"
37 echo ""
38 rm -rf pkg\ content
39
40 # 1. Copy the package skeleton (the unchanging content) to a new folder named 'pkg content'
41 echo ""
42 echo ""
43 echo "Copy the package skeleton (the unchanging content) to a new folder named 'pkg content'"
44 echo ""
45 cp -vR pkg\ content\ skeleton pkg\ content
46
47 # 2. Copy the compiled privoxy binary from the 'current' project
48 echo ""
49 echo ""
50 echo "Copy the compiled privoxy binary from the 'current' project"
51 echo ""
52 cp -v ../current/privoxy pkg\ content/usr/local/sbin
53
54 # 3. Copy the configuration hierarchy from the 'current' project
55 echo ""
56 echo ""
57 echo "Copy the configuration hierarchy from the 'current' project"
58 echo ""
59 for i in default.action default.filter match-all.action config trust user.action user.filter templates; do
60         if [ "$i" = "templates" ]; then
61                 # for the templates subfolder copy all files therein
62                 cp -vR ../current/$i pkg\ content/usr/local/etc/privoxy/vanilla/$i
63         else
64                 # for all regular files just copy them across
65                 cp -v ../current/$i pkg\ content/usr/local/etc/privoxy/vanilla/$i
66         fi
67 done
68
69 # 4. Copy the documentation hierarchy from the 'current' project
70 echo ""
71 echo ""
72 echo "Copy the documentation hierarchy from the 'current' project"
73 echo ""
74 # copy the required directory hierarchies
75 for i in developer-manual faq images man-page team user-manual; do
76         cp -vR ../current/doc/webserver/$i pkg\ content/usr/local/share/doc/privoxy/$i
77 done
78 # copy the top-level files
79 for i in announce.txt p_doc.css privoxy-index.html; do
80         cp -v ../current/doc/webserver/$i pkg\ content/usr/local/share/doc/privoxy/$i
81 done
82 # copy the project's AUTHORS, ChangeLog, LICENSE and README files
83 for i in AUTHORS ChangeLog LICENSE README; do
84         cp -v ../current/$i pkg\ content/usr/local/share/doc/privoxy/$i
85 done
86
87 # 5. Copy the manpage from the 'current' project
88 echo ""
89 echo ""
90 echo "Copy the manpage from the 'current' project"
91 echo ""
92 cp -v ../current/privoxy.1 pkg\ content/usr/local/share/man/man1
93
94 # 6. Remove unnecessary CVS administration files
95 echo ""
96 echo ""
97 echo "Remove CVS administration files"
98 echo ""
99 find pkg\ content -name CVS.sandboxinfo -exec rm -rf {} \;
100 find pkg\ content -name CVS -exec rm -rf {} \;