[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203
Stephane Popinet
popinet at users.sf.net
Fri May 15 02:55:28 UTC 2009
The following commit has been merged in the upstream branch:
commit ecc51b66196ac209ffec45bc6c9621f3e894524f
Author: Stephane Popinet <popinet at users.sf.net>
Date: Fri Jul 4 13:20:11 2008 +1000
Scripts for automatic cross-reference generation
For automatically linking keyword wiki documentation with the examples and
test cases.
darcs-hash:20080704032011-d4795-87cde28928cd5fec155b628bf8b2f6f3ca74eeef.gz
diff --git a/configure.in b/configure.in
index 41dc39c..6f703b1 100644
--- a/configure.in
+++ b/configure.in
@@ -457,5 +457,6 @@ doc/tutorial/Makefile
doc/examples/Makefile
doc/examples/gfs2doc
doc/examples/gfs-highlight
+doc/examples/crossref.sh
desktop/Makefile
])
diff --git a/debian/gerris-snapshot.install b/debian/gerris-snapshot.install
index 21da72c..b97a068 100644
--- a/debian/gerris-snapshot.install
+++ b/debian/gerris-snapshot.install
@@ -14,3 +14,4 @@ usr/lib/gerris/*.awk
usr/lib/pkgconfig/*.pc
usr/share/mime/packages/*.xml
usr/share/icons/hicolor/48x48/mimetypes/*.png
+usr/share/gerris/*
diff --git a/doc/Makefile.am b/doc/Makefile.am
index aeebe08..31f8d6f 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -13,7 +13,7 @@ DOC_SOURCE_DIR=../src
TARGET_DIR=html/$(DOC_MODULE)
-EXTRA_DIST=figures
+EXTRA_DIST=figures share
scan:
gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers=""
diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am
index 4b9b186..2af61a9 100644
--- a/doc/examples/Makefile.am
+++ b/doc/examples/Makefile.am
@@ -15,7 +15,8 @@ EXTRA_DIST = \
gfs2tex \
depend.py \
test.py \
- Makefile.deps
+ Makefile.deps \
+ crossref.sh.in
TESTS = test.sh
@@ -24,7 +25,7 @@ test.sh: $(EXAMPLES)
@chmod +x test.sh
bin_SCRIPTS = \
- gfs2doc gfs-highlight
+ gfs2doc gfs-highlight gfsxref
BUILT_SOURCES= \
gfs2doc gfs-highlight gfs.lang
@@ -46,7 +47,7 @@ clean-generic:
DOC = examples
-examples: examples.dvi
+examples: examples.dvi crossref.sh
hevea -fix $(DOC).tex
imagen -res 600 -extra "pnmscale 0.24" $(DOC)
hacha $(DOC).html
@@ -58,6 +59,8 @@ examples: examples.dvi
sh ../share/fixnav.sh $(DOC)
cp -f ../share/contents.png ../share/next.png ../share/prev.png $(DOC)
rm -f *_motif.gif $(DOC).h{tml,aux,ind,toc} $(DOC).image.tex $(DOC).css
+ sh ./crossref.sh --url=http://gfs.sourceforge.net/examples/examples $(EXAMPLES)
+ mv references examples
examples.dvi: examples.tex
latex -interaction=nonstopmode examples.tex > /dev/null 2>&1
diff --git a/doc/examples/crossref.sh.in b/doc/examples/crossref.sh.in
new file mode 100755
index 0000000..aef3422
--- /dev/null
+++ b/doc/examples/crossref.sh.in
@@ -0,0 +1,66 @@
+#!/bin/sh
+# Generated automatically. Please modify crossref.sh.in.
+
+path="@prefix@/share/gerris"
+
+usage()
+{
+ cat <<EOF
+Usage: crossref.sh [OPTIONS] FILE1 FILE2...
+
+Creates cross-references
+
+Options:
+ [--url=URL] reference URL
+ [--help] displays this message and exits
+EOF
+ exit $1
+}
+
+if test $# -lt 1; then
+ usage 1 1>&2
+fi
+
+while test $# -gt 1; do
+ case "$1" in
+ -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) optarg= ;;
+ esac
+
+ case $1 in
+ --url=*)
+ url=$optarg
+ ;;
+ --help)
+ usage 0 1>&2
+ ;;
+ --*)
+ usage 0 1>&2
+ ;;
+ *)
+ break
+ ;;
+ esac
+ shift
+done
+
+keywords=`awk '{if ($1 == "gfs_keyword" && substr ($3,1,4) == "\"Gfs") print substr($3,2,length($3)-2); }' < $path/gfs.lang`
+
+if test -d references; then :
+else
+ mkdir references
+fi
+
+for k in $keywords; do
+ rm -f references/$k.html
+ for f in $*; do
+ gfsxref --url="$url/$f.html" $k < $f/$f.gfs >> references/$k.html
+ cd $f
+ for d in *; do
+ if test -d $d; then
+ gfsxref --url="$url/$f.html#$d" $k < $d/$d.gfs >> ../references/$k.html
+ fi
+ done
+ cd ..
+ done
+done
diff --git a/doc/examples/gfs-highlight.in b/doc/examples/gfs-highlight.in
index a0c9608..99b998f 100755
--- a/doc/examples/gfs-highlight.in
+++ b/doc/examples/gfs-highlight.in
@@ -1,7 +1,7 @@
#!/bin/sh
wiki="http:\/\/gfs.sf.net\/wiki\/index.php"
-title="Gerris simulation"
+title=""
css="darcs.css"
path="@prefix@/share/gerris"
@@ -16,11 +16,15 @@ Syntax highlighting/hypertext linking of Gerris simulation files.
Options:
[--title=TITLE] sets the page title
[--css=FILE] sets the CSS stylesheet filename
+ [--comments] include comment block at the start
+ [--bold] use bold instead of links
[--help] displays this message and exits
EOF
exit $1
}
+comment=0
+bold=0
while test $# -gt 0; do
case "$1" in
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
@@ -34,6 +38,12 @@ while test $# -gt 0; do
--css=*)
css=$optarg
;;
+ --comment)
+ comment=1
+ ;;
+ --bold)
+ bold=1
+ ;;
--help)
usage 0 1>&2
;;
@@ -44,6 +54,11 @@ while test $# -gt 0; do
shift
done
+if test "x$title" = "x"; then :
+cat <<EOF
+<tt class="gfs">
+EOF
+else
cat <<EOF
<html>
<head>
@@ -52,11 +67,12 @@ cat <<EOF
</head>
<body><tt class="gfs">
EOF
+fi
file=`mktemp gfs-highlight.XXXXXX`
ln -s -f $path/gfs.lang $file
-awk 'BEGIN{ infile=0 } {
+awk -v comment=$comment 'BEGIN{ infile=comment } {
if ($2 == "Generated" && $3 == "files:") {
infile = 1;
while ($1 == "#") getline;
@@ -70,11 +86,23 @@ awk 'BEGIN{ infile=0 } {
}
}' | \
source-highlight --lang-def=$file --out-format=html-css | \
-sed "s/\"gfs_keyword\">\(Gfs\)\{0,1\}\([a-zA-Z0-9_]*\)<\/span>/"gfs_keyword"><a href=\"$wiki\/Gfs\2\">\1\2<\/a><\/span>/g"
+(
+if test $bold = "1"; then
+ sed "s/\"gfs_keyword\">\(Gfs\)\{0,1\}\([a-zA-Z0-9_]*\)<\/span>/"gfs_keyword"><b>\1\2<\/b><\/span>/g"
+else
+ sed "s/\"gfs_keyword\">\(Gfs\)\{0,1\}\([a-zA-Z0-9_]*\)<\/span>/"gfs_keyword"><a href=\"$wiki\/Gfs\2\">\1\2<\/a><\/span>/g"
+fi
+)
rm -f $file
+if test "x$title" = "x"; then :
+cat <<EOF
+</tt>
+EOF
+else
cat <<EOF
</tt></body>
</html>
EOF
+fi
diff --git a/doc/examples/gfsxref b/doc/examples/gfsxref
new file mode 100755
index 0000000..f17add4
--- /dev/null
+++ b/doc/examples/gfsxref
@@ -0,0 +1,101 @@
+#!/bin/sh
+
+usage()
+{
+ cat <<EOF
+Usage: gfsxref [OPTIONS] KEYWORD < input.gfs > output.html
+
+Creates cross-references for occurences of KEYWORD in input.gfs
+
+Options:
+ [--url=URL] reference URL for input.gfs
+ [--help] displays this message and exits
+EOF
+ exit $1
+}
+
+if test $# -lt 1; then
+ usage 1 1>&2
+fi
+
+while test $# -gt 1; do
+ case "$1" in
+ -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) optarg= ;;
+ esac
+
+ case $1 in
+ --url=*)
+ url=$optarg
+ ;;
+ --help)
+ usage 0 1>&2
+ ;;
+ --*)
+ usage 0 1>&2
+ ;;
+ esac
+ shift
+done
+
+title=`awk --posix -v keyword=$1 '
+BEGIN {
+ if (substr (keyword, 1, 3) == "Gfs")
+ keyword = substr (keyword, 4);
+ paren = -1;
+ n = 0;
+ last = "";
+}
+{
+ if ($1 == "#" && $2 == "Title:") {
+ title = $3;
+ for (i = 4; i <= NF; i++)
+ title = title " " $i;
+ }
+ else if ($1 != "#" && $0 ~ "(^|[[:blank:]])+(Gfs){0,1}" keyword "[[:blank:]]") {
+ if (last != "")
+ block[n++] = last;
+ last = $0;
+ paren = 0;
+ for (i = 2; i <= NF; i++) {
+ if ($i == "#")
+ break;
+ if (index ($i, "{"))
+ paren++;
+ if (index ($i, "}"))
+ paren--;
+ }
+ }
+ else if (paren > 0) {
+ last = last "\n" $0;
+ for (i = 1; i <= NF; i++) {
+ if ($i == "#")
+ break;
+ if (index ($i, "{"))
+ paren++;
+ if (index ($i, "}"))
+ paren--;
+ }
+ }
+}
+END {
+ print title
+ if (last != "")
+ block[n++] = last;
+ for (i = 0; i < n; i++)
+ print block[i] > "xref_" i;
+}'`
+
+if test -f xref_0; then
+ cat <<EOF
+<li><a href="$url">$title</a></li>
+EOF
+
+ for file in xref_*; do
+ echo "<p>"
+ gfs-highlight --comment --bold < $file
+ echo "</p>"
+ done
+
+ rm -f xref_*
+fi
diff --git a/rpm/gerris.spec b/rpm/gerris.spec
index b61d6dc..ab5d2ac 100644
--- a/rpm/gerris.spec
+++ b/rpm/gerris.spec
@@ -8,7 +8,7 @@ Version: 1.2.0
%else
Version: %{current}
%endif
-Release: 6.%{alphatag}cvs%{?dist}
+Release: 7.%{alphatag}cvs%{?dist}
License: GPLv2
# SuSE should have this macro set. If doubt specify in ~/.rpmmacros
%if 0%{?suse_version}
@@ -22,20 +22,17 @@ URL: http://gfs.sourceforge.net
Packager: Ivan Adam Vari <i.vari at niwa.co.nz>
Source0: %{name}-stable.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-Requires: gts-snapshot-devel >= 0.7.6 pkgconfig gcc sed gawk m4
%if 0%{?fedora_version}
Requires: proj gsl netcdf
-%endif
-%if 0%{?suse_version}
-Requires: libproj0 gsl libnetcdf-4
-%endif
-BuildRequires: glibc-devel automake libtool gsl-devel gts-snapshot-devel >= 0.7.6
-%if 0%{?fedora_version}
BuildRequires: netcdf-devel proj-devel
%endif
%if 0%{?suse_version}
+Requires: libproj0 gsl libnetcdf-4
BuildRequires: libnetcdf-devel libproj-devel
%endif
+# For both distros
+Requires: gts-snapshot-devel >= 0.7.6 pkgconfig gcc sed gawk m4
+BuildRequires: glibc-devel automake libtool gsl-devel gts-snapshot-devel >= 0.7.6
%description
@@ -59,11 +56,13 @@ if [ -x ./configure ]; then
CFLAGS="$RPM_OPT_FLAGS" ./configure \
--prefix=%{_prefix} \
--libdir=%{_prefix}/%_lib \
+ --disable-mpi \
--disable-static
else
CFLAGS="$RPM_OPT_FLAGS" sh autogen.sh \
--prefix=%{_prefix} \
--libdir=%{_prefix}/%_lib \
+ --disable-mpi \
--disable-static
fi
%endif
@@ -73,12 +72,14 @@ if [ -x ./configure ]; then
CPPFLAGS="-I%{_includedir}/netcdf-3" ./configure \
--prefix=%{_prefix} \
--libdir=%{_prefix}/%_lib \
+ --disable-mpi \
--disable-static
else
CFLAGS="$RPM_OPT_FLAGS" \
CPPFLAGS="-I%{_includedir}/netcdf-3" sh autogen.sh \
--prefix=%{_prefix} \
--libdir=%{_prefix}/%_lib \
+ --disable-mpi \
--disable-static
fi
%endif
@@ -125,7 +126,7 @@ update-mime-database %{_datadir}/mime &> /dev/null || :
%files
-%defattr(-,root,root,-)
+%defattr(-,root,root)
%doc NEWS README TODO COPYING
%{_bindir}/*
%{_includedir}/*.h
@@ -134,11 +135,17 @@ update-mime-database %{_datadir}/mime &> /dev/null || :
%{_libdir}/*.so
%{_libdir}/gerris/*
%{_libdir}/pkgconfig/*.pc
+%{_datadir}/gerris/gfs.lang
%{_datadir}/mime/packages/*.xml
%{_datadir}/icons/hicolor/48x48/mimetypes/*.png
%changelog
+* Thu Jul 3 2008 Ivan Adam Vari <i.vari at niwa.co.nz> - 7
+- Fixed typo in %files section (attr)
+- Added new file gfs.lang to %files section
+- Disabled MPI according to debian build rules
+
* Thu May 15 2008 Ivan Adam Vari <i.vari at niwa.co.nz> - 6
- Added fedora 8 support for x86 (32bit only)
- Removed libtool config files to comply with shared
diff --git a/test/Makefile.am b/test/Makefile.am
index c15d4b0..7be01ca 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -55,6 +55,8 @@ tests: tests.dvi
sh ../doc/share/fixnav.sh $(DOC)
cp -f ../doc/share/contents.png ../doc/share/next.png ../doc/share/prev.png $(DOC)
rm -f *_motif.gif $(DOC).h{tml,aux,ind,toc} $(DOC).image.tex $(DOC).css
+ sh ../doc/examples/crossref.sh --url=http://gfs.sourceforge.net/tests/tests $(TESTDIRS)
+ mv references tests
tests.dvi: tests.tex tests.bib
latex -interaction=nonstopmode tests.tex > /dev/null 2>&1
--
Gerris Flow Solver
More information about the debian-science-commits
mailing list