]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Add functionality to the install-bindist.sh script created by
authorRandy Terbush <randy@apache.org>
Sun, 2 May 1999 02:58:07 +0000 (02:58 +0000)
committerRandy Terbush <randy@apache.org>
Sun, 2 May 1999 02:58:07 +0000 (02:58 +0000)
binbuild.sh to use tar when copying distribution files to the
serverroot. This allows upgrading an existing installation
without nesting the new distribution in the old.

install-bindist.sh now detects the local perl5 path to install
apxs and dbmmanage with proper path to perl interpreter.

Add an install-binsupport target which copies the source files
for apxs and dbmmanage to bindist to allow these scripts to
be properly installed relative to the destination serverroot.

FWIW - abort during commit for changed files commited without
comments.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@83149 13f79535-47bb-0310-9956-ffa450edef68

build/binbuild.sh

index 07541bba15055838d45895a579a6daa586ee0349..7afb8f2fdbbac897ffb364ddc978554e943c39dc 100755 (executable)
@@ -129,6 +129,55 @@ cp README.bindist ../apache_$VER-$OS.README
   echo "# This script installs the Apache binary distribution and" && \
   echo "# was automatically created by binbuild.sh." && \
   echo " " && \
+  echo "lmkdir()" && \
+  echo "{" && \
+  echo "  path=\"\"" && \
+  echo "  dirs=\`echo \$1 | sed -e 's%/% %g'\`" && \
+  echo "  mode=\$2" && \
+  echo " " && \
+  echo "  set -- \${dirs}" && \
+  echo " " && \
+  echo "  for d in \${dirs}" && \
+  echo "  do" && \
+  echo "    path=\"\${path}/\$d\"" && \
+  echo "    if test ! -d \"\${path}\" ; then" && \
+  echo "      mkdir \${path}" && \
+  echo "      if test \$? -ne 0 ; then" && \
+  echo "        echo \"Failed to create directory: \${path}\"" && \
+  echo "        exit 1" && \
+  echo "      fi" && \
+  echo "      chmod \${mode} \${path}" && \
+  echo "    fi" && \
+  echo "  done" && \
+  echo "}" && \
+  echo " " && \
+  echo "lcopy()" && \
+  echo "{" && \
+  echo "  from=\$1" && \
+  echo "  to=\$2" && \
+  echo "  dmode=\$3" && \
+  echo "  fmode=\$4" && \
+  echo " " && \
+  echo "  test -d \${to} || lmkdir \${to} \${dmode}" && \
+  echo "  (cd \${from} && tar -cf - *) | (cd \${to} && tar -xf -)" && \
+  echo " " && \
+  echo "  if test \"X\${fmode}\" != X ; then" && \
+  echo "    find \${to} -type f -print | xargs chmod \${fmode}" && \
+  echo "  fi" && \
+  echo "  if test \"X\${dmode}\" != X ; then" && \
+  echo "    find \${to} -type d -print | xargs chmod \${dmode}" && \
+  echo "  fi" && \
+  echo "}" && \
+  echo " " && \
+  echo "##" && \
+  echo "##  determine path to (optional) Perl interpreter" && \
+  echo "##" && \
+  echo "PERL=no-perl-on-this-system" && \
+  echo "perlpath=\"\`src/helpers/PrintPath perl5 perl miniperl\`\"" && \
+  echo "if [ \"x\$perlpath\" != \"x\" ]; then" && \
+  echo "  PERL=\"\$perlpath\"" && \
+  echo "fi" && \
+  echo " " && \
   echo "if [ .\$1 = . ]" && \
   echo "then" && \
   echo "  SR=/usr/local/apache" && \
@@ -138,27 +187,32 @@ cp README.bindist ../apache_$VER-$OS.README
   echo "echo \"Installing binary distribution for platform $OS\"" && \
   echo "echo \"into directory \$SR ...\"" && \
   echo "./src/helpers/mkdir.sh \$SR" && \
-  echo "cp -r bindist/proxy \$SR/proxy" && \
-  echo "cp -r bindist/man \$SR/man" && \
-  echo "cp -r bindist/logs \$SR/logs" && \
-  echo "cp -r bindist/libexec \$SR/libexec" && \
-  echo "cp -r bindist/include \$SR/include" && \
-  echo "cp -r bindist/icons \$SR/icons" && \
-  echo "cp -r bindist/cgi-bin \$SR/cgi-bin" && \
-  echo "cp -r bindist/bin \$SR/bin" && \
+  echo "lmkdir \$SR/proxy 750" && \
+  echo "lmkdir \$SR/logs 750" && \
+  echo "lcopy bindist/man \$SR/man 755 644" && \
+  echo "lcopy bindist/libexec \$SR/libexec 750 644" && \
+  echo "lcopy bindist/include \$SR/include 755 644" && \
+  echo "lcopy bindist/icons \$SR/icons 755 644" && \
+  echo "lcopy bindist/cgi-bin \$SR/cgi-bin 750 750" && \
+  echo "lcopy bindist/bin \$SR/bin 750 750" && \
   echo "if [ -d \$SR/conf ]" && \
   echo "then" && \
   echo "  echo \"[Preserving existing configuration files.]\"" && \
-  echo "  cp -r bindist/conf/*.default \$SR/conf/" && \
+  echo "  cp bindist/conf/*.default \$SR/conf/" && \
   echo "else" && \
-  echo "  cp -r bindist/conf \$SR/conf" && \
+  echo "  lcopy bindist/conf \$SR/conf 750 640" && \
   echo "fi" && \
   echo "if [ -d \$SR/htdocs ]" && \
   echo "then" && \
   echo "  echo \"[Preserving existing htdocs directory.]\"" && \
   echo "else" && \
-  echo "  cp -r bindist/htdocs \$SR/htdocs" && \
+  echo "  lcopy bindist/htdocs \$SR/htdocs 755 644" && \
   echo "fi" && \
+  echo " " && \
+  echo "sed -e \"s;^#!/.*;#!\$PERL;\" -e \"s;\@prefix\@;\$SR;\" -e \"s;\@sbindir\@;\$SR/bin;\" \\" && \
+  echo "       -e \"s;\@libexecdir\@;\$SR/libexec;\" -e \"s;\@includedir\@;\$SR/include;\" \\" && \
+  echo "       -e \"s;\@sysconfdir\@;\$SR/conf;\" bindist/bin/apxs > \$SR/bin/apxs" && \
+  echo "sed -e \"s;^#!/.*;#!\$PERL;\" bindist/bin/dbmmanage > \$SR/bin/dbmmanage" && \
   echo "sed -e s%/usr/local/apache%\$SR/% \$SR/conf/httpd.conf.default > \$SR/conf/httpd.conf" && \
   echo "sed -e s%PIDFILE=%PIDFILE=\$SR/% -e s%HTTPD=%HTTPD=\\\"\$SR/% -e \"s%/httpd$%/httpd -d \$SR\\\"%\" bindist/bin/apachectl > \$SR/bin/apachectl" && \
   echo " " && \
@@ -166,12 +220,12 @@ cp README.bindist ../apache_$VER-$OS.README
   echo "echo \" +--------------------------------------------------------+\"" && \
   echo "echo \" | You now have successfully installed the Apache $VER   |\"" && \
   echo "echo \" | HTTP server. To verify that Apache actually works      |\"" && \
-  echo "echo \" | correctly you now should first check the (initially    |\"" && \
-  echo "echo \" | created or preserved) configuration files              |\"" && \
+  echo "echo \" | correctly you should first check the (initially        |\"" && \
+  echo "echo \" | created or preserved) configuration files:             |\"" && \
   echo "echo \" |                                                        |\"" && \
   echo "echo \" |   \$SR/conf/httpd.conf\"" && \
   echo "echo \" |                                                        |\"" && \
-  echo "echo \" | and then you should be able to immediately fire up     |\"" && \
+  echo "echo \" | You should then be able to immediately fire up         |\"" && \
   echo "echo \" | Apache the first time by running:                      |\"" && \
   echo "echo \" |                                                        |\"" && \
   echo "echo \" |   \$SR/bin/apachectl start \"" &&\