]> Pileus Git - ~andy/sunrise/blob - sci-libs/rsl/files/rsl-automake.patch
sci-libs/rsl: Update to RSL 1.43
[~andy/sunrise] / sci-libs / rsl / files / rsl-automake.patch
1 Update automake files
2
3 * Avoid modifying source code at compile time
4 * Avoid install-exec-hook
5 --- a/colors/Makefile.am
6 +++ b/colors/Makefile.am
7 @@ -1,6 +1,6 @@
8  AUTOMAKE_OPTIONS = foreign
9  
10 -colordir = $(prefix)/lib/colors
11 +colordir = $(datadir)/rsl1/colors
12  color_DATA = *.???
13  
14  EXTRA_DIST = $(color_DATA)
15 --- a/Makefile.am
16 +++ b/Makefile.am
17 @@ -1,72 +1,48 @@
18  ## Process w/ automake.  Or, autoreconf; make ##
19 +AM_CFLAGS = -DDATADIR="\"$(datadir)/rsl1\""
20  AUTOMAKE_OPTIONS = foreign
21  SUBDIRS = . colors doc examples
22  INCLUDES = -I. -I$(srcdir) -I$(prefix)/include -I$(prefix)/toolkit/include
23  
24 -includedir = $(prefix)/include 
25 -colordir = $(libdir)/colors
26 -
27  lib_LTLIBRARIES = librsl.la
28  
29 -librsl_la_LDFLAGS = -version-info 1:43
30 -librsl_la_SOURCES = \
31 -$(rapic_c) $(radtec_c)\
32 -dorade.c dorade_print.c dorade_to_radar.c\
33 -lassen.c lassen_to_radar.c \
34 - radar.c volume.c image_gen.c cappi.c fraction.c read_write.c farea.c \
35 - range.c radar_to_uf.c uf_to_radar.c wsr88d_to_radar.c \
36 - carpi.c cube.c sort_rays.c toga_to_radar.c gts.c histogram.c \
37 - ray_indexes.c anyformat_to_radar.c get_win.c endian.c mcgill_to_radar.c \
38 - mcgill.c interp.c toga.c wsr88d.c wsr88d_get_site.c wsr88d_m31.c \
39 - gzip.c prune.c reverse.c fix_headers.c \
40 - nsig_to_radar.c nsig.c nsig2_to_radar.c \
41 - africa_to_radar.c africa.c \
42 - radar_to_hdf_2.c hdf_to_radar.c toolkit_memory_mgt.c \
43 - radar_to_hdf_1.c rainbow.c rainbow_to_radar.c $(headers)
44 -
45 -librsl_la_DEPENDENCIES = $(build_headers)
46 +wsr88ddir = $(datadir)/rsl1/
47 +dist_wsr88d_DATA = wsr88d_locations.dat
48  
49 -build_headers = rsl.h wsr88d.h toolkit_1BC-51_appl.h
50 +include_HEADERS = rsl.h toolkit_1BC-51_appl.h
51  
52  headers = africa.h dorade.h lassen.h \
53            mcgill.h nsig.h radtec.h rainbow.h \
54            rapic_routines.h toga.h \
55 -                 $(build_headers)
56 +          wsr88d.h \
57 +         $(include_HEADERS)
58 +
59 +librsl_la_LDFLAGS = -version-info 1:43
60 +librsl_la_SOURCES = \
61 +    $(rapic_c) $(radtec_c) \
62 +    dorade.c dorade_print.c dorade_to_radar.c \
63 +    lassen.c lassen_to_radar.c \
64 +    radar.c volume.c image_gen.c cappi.c fraction.c read_write.c farea.c \
65 +    range.c radar_to_uf.c uf_to_radar.c wsr88d_to_radar.c \
66 +    carpi.c cube.c sort_rays.c toga_to_radar.c gts.c histogram.c \
67 +    ray_indexes.c anyformat_to_radar.c get_win.c endian.c mcgill_to_radar.c \
68 +    mcgill.c interp.c toga.c wsr88d.c wsr88d_get_site.c wsr88d_m31.c \
69 +    gzip.c prune.c reverse.c fix_headers.c \
70 +    nsig_to_radar.c nsig.c nsig2_to_radar.c \
71 +    africa_to_radar.c africa.c \
72 +    radar_to_hdf_2.c hdf_to_radar.c toolkit_memory_mgt.c \
73 +    radar_to_hdf_1.c rainbow.c rainbow_to_radar.c $(headers)
74 +
75  
76  rapic_c =  rapic_to_radar.c rapic.y rapic-lex.l rapic_routines.c
77  radtec_c = radtec_to_radar.c radtec.c
78  
79  
80 -rsl.h: Makefile
81 -       @for h in $(build_headers); do \
82 -       echo -n "Checking substitutions in header file $$h ... "; \
83 -       cp $$h $$h.in; \
84 -       sed -e 's/RSL_VERSION_STR.*/RSL_VERSION_STR \"$(VERSION)\"/' \
85 -         -e 's|#define COLORDIR.*|#define COLORDIR \"$(colordir)\"|' \
86 -         -e 's|#define WSR88D_SITE_INFO_FILE.*|#define WSR88D_SITE_INFO_FILE \"$(libdir)/wsr88d_locations.dat\"|' \
87 -    < $$h.in > $$h.new; \
88 -       if cmp -s $$h $$h.new; then \
89 -       rm $$h.new; \
90 -       echo "$$h remains untouched."; \
91 -    else \
92 -       mv $$h.new $$h; \
93 -       echo "substitutions made in $$h."; \
94 -    fi; \
95 -       rm -f $$h.in; \
96 -    done
97 -
98  PREFIX = rapic
99  LFLAGS = -P$(PREFIX)
100  YFLAGS = -d -p $(PREFIX)
101  LEX_OUTPUT_ROOT = lex.$(PREFIX)
102  
103 -
104 -install-exec-hook:
105 -       $(INSTALL) -d  $(includedir)
106 -       $(INSTALL) -m 644 rsl.h $(includedir)
107 -       $(INSTALL) -m 644 toolkit_1BC-51_appl.h $(includedir)
108 -       $(INSTALL) -m 644 wsr88d_locations.dat $(libdir)
109 -
110  EXTRA_DIST = CHANGES Copyright GPL LGPL wsr88d_locations.dat rapic.h
111  
112  DISTCLEANFILES = rapic.c rapic-lex.c
113 --- a/radar.c
114 +++ b/radar.c
115 @@ -60,7 +60,7 @@
116  
117  void RSL_print_version()
118  {
119 -  printf("RSL version %s.\n", RSL_VERSION_STR);
120 +  printf("RSL version %s.\n", VERSION);
121  }
122  
123  /* Debug printing global variable: radar_verbose_flag */
124 --- a/radar_to_uf.c
125 +++ b/radar_to_uf.c
126 @@ -321,7 +321,7 @@ void RSL_radar_to_uf_fp(Radar *r, FILE *fp)
127          uf_ma[37] = tm->tm_year % 100; /* Same format as data year */
128          uf_ma[38] = tm->tm_mon+1;
129          uf_ma[39] = tm->tm_mday;
130 -        memcpy(&uf_ma[40], "RSL" RSL_VERSION_STR, 8);
131 +        memcpy(&uf_ma[40], "RSL" VERSION, 8);
132          if (little_endian()) swap2(&uf_ma[40], 8/2);
133          uf_ma[44] = (signed short)UF_NO_DATA;
134          len_ma = 45;
135 --- a/read_write.c
136 +++ b/read_write.c
137 @@ -314,7 +314,7 @@ int RSL_write_radar_fp(Radar *radar, FILE *fp)
138    if (radar == NULL) return 0;
139    
140    memset(title, 0, sizeof(title));
141 -  (void)sprintf(title, "RSL v%s. sizeof(Range) %d", RSL_VERSION_STR, sizeof(Range));
142 +  (void)sprintf(title, "RSL v%s. sizeof(Range) %d", VERSION, sizeof(Range));
143    n += fwrite(title, sizeof(char), sizeof(title), fp);
144    
145    memset(header_buf, 0, sizeof(header_buf));
146 --- a/rsl.h
147 +++ b/rsl.h
148 @@ -27,8 +27,6 @@
149  #include "config.h"
150  #endif
151  
152 -#define RSL_VERSION_STR "v1.43"
153 -
154  /**********************************************************************/
155  /* Configure: Define USE_TWO_BYTE_PRECISION to have RSL store internal*/
156  /*            values with two bytes.  Otherwise, use one byte.        */
157 @@ -46,7 +44,7 @@
158  /*            so you shouldn't have to modify anything here.          */
159  /**********************************************************************/
160  #ifndef COLORDIR
161 -#define COLORDIR "/usr/local/trmm/lib/colors"
162 +#define COLORDIR DATADIR "/colors"
163  #endif
164  
165  /* These are the color table indexes. See RSL_set/get_color_table. */
166 @@ -57,18 +55,18 @@
167  /* The default color tables for reflectivity, velocity, spectral width,
168   * height, rainfall, and zdr.
169   */
170 -#define REFL_RED_FILE   COLORDIR "/red_reflectivity.clr"
171 -#define REFL_GREEN_FILE COLORDIR "/grn_reflectivity.clr"
172 -#define REFL_BLUE_FILE  COLORDIR "/blu_reflectivity.clr"
173 -#define VEL_RED_FILE    COLORDIR "/red_velocity.clr"
174 -#define VEL_GREEN_FILE  COLORDIR "/grn_velocity.clr"
175 -#define VEL_BLUE_FILE   COLORDIR "/blu_velocity.clr"
176 -#define SW_RED_FILE     COLORDIR "/red_spectral_width.clr"
177 -#define SW_GREEN_FILE   COLORDIR "/grn_spectral_width.clr"
178 -#define SW_BLUE_FILE    COLORDIR "/blu_spectral_width.clr"
179 -#define HEIGHT_RED_FILE   COLORDIR "/red_height.clr"
180 -#define HEIGHT_GREEN_FILE COLORDIR "/grn_height.clr"
181 -#define HEIGHT_BLUE_FILE  COLORDIR "/blu_height.clr"
182 +#define REFL_RED_FILE       COLORDIR "/red_reflectivity.clr"
183 +#define REFL_GREEN_FILE     COLORDIR "/grn_reflectivity.clr"
184 +#define REFL_BLUE_FILE      COLORDIR "/blu_reflectivity.clr"
185 +#define VEL_RED_FILE        COLORDIR "/red_velocity.clr"
186 +#define VEL_GREEN_FILE      COLORDIR "/grn_velocity.clr"
187 +#define VEL_BLUE_FILE       COLORDIR "/blu_velocity.clr"
188 +#define SW_RED_FILE         COLORDIR "/red_spectral_width.clr"
189 +#define SW_GREEN_FILE       COLORDIR "/grn_spectral_width.clr"
190 +#define SW_BLUE_FILE        COLORDIR "/blu_spectral_width.clr"
191 +#define HEIGHT_RED_FILE     COLORDIR "/red_height.clr"
192 +#define HEIGHT_GREEN_FILE   COLORDIR "/grn_height.clr"
193 +#define HEIGHT_BLUE_FILE    COLORDIR "/blu_height.clr"
194  #define RAINFALL_RED_FILE   COLORDIR "/red_rainfall.clr"
195  #define RAINFALL_GREEN_FILE COLORDIR "/grn_rainfall.clr"
196  #define RAINFALL_BLUE_FILE  COLORDIR "/blu_rainfall.clr"
197 --- a/wsr88d.h
198 +++ b/wsr88d.h
199 @@ -7,7 +7,7 @@
200   * The directory should be the same as the LIBDIR in the makefile.
201   */
202  #ifndef WSR88D_SITE_INFO_FILE
203 -#define WSR88D_SITE_INFO_FILE "/usr/local/trmm/lib/wsr88d_locations.dat"
204 +#define WSR88D_SITE_INFO_FILE DATADIR "/wsr88d_locations.dat"
205  #endif
206  /*===============================================================*/
207  typedef struct {
208 --- a/doc/Makefile.am
209 +++ b/doc/Makefile.am
210 @@ -1,12 +1,3 @@
211  AUTOMAKE_OPTIONS = foreign
212  
213 -docdir = $(prefix)/doc/$(PACKAGE)
214 -doc_DATA = *.html *.gif *.jpg
215 -
216 -EXTRA_DIST = $(doc_DATA) *.fig 
217 -
218 -install-exec-hook:
219 -       -mkdir $(prefix)/doc
220 -       -mkdir $(docdir)
221 -       $(INSTALL) -m 444 ../README $(docdir)
222 -       $(INSTALL) -m 444 ../CHANGES $(docdir)
223 +dist_doc_DATA = *.html *.gif *.jpg *.fig ../README ../CHANGES