X-Git-Url: http://www.privoxy.org/gitweb/installation.html?a=blobdiff_plain;f=constructPkgContent.sh;h=f7c48a0318b927e8d7677f48af857d8ac0038833;hb=0163f12f3046263bac5543fffa0e85b7166944e1;hp=0ca51a19c39b2b6d9ed3af2dd06510312ace5e46;hpb=a2d32da683d8ebfa1bc1cb709a625bebfd9099b6;p=OSXPackageBuilder.git diff --git a/constructPkgContent.sh b/constructPkgContent.sh index 0ca51a1..f7c48a0 100755 --- a/constructPkgContent.sh +++ b/constructPkgContent.sh @@ -31,69 +31,100 @@ # changes ought to be passed back to the macsetup module. # -# 1. Remove existing 'pkg content' folder if found +# Use the common script to locate the directory containing Privoxy's source ($SOURCEDIR) +. ./common.sh + +# 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 "" +# Copy the package skeleton (the unchanging content) to a new folder named 'pkg content' 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 +# Replace the version number placeholders in the uninstallation script +echo "" +echo "Replace the version number placeholders in the uninstallation script" +echo "" +VERSION=`perl findversion.pl ../${SOURCE_DIR}/ChangeLog` +sed "s/PRIVOXY_VERSION/${VERSION}/g" pkg\ content\ skeleton/Applications/Privoxy/uninstall.command > pkg\ content/Applications/Privoxy/uninstall.command + +# Copy the compiled privoxy binary from the '${SOURCE_DIR}' directory echo "" echo "" -echo "Copy the compiled privoxy binary from the 'current' project" +echo "Copy the compiled privoxy binary from the '${SOURCE_DIR}' directory" echo "" -cp -v ../current/privoxy pkg\ content/usr/local/sbin +cp -v ../${SOURCE_DIR}/privoxy pkg\ content/usr/local/sbin -# 3. Copy the configuration hierarchy from the 'current' project +# Copy the configuration hierarchy from the '${SOURCE_DIR}' directory echo "" echo "" -echo "Copy the configuration hierarchy from the 'current' project" +echo "Copy most of the configuration hierarchy from the '${SOURCE_DIR}' directory" echo "" -for i in default.action default.filter match-all.action config trust user.action user.filter templates; do +for i in default.action default.filter match-all.action trust user.action user.filter templates; do if [ "$i" = "templates" ]; then # for the templates subfolder copy all files therein - cp -vR ../current/$i pkg\ content/usr/local/etc/privoxy/vanilla/$i + cp -vR ../${SOURCE_DIR}/$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 + cp -v ../${SOURCE_DIR}/$i pkg\ content/usr/local/etc/privoxy/vanilla/$i fi done -# 4. Copy the documentation hierarchy from the 'current' project +# Enter the correct values for confdir and logdir into the config file echo "" echo "" -echo "Copy the documentation hierarchy from the 'current' project" +echo "Copy the config file from the '${SOURCE_DIR}' directory, modifying the confdir and logdir in passing" +echo "" +sed 's/confdir ./confdir \/usr\/local\/etc\/privoxy/g' ../${SOURCE_DIR}/config > pkg\ content/usr/local/etc/privoxy/vanilla/config_temp +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 +rm -f pkg\ content/usr/local/etc/privoxy/vanilla/config_temp + +# Copy the documentation hierarchy from the '${SOURCE_DIR}' directory +echo "" +echo "" +echo "Copy the documentation hierarchy from the '${SOURCE_DIR}' directory" 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 + cp -vR ../${SOURCE_DIR}/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 + cp -v ../${SOURCE_DIR}/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 + cp -v ../${SOURCE_DIR}/$i pkg\ content/usr/local/share/doc/privoxy/$i done -# 5. Copy the manpage from the 'current' project +# Copy the manpage from the '${SOURCE_DIR}' directory echo "" echo "" -echo "Copy the manpage from the 'current' project" +echo "Copy the manpage from the '${SOURCE_DIR}' directory" echo "" -cp -v ../current/privoxy.1 pkg\ content/usr/local/share/man/man1 +cp -v ../${SOURCE_DIR}/privoxy.1 pkg\ content/usr/local/share/man/man1 + +# Optionally copy the PCRE libraries +if [ "$1" == "-pcre" ]; then + echo "" + echo "" + echo "Copy the external PCRE libraries" + echo "" + mkdir pkg\ content/usr/local/lib + cp -v /usr/local/lib/libpcre* pkg\ content/usr/local/lib + mkdir pkg\ content/usr/local/lib/pkgconfig + cp -v /usr/local/lib/pkgconfig/libpcre* pkg\ content/usr/local/lib/pkgconfig +fi -# 6. Remove unnecessary CVS administration files +# Remove CVS administration files echo "" echo "" echo "Remove CVS administration files" echo "" find pkg\ content -name CVS.sandboxinfo -exec rm -rf {} \; +find pkg\ content -name CVS -exec rm -rf {} \; +