]> diplodocus.org Git - nmh/blobdiff - docs/contrib/build_nmh
Fix flex 2.6.1's output regarding signed/unsigned comparisons.
[nmh] / docs / contrib / build_nmh
index 10ad7df62bd9325ff0a80fd9cc677036c5eeca9a..fc871f8f719038b68ec376abbcb8d0eb87301241 100755 (executable)
@@ -8,6 +8,10 @@
 # * Unless the -y option is provided, this script then interactively
 #   walks you through confirmation of common configuration settings.
 #
+# This file can be downloaded and immediately run using, e.g.,
+#   wget http://git.savannah.gnu.org/cgit/nmh.git/plain/docs/contrib/build_nmh
+#   sh build_nmh
+#
 # Typical usage:
 # The first time you invoke this script, use the -i option to install
 # nmh in the specified location.  The script will walk you through the
@@ -127,9 +131,9 @@ else
     [ "$verbose" -eq 0 ]  &&  git_opts=--quiet
     [ "$branch" == master ]  ||
       git_opts="${git_opts:+$git_opts }--branch $branch"
-    if "$gitdir"/git clone $git_opts "git://$gitrepo/nmh.git"; then
+    if "$gitdir"/git clone --depth 1 $git_opts "git://$gitrepo/nmh.git"; then
       cd nmh  ||  die "failed to clone nmh"
-      git log --max-count=1 --pretty-format:%H
+      printf "commit %s\n" `git log --max-count=1 --pretty=format:%H`
     else
       die 'failed to clone git repo'
     fi
@@ -142,10 +146,10 @@ else
     snapshot="$repo/$tarball"
     if [ "`finddir wget`" ]; then
       [ "$verbose" -eq 0 ] && wget_opts='--quiet'
-      wget --output-document - $wget_opts "$snapshot" | tar xzf -
+      wget --output-document - $wget_opts "$snapshot" | gzip -d | tar xf -
     elif [ "`finddir curl`" ]; then
-      [ "$verbose" -eq 0 ] && curl_opts=--silent
-      curl --location $curl_opts "$snapshot" | tar xzf -
+      [ "$verbose" -eq 0 ] && curl_opts='--silent --show-error'
+      curl --location $curl_opts "$snapshot" | gzip -d | tar xf -
     else
       die 'unable to find program to download nmh sources'
     fi
@@ -289,14 +293,14 @@ if [ $install -ge 1  -a  "$LOGNAME" != root ]; then
   fi
 fi
 
-tools/showbuildenv | grep -Ev 'PID=|SHLVL'
+[ -x tools/showbuildenv ]  &&  tools/showbuildenv | grep -Ev 'PID=|SHLVL'
 
 
 ####
 #### Set up with autoconfig if necessary.
 ####
 if [ -f Makefile ]; then
-  [ $verbose -ge 1 ]  &&  echo cleaning . . .
+  [ $verbose -ge 1 ]  &&  echo cleaning . . . >&3
   if [ $superclean -ge 1 ]; then
     make superclean >/dev/null
   else
@@ -305,7 +309,7 @@ if [ -f Makefile ]; then
 fi
 
 if [ ! -f configure  -o  ! -f Makefile.in ]; then
-  [ $verbose -ge 1 ]  &&  echo autoconfiguring . . .
+  [ $verbose -ge 1 ]  &&  echo autoconfiguring . . . >&3
   ./autogen.sh
   [ $? -ne 0 ]  &&
     die "autogen failed, see MACHINES file for autoconf,
@@ -316,7 +320,7 @@ fi
 ####
 #### Build.
 ####
-[ $verbose -ge 1 ]  &&  echo configuring . . .
+[ $verbose -ge 1 ]  &&  echo configuring . . . >&3
 if [ -z "$CFLAGS" ]; then
   #### Only use these flags with gcc.
   if cc -dM -E - </dev/null 2>&1 | grep __GNUC__ >/dev/null; then
@@ -331,7 +335,7 @@ printf '\n./configure %s\n' "$config_opts${smtpservers:+ $smtpservers}"
 status=$?
 
 if [ $status -eq 0 ]; then
-  [ $verbose -ge 1 ]  &&  echo building . . .
+  [ $verbose -ge 1 ]  &&  echo building . . . >&3
   make
   status=$?
 
@@ -352,7 +356,7 @@ if [ $status -eq 0 ]; then
         export DISTCHECK_CONFIGURE_FLAGS
     fi
 
-    [ $verbose -ge 1 ]  &&  echo testing . . .
+    [ $verbose -ge 1 ]  &&  echo testing . . . >&3
     checkoutput=`make $check AM_COLOR_TESTS=always`
     status=$?
 
@@ -372,13 +376,13 @@ if [ $status -eq 0 ]; then
 
     if [ $status -eq 0 ]; then
       if [ $install -ge 1 ]; then
-        [ $verbose -ge 1 ]  &&  echo installing . . .
+        [ $verbose -ge 1 ]  &&  echo installing . . . >&3
         ($installpriv make install) >/dev/null
         status=$?
       fi
 
       if [ $status -eq 0  -a  $build_rpm -ge 1 ]; then
-        [ $verbose -ge 1 ]  &&  echo building rpm . . .
+        [ $verbose -ge 1 ]  &&  echo building rpm . . . >&3
         make rpm >/dev/null
         status=$?
       fi
@@ -402,7 +406,7 @@ cat "$tmpfile"
 grep -E 'Error|warn' "$tmpfile"
 
 if [ $status -eq 0 ]; then
-  [ $verbose -ge 1 ]  &&  echo build completed successfully
+  [ $verbose -ge 1 ]  &&  echo build completed successfully >&3
 else
   echo build failed!
   [ "$logfile" = - ]  ||  echo "build failed, build log is in $logfile" >&3