]> Savannah Git Hosting - gnulib.git/commitdiff
add script to make libposix distribution
authorBruce Korb <bkorb@gnu.org>
Wed, 17 Nov 2010 21:02:52 +0000 (13:02 -0800)
committerBruce Korb <bkorb@gnu.org>
Wed, 17 Nov 2010 21:02:52 +0000 (13:02 -0800)
.gitignore
ChangeLog
libposix/.gitignore
libposix/bootstrap
libposix/configure.ac
libposix/lib/Makefile.am
libposix/mk-tarball [new file with mode: 0755]

index b95fb408d582544e98972535f58b4411a374b5a6..a9a9402e46cd66e3c2f4d6b1cb33f86543ad060a 100644 (file)
@@ -6,3 +6,4 @@
 allsnippets.tmp
 amsnippet.tmp
 testdir*
+*.diff
index 1a260574e418bd34cd46ac2a0dedebc5e4235f17..ea219fb1bc7ad86166a1708fdf57cc40a10b1fac 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,13 @@
-2010-11-16  Bruce Korb  <bkorb@gnu.org>
+2010-11-17  Bruce Korb  <bkorb@gnu.org>
+
+       * libposix/mk-tarball: script to make a libposix distribution
+       tarball.
+       * libposix/bootstrap: cleanup and ensure the mkdir's are invoked
+       only when needed.
+       * libposix/configure.ac (m4_esyscmd): fix git version suffix
+       * libposix/lib/Makefile.am (HEADERS): include version info
+
+2010-11-17  Bruce Korb  <bkorb@gnu.org>
 
        * tests/test-dprintf-posix2.c (main): call malloc & free before
        setrlimit under Linux.  Avoid setrlimit/malloc interaction bug.
index 404d1789d427b2f34d3f793da4f8f6a8217f95e6..871206de711a577ad06d916191770bccafbf07a2 100644 (file)
@@ -39,12 +39,10 @@ ltmain.sh
 /m4
 missing
 stamp-h1
-/tests/*.c
-/tests/*.h
-/tests/*.mk
-/tests/*.sh
-/tests/test-*
 unused-parameter.h
 warn-on-use.h
 /tests
 /tmp
+_b*
+_i*
+/libposix*.tar.*
index 10c37a92f7869333c4d00eda5af919a7b2ea2be4..4bce30fadc0f3d0af8fda514d29c83f6b1703f9b 100755 (executable)
@@ -2,16 +2,23 @@
 
 PATH=..:$PATH
 
-mkdir tmp
-mkdir tmp/modules
-
-    {   echo alloca
-        posix-modules
-    } | sort -u > tmp/posix-list
-
-    posix_list=$(grep -v '^$' tmp/posix-list)
-
-    cat > tmp/modules/libposix <<- _EOF_
+if test -d tmp
+then
+    if test -d tmp/modules
+    then rm -f tmp/modules/* >/dev/null 2>&1
+    else mkdir tmp/modules
+    fi
+else
+    mkdir tmp tmp/modules
+fi
+
+{   echo alloca
+    posix-modules
+} | sort -u > tmp/posix-list
+
+posix_list=`grep -v '^$' tmp/posix-list`
+
+cat > tmp/modules/libposix <<- _EOF_
        Description:
        Wrap up all the posix modules into an installable libposix.la.
 
index c68fa48d920df716a0ad798adbb86c92ee82419a..455b8574d9845f6454967ab74bdf1e7cac98083d 100644 (file)
@@ -1,6 +1,7 @@
 AC_INIT([GNU libposix],
-        m4_esyscmd([./git-version-gen .tarball-version]),
-        [bug-gnulib@gnu.org])
+    m4_esyscmd([./git-version-gen .tarball-version | \
+       sed 's/-dirty/-modified/']),
+    [bug-gnulib@gnu.org])
 
 AS_BOX([Configuring AC_PACKAGE_TARNAME AC_PACKAGE_VERSION])
 
index 0a31f4e5ea3cbe55325f66731b622717e32e9b96..3a7621b1f1102303ba7005e5cd6225fc6b6a2454 100644 (file)
@@ -5,6 +5,7 @@ EXTRA_DIST =
 EXTRA_HEADERS =
 nodist_pkginclude_HEADERS =
 nobase_nodist_pkginclude_HEADERS =
+pkginclude_HEADERS = version.h
 
 CLEANFILES =
 MOSTLYCLEANDIRS =
@@ -14,3 +15,4 @@ MAINTAINERCLEANFILES =
 include gnulib.mk
 
 libposix_la_LDFLAGS += -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE)
+libposix_la_SOURCES += version.c
diff --git a/libposix/mk-tarball b/libposix/mk-tarball
new file mode 100755 (executable)
index 0000000..ed724a4
--- /dev/null
@@ -0,0 +1,117 @@
+#! /bin/sh
+# -*- Mode: Shell-script -*-
+
+# Copyright (C) 2002-2010 Free Software Foundation, Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+case "$0" in
+*/* ) progdir=`echo "$0" | sed 's@/[^/]*$@@'`
+      cd ${progdir}
+      progdir=`pwd`
+      prognam=`echo "$0" | sed 's@.*/@@'`
+      ;;
+
+* )   progdir=`pwd`
+      prognam="$0"
+      ;;
+esac
+
+# kill the patriarch process.  If we are not the patriarch,
+# then exit 1 too.
+#
+func_die()
+{
+    echo "${prognam} failure:  $*" >&2
+    kill -${SIGTERM} ${progpid}
+    exit 1
+}
+
+func_init()
+{
+    progpid=$$
+    glibdir=`cd .. >/dev/null ; pwd`
+    SIGTERM=15
+
+    git --version >/dev/null 2>&1 \
+        || func_die "git is not operational"
+
+    case "$*" in
+    *'--clean'* )
+        git clean -f -x -d .
+        ;;
+    esac
+}
+
+func_mkver()
+{
+    {
+        echo '/*'
+        sed '1,/^$/d;s/^#/ */;/http:\/\/www\.gnu\.org/q' ${prognam}
+        echo ' */'
+
+        gv=`../build-aux/git-version-gen .tarball-version | \
+            sed 's/-dirty/-modified/'`
+        sedcmd='/^2[01][0-9][0-9]-[0-1][0-9]-[0-3][0-9]  /{
+         s/ .*//
+         s/-/./gp
+         q
+       }'
+        dv=`sed -n "${sedcmd}" ${glibdir}/ChangeLog`
+        cat <<-_EOF_
+               #ifndef LIBPOSIX_GIT_VERSION
+               #define LIBPOSIX_GIT_VERSION "$gv"
+               #define LIBPOSIX_VERSION     "$dv"
+
+               extern char const libposix_git_version[];
+               extern char const libposix_version[];
+               #endif  /* LIBPOSIX_GIT_VERSION */
+       _EOF_
+    } > lib/version.h
+
+    {
+        sed -n '1,/^ \*\/$/p' lib/version.h
+
+        cat <<-_EOF_
+               #include "version.h"
+
+               char const libposix_git_version[] = LIBPOSIX_GIT_VERSION;
+               char const libposix_version[]     = LIBPOSIX_VERSION;
+       _EOF_
+
+    } > lib/version.c
+}
+
+func_bootstrap()
+{
+    /bin/sh ./bootstrap \
+        || func_die bootstrap failure
+}
+
+func_mkdistro()
+{
+    mkdir _b || die mkdir _b
+    cd _b
+    ../configure || die configure
+    make || die make
+    make distcheck || die make distcheck
+    mv libposix*.tar.gz .. || die cannot move tarball
+}
+
+func_init ${1+"$@"}
+func_mkver
+func_bootstrap
+func_mkdistro
+
+: