]> Pileus Git - ~andy/sunrise/commitdiff
sci-libs/rsl: New Ebuild for bug 277478 submitted by Andy Spencer.
authorAndy Spencer <andy753421@gmail.com>
Sun, 12 Jul 2009 20:11:48 +0000 (20:11 +0000)
committerAndy Spencer <andy753421@gmail.com>
Sun, 12 Jul 2009 20:11:48 +0000 (20:11 +0000)
svn path=/sunrise/; revision=8808

sci-libs/rsl/ChangeLog [new file with mode: 0644]
sci-libs/rsl/Manifest [new file with mode: 0644]
sci-libs/rsl/files/rsl-automake.patch [new file with mode: 0644]
sci-libs/rsl/files/rsl-type_str.patch [new file with mode: 0644]
sci-libs/rsl/files/rsl-valgrind.patch [new file with mode: 0644]
sci-libs/rsl/files/rsl-warnings.patch [new file with mode: 0644]
sci-libs/rsl/metadata.xml [new file with mode: 0644]
sci-libs/rsl/rsl-1.40.ebuild [new file with mode: 0644]

diff --git a/sci-libs/rsl/ChangeLog b/sci-libs/rsl/ChangeLog
new file mode 100644 (file)
index 0000000..116956a
--- /dev/null
@@ -0,0 +1,9 @@
+# ChangeLog for sci-libs/rsl
+# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
+# $Header: $
+
+  12 Jul 2009; Andy Spencer <andy753421@gmail.com> +rsl-1.40.ebuild,
+  +files/rsl-automake.patch, +files/rsl-gzip.patch,
+  +files/rsl-type_str.patch, +files/rsl-valgrind.patch,
+  +files/rsl-warnings.patch, +metadata.xml:
+  New Ebuild for bug 277478 submitted by Andy Spencer.
diff --git a/sci-libs/rsl/Manifest b/sci-libs/rsl/Manifest
new file mode 100644 (file)
index 0000000..4a19cf0
--- /dev/null
@@ -0,0 +1,8 @@
+AUX rsl-automake.patch 9486 RMD160 c8a104957aae8160c2866d6f6f7352fb02e7a6ed SHA1 b087ac07ff33e6d571db24b0645745e225f39afe SHA256 25bbb984a23de470a1d90189365f78e6036eef49cdfcdb515487e1062efa6a58
+AUX rsl-type_str.patch 3582 RMD160 ba3bc9990021c89681eeaeceb41ad3641e86007d SHA1 c2d7b38edef6b3fa6256474d7569bf742641bccf SHA256 b2e6371cb939ff36231842e8370e793e86a364acb8d780c98999f115b6ab48bc
+AUX rsl-valgrind.patch 4278 RMD160 5cef74fedb6cab7381d490ef185e7b4bdc0f203c SHA1 8dd5e4f2cf9560b1624b2a93c0f9f08765ea37c5 SHA256 e968f37fcb64919005754a860d59301dcc6433ec44e4b89a070c7147711adf75
+AUX rsl-warnings.patch 5991 RMD160 88e011a8778aa51dc391a9e98e004f6cc6901482 SHA1 97974cd1ab5a81b0a4e7a10e001bac150e9dd15f SHA256 a9ec0f73096b225162d7f55454b51e47419dc9847a80c42c154c2179d06d1bf7
+DIST rsl-v1.40.tar.gz 772417 RMD160 819573695a20dcef5313900d89df680ca66c3ea4 SHA1 3ef59a3556d3dbc95ec339d5a834c838c1e8aafd SHA256 94ccae61d86e8216cec8b17e50b9a7fb0fefb21cef02e0dd73ad10b0cc60acb7
+EBUILD rsl-1.40.ebuild 693 RMD160 3dfe5a2c1dfcf84e8a2fe94767bc302b37c71640 SHA1 8fa440b7477064d66f9e664caacb602cd17542d5 SHA256 f82904d9776b0b765d4eaf3ffe2414bf1f05acbd1187ef32bb67f104180f0d98
+MISC ChangeLog 389 RMD160 acfc601fe256f3d98236293d1a198f34104a311d SHA1 4d1d0e7f026d0e83550b702062328ee411c1fba5 SHA256 2f14228dbcb9440f9095598da0934da41b5c0cf8370a4e541c71a37a00b88080
+MISC metadata.xml 168 RMD160 156c29f9b364fbbaf0028d17736a01112e5d8cab SHA1 1221e73982792f6e23f10d95e878e86e8f62fe35 SHA256 2fc15316b226307080574c36b3761f27a23a642e89c60f02feabdc64049a188d
diff --git a/sci-libs/rsl/files/rsl-automake.patch b/sci-libs/rsl/files/rsl-automake.patch
new file mode 100644 (file)
index 0000000..5f7fc68
--- /dev/null
@@ -0,0 +1,241 @@
+diff -ru rsl-v1.40/colors/Makefile.am rsl-v1.40.new/colors/Makefile.am
+--- rsl-v1.40/colors/Makefile.am       1999-12-10 03:28:38.000000000 +0000
++++ rsl-v1.40.new/colors/Makefile.am   2008-12-27 11:26:01.000000000 +0000
+@@ -1,6 +1,6 @@
+ AUTOMAKE_OPTIONS = foreign
+-colordir = $(prefix)/lib/colors
++colordir = $(datadir)/rsl/colors
+ color_DATA = *.???
+ EXTRA_DIST = $(color_DATA)
+diff -ru rsl-v1.40/colors/Makefile.in rsl-v1.40.new/colors/Makefile.in
+--- rsl-v1.40/colors/Makefile.in       2008-12-27 11:30:45.000000000 +0000
++++ rsl-v1.40.new/colors/Makefile.in   2008-12-27 11:26:07.000000000 +0000
+@@ -166,7 +166,7 @@
+ sysconfdir = @sysconfdir@
+ target_alias = @target_alias@
+ AUTOMAKE_OPTIONS = foreign
+-colordir = $(prefix)/lib/colors
++colordir = $(datadir)/rsl/colors
+ color_DATA = *.???
+ EXTRA_DIST = $(color_DATA)
+ all: all-am
+diff -ru rsl-v1.40/Makefile.am rsl-v1.40.new/Makefile.am
+--- rsl-v1.40/Makefile.am      2008-10-10 20:06:57.000000000 +0000
++++ rsl-v1.40.new/Makefile.am  2008-12-27 11:25:59.000000000 +0000
+@@ -1,73 +1,49 @@
+ ## Process w/ automake.  Or, autoreconf; make ##
++AM_CFLAGS = -DDATADIR="\"$(datadir)/rsl\""
+ AUTOMAKE_OPTIONS = foreign
+ SUBDIRS = . colors doc examples
+ INCLUDES = -I. -I$(srcdir) -I$(prefix)/include -I$(prefix)/toolkit/include
+-includedir = $(prefix)/include 
+-colordir = $(libdir)/colors
+-
+ lib_LTLIBRARIES = librsl.la
+-librsl_la_LDFLAGS = -version-info 1:40
+-librsl_la_SOURCES = \
+-$(rapic_c) $(radtec_c)\
+-dorade.c dorade_print.c dorade_to_radar.c\
+-lassen.c lassen_to_radar.c \
+-edge_to_radar.c \
+- radar.c volume.c image_gen.c cappi.c fraction.c read_write.c farea.c \
+- range.c radar_to_uf.c uf_to_radar.c wsr88d_to_radar.c \
+- carpi.c cube.c sort_rays.c toga_to_radar.c gts.c histogram.c \
+- ray_indexes.c anyformat_to_radar.c get_win.c endian.c mcgill_to_radar.c \
+- mcgill.c interp.c toga.c wsr88d.c wsr88d_get_site.c wsr88d_m31.c \
+- gzip.c prune.c reverse.c fix_headers.c \
+- nsig_to_radar.c nsig.c nsig2_to_radar.c \
+- africa_to_radar.c africa.c \
+- radar_to_hdf_2.c hdf_to_radar.c toolkit_memory_mgt.c \
+- radar_to_hdf_1.c rainbow.c rainbow_to_radar.c $(headers)
+-
+-librsl_la_DEPENDENCIES = $(build_headers)
++wsr88ddir = $(datadir)/rsl/
++dist_wsr88d_DATA = wsr88d_locations.dat
+-build_headers = rsl.h wsr88d.h toolkit_1BC-51_appl.h
++include_HEADERS = rsl.h toolkit_1BC-51_appl.h
+ headers = africa.h dorade.h lassen.h \
+           mcgill.h nsig.h radtec.h rainbow.h \
+           rapic_routines.h toga.h \
+-                $(build_headers)
++          wsr88d.h \
++        $(include_HEADERS)
++
++librsl_la_LDFLAGS = -version-info 1:40
++librsl_la_SOURCES = \
++    $(rapic_c) $(radtec_c) \
++    dorade.c dorade_print.c dorade_to_radar.c \
++    lassen.c lassen_to_radar.c \
++    edge_to_radar.c \
++    radar.c volume.c image_gen.c cappi.c fraction.c read_write.c farea.c \
++    range.c radar_to_uf.c uf_to_radar.c wsr88d_to_radar.c \
++    carpi.c cube.c sort_rays.c toga_to_radar.c gts.c histogram.c \
++    ray_indexes.c anyformat_to_radar.c get_win.c endian.c mcgill_to_radar.c \
++    mcgill.c interp.c toga.c wsr88d.c wsr88d_get_site.c wsr88d_m31.c \
++    gzip.c prune.c reverse.c fix_headers.c \
++    nsig_to_radar.c nsig.c nsig2_to_radar.c \
++    africa_to_radar.c africa.c \
++    radar_to_hdf_2.c hdf_to_radar.c toolkit_memory_mgt.c \
++    radar_to_hdf_1.c rainbow.c rainbow_to_radar.c $(headers)
++
+ rapic_c =  rapic_to_radar.c rapic.y rapic-lex.l rapic_routines.c
+ radtec_c = radtec_to_radar.c radtec.c
+-rsl.h: Makefile
+-      @for h in $(build_headers); do \
+-      echo -n "Checking substitutions in header file $$h ... "; \
+-      cp $$h $$h.in; \
+-      sed -e 's/RSL_VERSION_STR.*/RSL_VERSION_STR \"$(VERSION)\"/' \
+-         -e 's|#define COLORDIR.*|#define COLORDIR \"$(colordir)\"|' \
+-         -e 's|#define WSR88D_SITE_INFO_FILE.*|#define WSR88D_SITE_INFO_FILE \"$(libdir)/wsr88d_locations.dat\"|' \
+-    < $$h.in > $$h.new; \
+-      if cmp -s $$h $$h.new; then \
+-       rm $$h.new; \
+-       echo "$$h remains untouched."; \
+-    else \
+-       mv $$h.new $$h; \
+-       echo "substitutions made in $$h."; \
+-    fi; \
+-      rm -f $$h.in; \
+-    done
+-
+ PREFIX = rapic
+ LFLAGS = -P$(PREFIX)
+ YFLAGS = -d -p $(PREFIX)
+ LEX_OUTPUT_ROOT = lex.$(PREFIX)
+-
+-install-exec-hook:
+-      $(INSTALL) -d  $(includedir)
+-      $(INSTALL) -m 644 rsl.h $(includedir)
+-      $(INSTALL) -m 644 toolkit_1BC-51_appl.h $(includedir)
+-      $(INSTALL) -m 644 wsr88d_locations.dat $(libdir)
+-
+ EXTRA_DIST = CHANGES CHECK_LIST Copyright GPL LGPL wsr88d_locations.dat rapic.h
+ DISTCLEANFILES = rapic.c rapic-lex.c
+diff -ru rsl-v1.40/radar.c rsl-v1.40.new/radar.c
+--- rsl-v1.40/radar.c  2006-08-09 19:35:53.000000000 +0000
++++ rsl-v1.40.new/radar.c      2008-12-27 11:13:43.000000000 +0000
+@@ -60,7 +60,7 @@
+ void RSL_print_version()
+ {
+-  printf("RSL version %s.\n", RSL_VERSION_STR);
++  printf("RSL version %s.\n", VERSION);
+ }
+ /* Debug printing global variable: radar_verbose_flag */
+diff -ru rsl-v1.40/radar_to_uf.c rsl-v1.40.new/radar_to_uf.c
+--- rsl-v1.40/radar_to_uf.c    2008-04-16 19:34:41.000000000 +0000
++++ rsl-v1.40.new/radar_to_uf.c        2008-12-27 11:13:58.000000000 +0000
+@@ -316,7 +316,7 @@
+               uf_ma[37] = tm->tm_year % 100; /* Same format as data year */
+               uf_ma[38] = tm->tm_mon+1;
+               uf_ma[39] = tm->tm_mday;
+-              memcpy(&uf_ma[40], "RSL" RSL_VERSION_STR, 8);
++              memcpy(&uf_ma[40], "RSL" VERSION, 8);
+               if (little_endian()) swap2(&uf_ma[40], 8/2);
+               uf_ma[44] = (signed short)UF_NO_DATA;
+               len_ma = 45;
+diff -ru rsl-v1.40/read_write.c rsl-v1.40.new/read_write.c
+--- rsl-v1.40/read_write.c     2008-10-07 22:30:06.000000000 +0000
++++ rsl-v1.40.new/read_write.c 2008-12-27 11:14:05.000000000 +0000
+@@ -314,7 +314,7 @@
+   if (radar == NULL) return 0;
+   
+   memset(title, 0, sizeof(title));
+-  (void)sprintf(title, "RSL v%s. sizeof(Range) %d", RSL_VERSION_STR, sizeof(Range));
++  (void)sprintf(title, "RSL v%s. sizeof(Range) %d", VERSION, sizeof(Range));
+   n += fwrite(title, sizeof(char), sizeof(title), fp);
+   
+   memset(header_buf, 0, sizeof(header_buf));
+diff -ru rsl-v1.40/rsl.h rsl-v1.40.new/rsl.h
+--- rsl-v1.40/rsl.h    2008-10-10 20:09:36.000000000 +0000
++++ rsl-v1.40.new/rsl.h        2008-12-27 11:15:24.000000000 +0000
+@@ -27,8 +27,6 @@
+ #include "config.h"
+ #endif
+-#define RSL_VERSION_STR "v1.40"
+-
+ /**********************************************************************/
+ /* Configure: Define USE_TWO_BYTE_PRECISION to have RSL store internal*/
+ /*            values with two bytes.  Otherwise, use one byte.        */
+@@ -46,7 +44,7 @@
+ /*            so you shouldn't have to modify anything here.          */
+ /**********************************************************************/
+ #ifndef COLORDIR
+-#define COLORDIR "/usr/local/trmm/GVBOX/lib/colors"
++#define COLORDIR DATADIR "/colors"
+ #endif
+ /* These are the color table indexes. See RSL_set/get_color_table. */
+@@ -57,18 +55,18 @@
+ /* The default color tables for reflectivity, velocity, spectral width,
+  * height, rainfall, and zdr.
+  */
+-#define REFL_RED_FILE   COLORDIR "/red_reflectivity.clr"
+-#define REFL_GREEN_FILE COLORDIR "/grn_reflectivity.clr"
+-#define REFL_BLUE_FILE  COLORDIR "/blu_reflectivity.clr"
+-#define VEL_RED_FILE    COLORDIR "/red_velocity.clr"
+-#define VEL_GREEN_FILE  COLORDIR "/grn_velocity.clr"
+-#define VEL_BLUE_FILE   COLORDIR "/blu_velocity.clr"
+-#define SW_RED_FILE     COLORDIR "/red_spectral_width.clr"
+-#define SW_GREEN_FILE   COLORDIR "/grn_spectral_width.clr"
+-#define SW_BLUE_FILE    COLORDIR "/blu_spectral_width.clr"
+-#define HEIGHT_RED_FILE   COLORDIR "/red_height.clr"
+-#define HEIGHT_GREEN_FILE COLORDIR "/grn_height.clr"
+-#define HEIGHT_BLUE_FILE  COLORDIR "/blu_height.clr"
++#define REFL_RED_FILE       COLORDIR "/red_reflectivity.clr"
++#define REFL_GREEN_FILE     COLORDIR "/grn_reflectivity.clr"
++#define REFL_BLUE_FILE      COLORDIR "/blu_reflectivity.clr"
++#define VEL_RED_FILE        COLORDIR "/red_velocity.clr"
++#define VEL_GREEN_FILE      COLORDIR "/grn_velocity.clr"
++#define VEL_BLUE_FILE       COLORDIR "/blu_velocity.clr"
++#define SW_RED_FILE         COLORDIR "/red_spectral_width.clr"
++#define SW_GREEN_FILE       COLORDIR "/grn_spectral_width.clr"
++#define SW_BLUE_FILE        COLORDIR "/blu_spectral_width.clr"
++#define HEIGHT_RED_FILE     COLORDIR "/red_height.clr"
++#define HEIGHT_GREEN_FILE   COLORDIR "/grn_height.clr"
++#define HEIGHT_BLUE_FILE    COLORDIR "/blu_height.clr"
+ #define RAINFALL_RED_FILE   COLORDIR "/red_rainfall.clr"
+ #define RAINFALL_GREEN_FILE COLORDIR "/grn_rainfall.clr"
+ #define RAINFALL_BLUE_FILE  COLORDIR "/blu_rainfall.clr"
+diff -ru rsl-v1.40/wsr88d.h rsl-v1.40.new/wsr88d.h
+--- rsl-v1.40/wsr88d.h 2004-03-12 17:12:09.000000000 +0000
++++ rsl-v1.40.new/wsr88d.h     2008-12-27 11:16:01.000000000 +0000
+@@ -7,7 +7,7 @@
+  * The directory should be the same as the LIBDIR in the makefile.
+  */
+ #ifndef WSR88D_SITE_INFO_FILE
+-#define WSR88D_SITE_INFO_FILE "/usr/local/trmm/GVBOX/lib/wsr88d_locations.dat"
++#define WSR88D_SITE_INFO_FILE DATADIR "/wsr88d_locations.dat"
+ #endif
+ /*===============================================================*/
+ typedef struct {
+diff -ru rsl-v1.40/doc/Makefile.am rsl-v1.40.new/doc/Makefile.am
+--- rsl-v1.40/doc/Makefile.am
++++ rsl-v1.40.new/doc/Makefile.am
+@@ -1,12 +1,3 @@
+ AUTOMAKE_OPTIONS = foreign
+-docdir = $(prefix)/doc/$(PACKAGE)
+-doc_DATA = *.html *.gif *.jpg
+-
+-EXTRA_DIST = $(doc_DATA) *.fig 
+-
+-install-exec-hook:
+-      -mkdir $(prefix)/doc
+-      -mkdir $(docdir)
+-      $(INSTALL) -m 444 ../README $(docdir)
+-      $(INSTALL) -m 444 ../CHANGES $(docdir)
++dist_doc_DATA = *.html *.gif *.jpg *.fig ../README ../CHANGES
diff --git a/sci-libs/rsl/files/rsl-type_str.patch b/sci-libs/rsl/files/rsl-type_str.patch
new file mode 100644 (file)
index 0000000..444d819
--- /dev/null
@@ -0,0 +1,75 @@
+--- rsl-v1.40/wsr88d_m31.c     2008-10-08 23:43:03.000000000 +0000
++++ rsl-mine/wsr88d_m31.c      2009-05-10 12:58:17.000000000 +0000
+@@ -546,6 +548,7 @@
+     Range (*invf)(float x);
+     float (*f)(Range x);
+     int vol_index, waveform;
++    char *type_str;
+     enum waveforms {surveillance=1, doppler_ambres, doppler_no_ambres, batch};
+@@ -572,10 +575,10 @@
+     if (wsr88d_ray.ray_hdr.dbptr_ref > 0) {
+       vol_index = wsr88d_get_vol_index(wsr88d_ray.ref->data_hdr.dataname);
+       switch (vol_index) {
+-          case DZ_INDEX: f = DZ_F; invf = DZ_INVF; break;
+-          case VR_INDEX: f = VR_F; invf = VR_INVF; break;
+-          case SW_INDEX: f = SW_F; invf = SW_INVF; break;
+-          default: f = DZ_F; invf = DZ_INVF; break;
++          case DZ_INDEX: f = DZ_F; invf = DZ_INVF; type_str = "Reflectivity";   break;
++          case VR_INDEX: f = VR_F; invf = VR_INVF; type_str = "Velocity";       break;
++          case SW_INDEX: f = SW_F; invf = SW_INVF; type_str = "Spectrum width"; break;
++          default:       f = DZ_F; invf = DZ_INVF; type_str = "Unknown";        break;
+       }
+       /* If this is reflectivity, check the waveform type to make sure
+        * it isn't from a Doppler split cut.
+@@ -591,6 +594,7 @@
+               radar->v[vol_index] = RSL_new_volume(MAXSWEEPS);
+               radar->v[vol_index]->h.f = f;
+               radar->v[vol_index]->h.invf = invf;
++                  radar->v[vol_index]->h.type_str = type_str;
+           }
+           if (radar->v[vol_index]->sweep[isweep] == NULL) {
+               radar->v[vol_index]->sweep[isweep] = RSL_new_sweep(MAXRAYS_M31);
+@@ -608,15 +612,16 @@
+     if (wsr88d_ray.ray_hdr.dbptr_vel > 0) {
+       vol_index = wsr88d_get_vol_index(wsr88d_ray.vel->data_hdr.dataname);
+       switch (vol_index) {
+-          case DZ_INDEX: f = DZ_F; invf = DZ_INVF; break;
+-          case VR_INDEX: f = VR_F; invf = VR_INVF; break;
+-          case SW_INDEX: f = SW_F; invf = SW_INVF; break;
+-          default: f = DZ_F; invf = DZ_INVF; break;
++          case DZ_INDEX: f = DZ_F; invf = DZ_INVF; type_str = "Reflectivity";   break;
++          case VR_INDEX: f = VR_F; invf = VR_INVF; type_str = "Velocity";       break;
++          case SW_INDEX: f = SW_F; invf = SW_INVF; type_str = "Spectrum width"; break;
++          default:       f = DZ_F; invf = DZ_INVF; type_str = "Unknown";        break;
+       }
+       if (radar->v[vol_index] == NULL) {
+           radar->v[vol_index] = RSL_new_volume(MAXSWEEPS);
+           radar->v[vol_index]->h.f = f;
+           radar->v[vol_index]->h.invf = invf;
++          radar->v[vol_index]->h.type_str = type_str;
+       }
+       if (radar->v[vol_index]->sweep[isweep] == NULL) {
+           radar->v[vol_index]->sweep[isweep] = RSL_new_sweep(MAXRAYS_M31);
+@@ -633,15 +638,16 @@
+     if (wsr88d_ray.ray_hdr.dbptr_sw > 0) {
+       vol_index = wsr88d_get_vol_index(wsr88d_ray.sw->data_hdr.dataname);
+       switch (vol_index) {
+-          case DZ_INDEX: f = DZ_F; invf = DZ_INVF; break;
+-          case VR_INDEX: f = VR_F; invf = VR_INVF; break;
+-          case SW_INDEX: f = SW_F; invf = SW_INVF; break;
+-          default: f = DZ_F; invf = DZ_INVF; break;
++          case DZ_INDEX: f = DZ_F; invf = DZ_INVF; type_str = "Reflectivity";   break;
++          case VR_INDEX: f = VR_F; invf = VR_INVF; type_str = "Velocity";       break;
++          case SW_INDEX: f = SW_F; invf = SW_INVF; type_str = "Spectrum width"; break;
++          default:       f = DZ_F; invf = DZ_INVF; type_str = "Unknown";        break;
+       }
+       if (radar->v[vol_index] == NULL) {
+           radar->v[vol_index] = RSL_new_volume(MAXSWEEPS);
+           radar->v[vol_index]->h.f = f;
+           radar->v[vol_index]->h.invf = invf;
++          radar->v[vol_index]->h.type_str = type_str;
+       }
+       if (radar->v[vol_index]->sweep[isweep] == NULL) {
+           radar->v[vol_index]->sweep[isweep] = RSL_new_sweep(MAXRAYS_M31);
diff --git a/sci-libs/rsl/files/rsl-valgrind.patch b/sci-libs/rsl/files/rsl-valgrind.patch
new file mode 100644 (file)
index 0000000..bf8016b
--- /dev/null
@@ -0,0 +1,135 @@
+diff -w -ru rsl-v1.40/wsr88d_m31.c rsl-v1.40.test/wsr88d_m31.c
+--- rsl-v1.40/wsr88d_m31.c     2008-10-08 23:43:03.000000000 +0000
++++ rsl-v1.40.test/wsr88d_m31.c        2009-05-14 10:06:23.000000000 +0000
+@@ -515,6 +515,7 @@
+     m1_ray.vol_cpat = vcp_data.vcp;
+     m1_ray.elev_num = ray_hdr.elev_num;
+     m1_ray.unam_rng = wsr88d_ray.unamb_rng;
++    m1_ray.nyq_vel  = wsr88d_ray.nyq_vel; // TODO: is this correct?
+     if (ray_hdr.azm_res != 1)
+       ray->h.beam_width = 1.0;
+     else ray->h.beam_width = 0.5;
+@@ -603,6 +604,8 @@
+           radar->v[vol_index]->sweep[isweep]->ray[iray] = ray;
+           radar->v[vol_index]->sweep[isweep]->h.nrays = iray+1;
+       }
++      free(wsr88d_ray.ref->data);
++      free(wsr88d_ray.ref);
+     }
+     if (wsr88d_ray.ray_hdr.dbptr_vel > 0) {
+@@ -628,6 +631,8 @@
+       wsr88d_load_ray_hdr(wsr88d_ray, ray);
+       radar->v[vol_index]->sweep[isweep]->ray[iray] = ray;
+       radar->v[vol_index]->sweep[isweep]->h.nrays = iray+1;
++      free(wsr88d_ray.vel->data);
++      free(wsr88d_ray.vel);
+     }
+     if (wsr88d_ray.ray_hdr.dbptr_sw > 0) {
+@@ -653,6 +658,8 @@
+       wsr88d_load_ray_hdr(wsr88d_ray, ray);
+       radar->v[vol_index]->sweep[isweep]->ray[iray] = ray;
+       radar->v[vol_index]->sweep[isweep]->h.nrays = iray+1;
++      free(wsr88d_ray.sw->data);
++      free(wsr88d_ray.sw);
+     }
+ }
+@@ -706,15 +713,27 @@
+  * at the WSR-88D Radar Operations Center web site.
+  */
+-    n = fread(&msghdr, sizeof(Wsr88d_msg_hdr), 1, wf->fptr);
+-
+-    /* printf("msgtype = %d\n", msghdr.msg_type); */
+-    msg_hdr_size = sizeof(Wsr88d_msg_hdr) - sizeof(msghdr.rpg);
+     radar = RSL_new_radar(MAX_RADAR_VOLUMES);
+     
+     while (! end_of_vos) {
++      /* Read current header */
++      n = fread(&msghdr, sizeof(Wsr88d_msg_hdr), 1, wf->fptr);
++      if (n < 1) {
++          fprintf(stderr,"Warning: load_wsr88d_m31_into_radar: ");
++          if (feof(wf->fptr) != 0) fprintf(stderr,
++                  "Unexpected end of file.\n");
++          else fprintf(stderr,"Failed reading msghdr.\n");
++          fprintf(stderr,"Current sweep number: %d\n"
++                  "Last ray read: %d\n", isweep+1, iray);
++          wsr88d_load_sweep_header(radar, isweep, wsr88d_ray);
++          return radar;
++      }
++
++      /* printf("msgtype = %d\n", msghdr.msg_type); */
++      msg_hdr_size = sizeof(Wsr88d_msg_hdr) - sizeof(msghdr.rpg);
++
+       if (msghdr.msg_type == 31) {
+           if (little_endian()) wsr88d_swap_m31_hdr(&msghdr);
+@@ -729,6 +748,18 @@
+           /* Load this ray into radar structure ray. */
+           wsr88d_load_ray_into_radar(wsr88d_ray, isweep, iray, radar);
+           iray++;
++
++          /* Check for end of sweep */
++          if (wsr88d_ray.ray_hdr.radial_status == END_OF_ELEV) {
++              wsr88d_load_sweep_header(radar, isweep, wsr88d_ray);
++              isweep++;
++              iray = 0;
++          }
++
++          if (wsr88d_ray.ray_hdr.radial_status == END_VOS) {
++              //wsr88d_load_sweep_header(radar, isweep, wsr88d_ray);
++              end_of_vos = 1;
++          }
+       }
+       else { /* msg_type not 31 */
+           n = fread(&non31_seg_remainder, sizeof(non31_seg_remainder), 1,
+@@ -748,33 +779,11 @@
+               radar->h.vcp = vcp_data.vcp;
+               /* printf("VCP = %d\n", vcp_data.vcp); */
+           }
++          /* TODO: check for end of sweep/volume */
+       }
+-      /* Check for end of sweep */
+-      if (wsr88d_ray.ray_hdr.radial_status == END_OF_ELEV) {
+-          wsr88d_load_sweep_header(radar, isweep, wsr88d_ray);
+-          isweep++;
+-          iray = 0;
+-      }
+-
+-      if (wsr88d_ray.ray_hdr.radial_status != END_VOS) {
+-          n = fread(&msghdr, sizeof(Wsr88d_msg_hdr), 1, wf->fptr);
+-          if (n < 1) {
+-              fprintf(stderr,"Warning: load_wsr88d_m31_into_radar: ");
+-              if (feof(wf->fptr) != 0) fprintf(stderr,
+-                      "Unexpected end of file.\n");
+-              else fprintf(stderr,"Failed reading msghdr.\n");
+-              fprintf(stderr,"Current sweep number: %d\n"
+-                      "Last ray read: %d\n", isweep+1, iray);
+-              wsr88d_load_sweep_header(radar, isweep, wsr88d_ray);
+-              return radar;
+-          }
+-      }
+-      else {
++      if (feof(wf->fptr) != 0)
+           end_of_vos = 1;
+-          wsr88d_load_sweep_header(radar, isweep, wsr88d_ray);
+-      }
+-      if (feof(wf->fptr) != 0) end_of_vos = 1;
+     }
+     return radar;
+diff -w -ru rsl-v1.40/wsr88d_to_radar.c rsl-v1.40.test/wsr88d_to_radar.c
+--- rsl-v1.40/wsr88d_to_radar.c        2008-07-30 22:41:20.000000000 +0000
++++ rsl-v1.40.test/wsr88d_to_radar.c   2009-05-14 10:07:09.000000000 +0000
+@@ -429,5 +429,6 @@
+       radar->h.lpulse = sitep->lpulse;
+               
+   radar = RSL_prune_radar(radar);
++  free(sitep);
+   return radar;
+ }
diff --git a/sci-libs/rsl/files/rsl-warnings.patch b/sci-libs/rsl/files/rsl-warnings.patch
new file mode 100644 (file)
index 0000000..ece00f3
--- /dev/null
@@ -0,0 +1,205 @@
+diff -ru rsl-v1.40/africa.c warnings/africa.c
+--- rsl-v1.40/africa.c 1999-12-01 03:48:29.000000000 +0000
++++ warnings/africa.c  2008-12-27 11:53:44.000000000 +0000
+@@ -22,6 +22,7 @@
+ */
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <string.h>
+ #include "africa.h"
+ int africa_read_buffer(FILE *fp, Africa_buffer *buffer)
+diff -ru rsl-v1.40/dorade_to_radar.c warnings/dorade_to_radar.c
+--- rsl-v1.40/dorade_to_radar.c        1999-12-01 03:48:29.000000000 +0000
++++ warnings/dorade_to_radar.c 2008-12-27 11:53:44.000000000 +0000
+@@ -24,7 +24,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
+-#include <strings.h>
++#include <string.h>
+ #define USE_RSL_VARS
+ #include "rsl.h"
+ #include "dorade.h"
+diff -ru rsl-v1.40/examples/any_to_gif.c warnings/examples/any_to_gif.c
+--- rsl-v1.40/examples/any_to_gif.c    1999-01-26 16:20:25.000000000 +0000
++++ warnings/examples/any_to_gif.c     2008-12-27 11:53:44.000000000 +0000
+@@ -73,7 +73,7 @@
+ }
+-void main(int argc, char **argv)
++int main(int argc, char **argv)
+ {
+   Radar *radar;
+   Sweep *sweep;
+diff -ru rsl-v1.40/examples/any_to_ppm.c warnings/examples/any_to_ppm.c
+--- rsl-v1.40/examples/any_to_ppm.c    1998-09-16 18:35:56.000000000 +0000
++++ warnings/examples/any_to_ppm.c     2008-12-27 11:53:44.000000000 +0000
+@@ -9,11 +9,12 @@
+  * the RSL.
+  *
+  */
++#include <stdlib.h>
+ #define USE_RSL_VARS
+ #include "rsl.h"
+-void main(int argc, char **argv)
++int main(int argc, char **argv)
+ {
+   Radar *radar;
+   Sweep *sweep;
+diff -ru rsl-v1.40/examples/cappi_image.c warnings/examples/cappi_image.c
+--- rsl-v1.40/examples/cappi_image.c   1998-09-16 18:35:56.000000000 +0000
++++ warnings/examples/cappi_image.c    2008-12-27 11:53:44.000000000 +0000
+@@ -7,6 +7,7 @@
+  */
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <string.h>
+ #include "rsl.h"
+diff -ru rsl-v1.40/examples/dorade_main.c warnings/examples/dorade_main.c
+--- rsl-v1.40/examples/dorade_main.c   1999-08-12 20:44:30.000000000 +0000
++++ warnings/examples/dorade_main.c    2008-12-27 11:53:44.000000000 +0000
+@@ -1,4 +1,5 @@
+ #include <stdio.h>
++#include <stdlib.h>
+ #include "rsl.h"
+ int main(int argc, char **argv)
+diff -ru rsl-v1.40/examples/killer_sweep.c warnings/examples/killer_sweep.c
+--- rsl-v1.40/examples/killer_sweep.c  1998-09-16 18:35:56.000000000 +0000
++++ warnings/examples/killer_sweep.c   2008-12-27 11:53:44.000000000 +0000
+@@ -146,7 +146,7 @@
+   }
+ }
+-void main(int argc, char **argv)
++int main(int argc, char **argv)
+ {
+   Radar *radar;
+   Sweep *sweep;
+diff -ru rsl-v1.40/examples/kwaj_subtract_one_day.c warnings/examples/kwaj_subtract_one_day.c
+--- rsl-v1.40/examples/kwaj_subtract_one_day.c 1999-08-13 14:26:40.000000000 +0000
++++ warnings/examples/kwaj_subtract_one_day.c  2008-12-27 11:53:44.000000000 +0000
+@@ -1,3 +1,4 @@
++#include <stdlib.h>
+ #include "rsl.h"
+ /**********************************************************************/
+diff -ru rsl-v1.40/examples/lassen_to_gif.c warnings/examples/lassen_to_gif.c
+--- rsl-v1.40/examples/lassen_to_gif.c 1998-09-16 18:35:56.000000000 +0000
++++ warnings/examples/lassen_to_gif.c  2008-12-27 11:53:44.000000000 +0000
+@@ -4,9 +4,10 @@
+  * This program can read the file from stdin.
+  */
++#include <stdlib.h>
+ #include "rsl.h"
+-void main(int argc, char **argv)
++int main(int argc, char **argv)
+ {
+   Radar *radar;
+diff -ru rsl-v1.40/examples/print_hash_table.c warnings/examples/print_hash_table.c
+--- rsl-v1.40/examples/print_hash_table.c      1998-09-16 18:35:56.000000000 +0000
++++ warnings/examples/print_hash_table.c       2008-12-27 11:53:44.000000000 +0000
+@@ -9,6 +9,7 @@
+  *
+  */
++#include <stdlib.h>
+ #include "rsl.h"
+ void print_link_list(Azimuth_hash *list)
+@@ -87,7 +88,7 @@
+ }
+-void main(int argc, char **argv)
++int main(int argc, char **argv)
+ {
+   Radar *radar;
+   Sweep *sweep;
+diff -ru rsl-v1.40/examples/sector.c warnings/examples/sector.c
+--- rsl-v1.40/examples/sector.c        1998-09-16 18:35:57.000000000 +0000
++++ warnings/examples/sector.c 2008-12-27 11:53:44.000000000 +0000
+@@ -1,4 +1,5 @@
+ #include <stdio.h>
++#include <stdlib.h>
+ #include "rsl.h"
+ /*
+@@ -84,7 +85,7 @@
+ }
+-void main(int argc, char **argv)
++int main(int argc, char **argv)
+ {
+   Radar *radar;
+   Sweep *sector;
+diff -ru rsl-v1.40/examples/wsr88d_to_gif.c warnings/examples/wsr88d_to_gif.c
+--- rsl-v1.40/examples/wsr88d_to_gif.c 1998-09-16 18:35:57.000000000 +0000
++++ warnings/examples/wsr88d_to_gif.c  2008-12-27 11:53:44.000000000 +0000
+@@ -14,9 +14,10 @@
+  * wsr88d_to_gif file [tape_header_file]
+  */
++#include <stdlib.h>
+ #include "rsl.h"
+-void main(int argc, char **argv)
++int main(int argc, char **argv)
+ {
+   Radar *radar;
+diff -ru rsl-v1.40/lassen_to_radar.c warnings/lassen_to_radar.c
+--- rsl-v1.40/lassen_to_radar.c        2008-07-24 13:40:50.000000000 +0000
++++ warnings/lassen_to_radar.c 2008-12-27 11:53:44.000000000 +0000
+@@ -31,6 +31,7 @@
+ */
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <unistd.h>
+ #include <string.h>
+ #include <math.h>
+diff -ru rsl-v1.40/rainbow.c warnings/rainbow.c
+--- rsl-v1.40/rainbow.c        2004-02-10 17:10:28.000000000 +0000
++++ warnings/rainbow.c 2008-12-27 11:53:44.000000000 +0000
+@@ -22,6 +22,7 @@
+ */
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <string.h>
+ #include "rsl.h"
+ #include "rainbow.h"
+diff -ru rsl-v1.40/rainbow_to_radar.c warnings/rainbow_to_radar.c
+--- rsl-v1.40/rainbow_to_radar.c       2004-02-11 16:54:37.000000000 +0000
++++ warnings/rainbow_to_radar.c        2008-12-27 11:53:44.000000000 +0000
+@@ -22,6 +22,7 @@
+ */
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <string.h>
+ #include "rsl.h"
+ #include "rainbow.h"
+diff -ru rsl-v1.40/wsr88d_m31.c warnings/wsr88d_m31.c
+--- rsl-v1.40/wsr88d_m31.c     2008-10-08 23:43:03.000000000 +0000
++++ warnings/wsr88d_m31.c      2008-12-27 11:53:44.000000000 +0000
+@@ -25,6 +25,8 @@
+  * This file contains routines for processing Message Type 31, the digital
+  * radar message type introduced in WSR-88D Level II Build 10.
+  */
++#include <stdlib.h>
++#include <string.h>
+ #include "rsl.h"
+ #include "wsr88d.h"
diff --git a/sci-libs/rsl/metadata.xml b/sci-libs/rsl/metadata.xml
new file mode 100644 (file)
index 0000000..d21d118
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>sci-geosciences</herd>
+</pkgmetadata>
diff --git a/sci-libs/rsl/rsl-1.40.ebuild b/sci-libs/rsl/rsl-1.40.ebuild
new file mode 100644 (file)
index 0000000..f8e6220
--- /dev/null
@@ -0,0 +1,32 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+inherit eutils autotools
+
+DESCRIPTION="Radar Software Library"
+HOMEPAGE="http://trmm-fc.gsfc.nasa.gov/trmm_gv/software/rsl/index.html"
+SRC_URI="ftp://trmm-fc.gsfc.nasa.gov/software/${PN}-v${PV}.tar.gz"
+
+LICENSE="LGPL-2"
+SLOT="0"
+KEYWORDS="~x86"
+IUSE=""
+
+RDEPEND="sci-libs/hdf
+       media-libs/jpeg"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/rsl-v${PV}"
+
+src_unpack() {
+       unpack ${A}
+       cd "${S}"
+       epatch "${FILESDIR}/${PN}-"{warnings,automake,type_str,valgrind}".patch"
+       eautoreconf
+}
+
+src_install() {
+       emake DESTDIR="${D}" install || die "install failed"
+       dodoc README CHANGES || die
+}