[eso-midas] 01/02: Re-organize patches: split them into smaller

Ole Streicher olebole at moszumanska.debian.org
Thu Mar 19 10:32:01 UTC 2015


This is an automated email from the git hooks/post-receive script.

olebole pushed a commit to branch debian
in repository eso-midas.

commit 6c07343a88f6ef3aa2ca3101676542a99ae8833a
Author: Ole Streicher <debian at liska.ath.cx>
Date:   Thu Mar 19 10:44:51 2015 +0100

    Re-organize patches: split them into smaller
---
 debian/patches/debian_setup.patch                  |  66 ++++++++
 debian/patches/dont_compile_sp_pty.patch           |  17 ++
 debian/patches/dont_strip_during_build.patch       |  29 ++++
 debian/patches/fix_cleanmidas.patch                |  24 +++
 debian/patches/fix_fitswdm_c.patch                 |  49 ++++++
 debian/patches/fix_library_search_path.patch       |  13 ++
 debian/patches/fix_off_by_one_definitions.patch    |  45 +++++
 debian/patches/fix_trivial_errors.patch            |  93 ----------
 debian/patches/fix_unknown_type.patch              |  28 +++
 debian/patches/fix_x11_include_path.patch          |  13 ++
 ...tput-to-stdout.patch => output_to_stdout.patch} |   0
 debian/patches/propagate_cflags.patch              |  77 +++++++++
 debian/patches/remove_pointer_conversion.patch     |  27 +++
 ...-sys_errlist.patch => remove_sys_errlist.patch} |   0
 debian/patches/resolve_conflictig_macro.patch      |  15 ++
 debian/patches/series                              |  18 +-
 debian/patches/setup-debian.patch                  | 188 ---------------------
 debian/patches/system_readline.patch               |   2 +-
 18 files changed, 418 insertions(+), 286 deletions(-)

diff --git a/debian/patches/debian_setup.patch b/debian/patches/debian_setup.patch
new file mode 100644
index 0000000..f0fa64f
--- /dev/null
+++ b/debian/patches/debian_setup.patch
@@ -0,0 +1,66 @@
+Author: Ole Streicher <olebole at debian.org>
+Description: Debian specific setup
+--- a/install/unix/preinstall
++++ b/install/unix/preinstall
+@@ -121,7 +121,10 @@
+ urels=`(uname -r) 2>/dev/null`
+ machine=`(uname -m) 2>/dev/null`
+ 
+-if [ "$uname" = "Darwin" ]; then
++if [ -d "Debian" -a -f "/etc/debian_version" ];  then
++    system="Debian"
++
++elif [ "$uname" = "Darwin" ]; then
+     system="Darwin"
+ 
+ elif [ "$machine" = "x86_64" ]; then
+--- /dev/null
++++ b/install/unix/systems/Debian/make_options
+@@ -0,0 +1,10 @@
++CC=gcc
++F_OPT=
++C_OPT=
++SYS=-DGCC
++SLIB=-Wl,-rpath,/usr/lib/eso-midas/$(MIDVERS)/lib
++SH_OPT=-fPIC
++SH_CMD=$(MIDASHOME)/$(MIDVERS)/local/make_shared
++GUI_OPT=-DPATH_MAX=1024
++EDITFLAGS=-DVOID_SIGHANDLER -DHAVE_ALLOCA -DHAVE_ALLOCA_H -DHAVE_GETPW_DECLS -DHAVE_DIRENT_H -DHAVE_STRING_H -DLinux -DHAVE_UNISTD_H -DHAVE_STDLIB_H
++EDITLIBS=-lncurses
+--- /dev/null
++++ b/install/unix/systems/Debian/make_shared
+@@ -0,0 +1,6 @@
++#!/bin/sh
++shift
++library=`basename $1 | sed 's/\.so\..*$//'`
++gcc $LDFLAGS -shared -Wl,-soname,$1 -o $* -lm
++rm -f $library.so
++ln -s $1 $library.so
+--- /dev/null
++++ b/install/unix/systems/Debian/setup
+@@ -0,0 +1,4 @@
++host_os=Debian
++debugger=gdb
++ps_print="lpr -h"
++ascii_print="lpr -h -P"
+--- a/system/unix/inmidas
++++ b/system/unix/inmidas
+@@ -425,7 +425,7 @@
+ #
+ os=`uname`
+ case "$os" in
+-    "SunOS"|"Linux")
++    SunOS|Linux|GNU|GNU/*)
+ 	if [ -z "$LD_LIBRARY_PATH" ] ; then
+ 	  LD_LIBRARY_PATH=$MIDASHOME/$MIDVERS/lib
+ 	else
+--- a/test/prim/veriall.prg
++++ b/test/prim/veriall.prg
+@@ -204,6 +204,7 @@
+       write/keyw in_b MID_WORK:veriall_{out_b(1:{inputi})}.{inputc}
+    endif
+ endif
++write/keyw in_b  MID_WORK:veriall_debian.{inputc}
+ open/file {in_b} write  fc
+ if fc(1) .lt. 0 then
+    write/out Could not create file: "MID_WORK:veriall_{out_b}.{inputc} ..."
diff --git a/debian/patches/dont_compile_sp_pty.patch b/debian/patches/dont_compile_sp_pty.patch
new file mode 100644
index 0000000..c95893d
--- /dev/null
+++ b/debian/patches/dont_compile_sp_pty.patch
@@ -0,0 +1,17 @@
+Author: Ole Streicher <olebole at debian.org>
+Description: Dont compile gui/GraphLib/libsrc/uimxR5/src/sp_pty.c
+ This file uses either nonportable termio, or sgtty which is not available
+ everywhere (again, Hurd and FreeBSD are the examples here). In principle
+ it could be rewritten to use termios (which is standard today); however
+ the functions from this file are not needed in midas; therefore it is
+ simpler just not to compile this.
+--- a/gui/GraphLib/libsrc/uimxR5/src/makefile
++++ b/gui/GraphLib/libsrc/uimxR5/src/makefile
+@@ -65,7 +65,6 @@
+         subproc.o\
+ 	sp_utils.o\
+ 	sp_spmd.o\
+-	sp_pty.o\
+ 	swidget.o \
+         t_error.o\
+         uimx.o\
diff --git a/debian/patches/dont_strip_during_build.patch b/debian/patches/dont_strip_during_build.patch
new file mode 100644
index 0000000..5a091ad
--- /dev/null
+++ b/debian/patches/dont_strip_during_build.patch
@@ -0,0 +1,29 @@
+Author: Ole Streicher <olebole at debian.org>
+Description: Don't strip binaries during build
+ This allows a debugging during packaging. The binaries are stripped
+ later with dh_strip.
+--- a/install/unix/install1
++++ b/install/unix/install1
+@@ -536,9 +536,9 @@
+    fi
+ else
+    echo "NOT FOUND."
+-   echo "*** STRIP set to echo."
+-   ed_moptions add STRIP=echo >/dev/null
+ fi
++echo "*** STRIP set to echo."
++ed_moptions add STRIP=echo >/dev/null
+ #*************** END: Checking the strip command **************
+ 
+ #*************** START: Checking the ranlib command ***********
+--- a/install/unix/default_mk
++++ b/install/unix/default_mk
+@@ -32,7 +32,7 @@
+ LD77_OPT = $(LDFLAGS)
+ LD77 = $(LD77_CMD) $(LD77_OPT)
+ RANLIB = ranlib
+-STRIP = strip
++STRIP = echo
+ AR = ar
+ AR_OPT = ruv
+ AR_XOPT = xv
diff --git a/debian/patches/fix_cleanmidas.patch b/debian/patches/fix_cleanmidas.patch
new file mode 100644
index 0000000..53f2347
--- /dev/null
+++ b/debian/patches/fix_cleanmidas.patch
@@ -0,0 +1,24 @@
+Author: Ole Streicher <olebole at debian.org>
+Description: Use predefined MIDVERS and MIDASHOME in cleanmidas
+ Cleanmidas assumes the the parent directory of "15FEBpl1.1" is "midas",
+ which is not required in the installation guide.
+--- a/system/unix/cleanmidas
++++ b/system/unix/cleanmidas
+@@ -54,11 +54,13 @@
+         [ $answer = y ]
+ }
+ 
+-
+ MID_HERE=`pwd`
+-MIDVERS=`echo $MID_HERE | sed 's/^.*midas\/\([^\/]*\).*$/\1/'`
+-MIDASHOME=`echo $MID_HERE | sed 's/\/'$MIDVERS'.*$//'`
+-
++if [ -z "$MIDVERS" ] ; then
++  MIDVERS=`echo $MID_HERE | sed 's/^.*midas\/\([^\/]*\).*$/\1/'`
++fi
++if [ -z "$MIDASHOME" ] ; then
++  MIDASHOME=`echo $MID_HERE | sed 's/\/'$MIDVERS'.*$//'`
++fi
+ MID_HOME=$MIDASHOME/$MIDVERS
+ 
+ export MIDASHOME MIDVERS
diff --git a/debian/patches/fix_fitswdm_c.patch b/debian/patches/fix_fitswdm_c.patch
new file mode 100644
index 0000000..4ec9bee
--- /dev/null
+++ b/debian/patches/fix_fitswdm_c.patch
@@ -0,0 +1,49 @@
+Author: Ole Streicher <olebole at debian.org>
+Description: fix nullification of fitswdm.c
+ Fitswdm.c uses toNULLLONG to set an integer to some minimal value
+ (funnily, not 0 but LONG_MIN!). However, this will lead to a wrong
+ result if long!=int, since the argument is an int. On LinuxAMD64, this
+ was fixed, but not generally. This patch make the special case for
+ LinuxAMD64 as the general one.
+--- a/prim/dio/libsrc/fitswdm.c
++++ b/prim/dio/libsrc/fitswdm.c
+@@ -237,12 +237,7 @@
+          {                      /* NULL fill if needed  */
+          pi = p.i + ns;
+          i = n - ns;
+-
+-#ifdef LinuxAMD64
+          while (i--) toNULLINT (*pi++);
+-#else
+-         while (i--) toNULLLONG (*pi++);
+-#endif
+          }
+       ioff += n;
+       np = 4 * ns;
+@@ -279,12 +274,7 @@
+          while (n--)
+          if (isNULLFLOAT (*pf))
+             {
+-
+-#ifdef LinuxAMD64
+             toNULLINT (*pi++);
+-#else
+-            toNULLLONG (*pi++);
+-#endif
+             *pf++;
+             }
+          else
+@@ -332,12 +322,7 @@
+          while (n--)
+          if (isNULLFLOAT (*pd))
+             {
+-
+-#ifdef LinuxAMD64
+             toNULLINT (*pi++);
+-#else
+-            toNULLLONG (*pi++);
+-#endif
+             *pd++;
+             }
+          else
+
diff --git a/debian/patches/fix_library_search_path.patch b/debian/patches/fix_library_search_path.patch
new file mode 100644
index 0000000..8ab5d12
--- /dev/null
+++ b/debian/patches/fix_library_search_path.patch
@@ -0,0 +1,13 @@
+Author: Ole Streicher <olebole at debian.org>
+Description: Add the library search path to shared lib creation command
+--- a/lib/makefile
++++ b/lib/makefile
+@@ -82,7 +82,7 @@
+ 	$(AR) $(AR_OPT) $(LIBGMIDAS) *.o
+ 	rm -f __*
+ 	$(RANLIB) $(LIBGMIDAS)
+-	$(SH_CMD) -o $(LIBGMIDAS_SH) *.o -L -lmidas $(DEV_NULL)
++	$(SH_CMD) -o $(LIBGMIDAS_SH) *.o -L$(LIBDIR) $(SLIB) -lmidas $(DEV_NULL)
+ 	rm -f *.o
+ 
+ clean:
diff --git a/debian/patches/fix_off_by_one_definitions.patch b/debian/patches/fix_off_by_one_definitions.patch
new file mode 100644
index 0000000..f3ec9f0
--- /dev/null
+++ b/debian/patches/fix_off_by_one_definitions.patch
@@ -0,0 +1,45 @@
+Author: Ole Streicher <olebole at debian.org>
+Description: Fix some definitions which are one byte too short
+ stdred/do/libsrc/ostcrea.c and gui/XDo/src/applic.c have "char []"
+ defined one element too short. This will fail in lines 188 resp.
+ 362ff./672ff. of these files: F.e. ostrea.c has
+ .
+  char   *line,cpos[4];         // (line 130)
+  ...
+     else strcpy(cext,".bdf"); // (line 188)
+ .
+ (applic.c is similar)
+ .
+ In these cases, the trailing '\0' char does not fit into the reserved
+ char length. Increasing them by one will solve this.
+--- a/stdred/do/libsrc/ostcrea.c
++++ b/stdred/do/libsrc/ostcrea.c
+@@ -94,7 +94,7 @@
+ double otimetomjd();
+ int listtype,no,tidtemp,colfile,nenttemp,lname;
+ int kuni;
+-char cext[4];
++char cext[5];
+ char   finame[128],diname[128];
+ 
+ /*
+--- a/gui/XDo/src/applic.c
++++ b/gui/XDo/src/applic.c
+@@ -307,7 +307,7 @@
+ extern swidget myerror;
+ extern int tidost;
+ int i,col,len,fin,colnew,ncol,dummy,index;
+-char label[TBL_LABLEN+1],op[2],crit[256];
++char label[TBL_LABLEN+1],op[3],crit[256];
+ char mymess[60];
+ index = strscans(descr,":#");
+ if (!descr[index]) {
+@@ -670,7 +670,7 @@
+ {
+ extern int tidcomm;
+ int col,pid,val;
+-char cval[1];
++char cval[2];
+ TCTINI("TAB_COMM",F_TRANS,F_O_MODE,3,1,&tidcomm);
+ TCCINI(tidcomm,D_I4_FORMAT,1,"I6"," ","PID",&col);
+ TCCINI(tidcomm,D_C_FORMAT,60,"A20"," ","OST",&col);
diff --git a/debian/patches/fix_trivial_errors.patch b/debian/patches/fix_trivial_errors.patch
deleted file mode 100644
index 7e205a2..0000000
--- a/debian/patches/fix_trivial_errors.patch
+++ /dev/null
@@ -1,93 +0,0 @@
-Author: Ole Streicher <olebole at debian.org>
-Description: Fix/circumvent some trivial errors
---- a/gui/GraphLib/libsrc/uimxR5/src/makefile
-+++ b/gui/GraphLib/libsrc/uimxR5/src/makefile
-@@ -65,7 +65,6 @@
-         subproc.o\
- 	sp_utils.o\
- 	sp_spmd.o\
--	sp_pty.o\
- 	swidget.o \
-         t_error.o\
-         uimx.o\
---- a/incl/proto_os.h
-+++ b/incl/proto_os.h
-@@ -18,6 +18,7 @@
- 
- /* to avoid generic complains for strlen() */
- #include <string.h>
-+#include <sys/types.h>
- 
- #ifdef  __cplusplus
- extern "C" {
---- a/stdred/feros/incl/u_const.h
-+++ b/stdred/feros/incl/u_const.h
-@@ -110,7 +110,6 @@
- 
- #define min(X, Y) (((X) < (Y)) ? (X) : (Y))    /* Minimum von X,Y     */
- #define max(X, Y) (((X) > (Y)) ? (X) : (Y))    /* Maximum von X,Y     */
--#define abs(X) (((X) >= 0) ? (X) : -(X))       /* Absolutbetrag von X */
- #define sign(X, Y) (((Y) < 0) ? -abs(X) : abs(X))  /* Vorzeichen von  */
-                                                /* Y mal abs(X)        */
- #define sqr(X) ((X) * (X))                     /* Quadrat von X       */
---- a/stdred/do/libsrc/ostcrea.c
-+++ b/stdred/do/libsrc/ostcrea.c
-@@ -94,7 +94,7 @@
- double otimetomjd();
- int listtype,no,tidtemp,colfile,nenttemp,lname;
- int kuni;
--char cext[4];
-+char cext[5];
- char   finame[128],diname[128];
- 
- /*
---- a/stdred/mos/libsrc/misc.c
-+++ b/stdred/mos/libsrc/misc.c
-@@ -25,6 +25,8 @@
- #endif
- #include <gl_defs.h>
- 
-+extern char *strstrs();
-+
- /* check for the existence of 'file' with the extension 'ext' (incl. dot) */
- #ifdef __STDC__
-    int file_exists( char *file, char *ext )
-@@ -43,7 +45,7 @@
- 	    break;
- 	}
- 
--    if ( (int) strstrs(file, ext) == 0 )
-+    if ( strstrs(file, ext) == NULL )
-     	sprintf( fileext, "%s%s", file, ext );
-     else
- 	strcpy( fileext, file );
---- a/gui/XDo/src/applic.c
-+++ b/gui/XDo/src/applic.c
-@@ -307,7 +307,7 @@
- extern swidget myerror;
- extern int tidost;
- int i,col,len,fin,colnew,ncol,dummy,index;
--char label[TBL_LABLEN+1],op[2],crit[256];
-+char label[TBL_LABLEN+1],op[3],crit[256];
- char mymess[60];
- index = strscans(descr,":#");
- if (!descr[index]) {
-@@ -670,7 +670,7 @@
- {
- extern int tidcomm;
- int col,pid,val;
--char cval[1];
-+char cval[2];
- TCTINI("TAB_COMM",F_TRANS,F_O_MODE,3,1,&tidcomm);
- TCCINI(tidcomm,D_I4_FORMAT,1,"I6"," ","PID",&col);
- TCCINI(tidcomm,D_C_FORMAT,60,"A20"," ","OST",&col);
---- a/system/machine/computer.c
-+++ b/system/machine/computer.c
-@@ -63,6 +63,7 @@
- 
- #include <stdio.h>
- #include <signal.h>
-+#include <stdlib.h>
- 
- #ifndef NO_FLOAT_H
- #include <float.h>
diff --git a/debian/patches/fix_unknown_type.patch b/debian/patches/fix_unknown_type.patch
new file mode 100644
index 0000000..f4cb377
--- /dev/null
+++ b/debian/patches/fix_unknown_type.patch
@@ -0,0 +1,28 @@
+Author: Ole Streicher <olebole at debian.org>
+Description: Fix unknown type name in stdred/mos/libsrc/misc.c
+ Compiling stdred/mos/libsrc/misc.c results in an error because of
+ unknown type name 'off_t' in incl/proto_os.h. This can be fixed by
+ #include <sys/types.h>.
+ .
+ Also, system/machine/computer.c uses exit() but does not include the
+ appropriate header. This is fixed by #include <stdlib.h>
+--- a/incl/proto_os.h
++++ b/incl/proto_os.h
+@@ -18,6 +18,7 @@
+ 
+ /* to avoid generic complains for strlen() */
+ #include <string.h>
++#include <sys/types.h>
+ 
+ #ifdef  __cplusplus
+ extern "C" {
+--- a/system/machine/computer.c
++++ b/system/machine/computer.c
+@@ -63,6 +63,7 @@
+ 
+ #include <stdio.h>
+ #include <signal.h>
++#include <stdlib.h>
+ 
+ #ifndef NO_FLOAT_H
+ #include <float.h>
diff --git a/debian/patches/fix_x11_include_path.patch b/debian/patches/fix_x11_include_path.patch
new file mode 100644
index 0000000..06aaab9
--- /dev/null
+++ b/debian/patches/fix_x11_include_path.patch
@@ -0,0 +1,13 @@
+Author: Ole Streicher <olebole at debian.org>
+Description: Add /usr/include/X11 to the X11 include paths
+--- a/install/unix/install1
++++ b/install/unix/install1
+@@ -615,7 +615,7 @@
+   x11incl="found"
+ else
+   ed_moptions delete X11INC >/dev/null
+-  x11inclpth='/usr/openwin/include /usr/include/X11R6 /usr/include/X11R5 /usr/X11R6/include /usr/X11R6/include/X11 /usr/X11R5/include /usr/local/include /include /usr/X/include /opt/X-local/include'
++  x11inclpth='/usr/include/X11 /usr/include/X11R6 /usr/include/X11R5 /usr/X11R6/include /usr/X11R6/include/X11 /usr/X11R5/include /usr/local/include /include /usr/X/include /opt/X-local/include'
+   for dir in $x11inclpth
+   do
+     if [ ! -d $dir ]; then
diff --git a/debian/patches/output-to-stdout.patch b/debian/patches/output_to_stdout.patch
similarity index 100%
rename from debian/patches/output-to-stdout.patch
rename to debian/patches/output_to_stdout.patch
diff --git a/debian/patches/propagate_cflags.patch b/debian/patches/propagate_cflags.patch
new file mode 100644
index 0000000..5222fcd
--- /dev/null
+++ b/debian/patches/propagate_cflags.patch
@@ -0,0 +1,77 @@
+Author: Ole Streicher <olebole at debian.org>
+Description: Propagate CFLAGS, CPPFLAGS, and FFLAGS
+ This is done to enable hardening of the code. Also, use -fPIC only
+ for shared library code.
+--- a/install/unix/install1
++++ b/install/unix/install1
+@@ -331,12 +331,13 @@
+ # 64 bit compiler
+ else
+    echo installing Midas on a 64 bit system
+-   MACH="-m64"
++   MACH=" "
+    EO="-Z"
+ fi
+  
+ ed_moptions add "F77=gfortran $MACH" >/dev/null
+-ed_moptions add "LD77_CMD=gfortran $MACH"  >/dev/null
++ed_moptions add "LD77_CMD=gfortran $MACH $LDFLAGS"  >/dev/null
++ed_moptions add "LDCC=gcc $LDFLAGS"  >/dev/null
+ ed_moptions add "E_OPT= $EO"  >/dev/null
+ 
+ 
+--- a/install/unix/default_mk
++++ b/install/unix/default_mk
+@@ -49,10 +49,10 @@
+ E_OPT =
+ SYS =
+ SH_CMD = echo
+-SH_OPT =
++SH_OPT = -fPIC
+ SH_EXT = so.8.1
+ CFLAGS += $(C_OPT) $(DEBUG) $(SYS) $(VARARGS) -I$(INC)
+-FFLAGS = $(F_OPT) $(DEBUG) -c
++FFLAGS += $(F_OPT) $(DEBUG) -c
+ EFLAGS = $(E_OPT) -I$(INC) -I$(LINC) -f
+ EXFLAGS = -f
+ SLIB =
+--- a/libsrc/ftoc-new/makefile
++++ b/libsrc/ftoc-new/makefile
+@@ -21,6 +21,7 @@
+ C_OPT =  $(K_OPT)
+ 
+ CFLAGS += $(C_OPT) $(DEBUG) $(SH_OPT) $(SYS) -I$(INC)
++FFLAGS += $(SH_OPT)
+ 
+ LIB = $(LIBDIR)/libftoc.a
+ 
+--- a/libsrc/tbl/makefile
++++ b/libsrc/tbl/makefile
+@@ -22,6 +22,7 @@
+ include ../../local/default.mk
+ 
+ CFLAGS += $(C_OPT) $(SH_OPT) $(DEBUG) $(SYS) -I$(INC)
++FFLAGS += $(SH_OPT)
+ 
+ HEADT = $(INC)/tblsys.h $(INC)/tbldef.h $(INC)/tblerr.h
+ 
+--- a/libsrc/agl/makefile
++++ b/libsrc/agl/makefile
+@@ -28,6 +28,7 @@
+ include ../../local/default.mk
+ 
+ CFLAGS += $(C_OPT) $(DEBUG) $(SH_OPT) $(OSSYS) $(SYS) -I$(INC) $(X11INC) -DMIDAS
++FFLAGS += $(SH_OPT)
+ 
+ LIB = $(LIBDIR)/libagl3.a
+ M = ../../system/exec
+--- a/libsrc/plot/makefile
++++ b/libsrc/plot/makefile
+@@ -15,6 +15,7 @@
+ include ../../local/default.mk
+ 
+ CFLAGS += $(C_OPT) $(SH_OPT) $(DEBUG) $(SYS) -I$(INC)
++FFLAGS += $(SH_OPT)
+ 
+ LIB =	$(LIBDIR)/libplot.a
+ 
diff --git a/debian/patches/remove_pointer_conversion.patch b/debian/patches/remove_pointer_conversion.patch
new file mode 100644
index 0000000..5a31d2f
--- /dev/null
+++ b/debian/patches/remove_pointer_conversion.patch
@@ -0,0 +1,27 @@
+Author: Ole Streicher <olebole at debian.org>
+Description: Remove conversion from pointer to int
+ stdred/mos/libsrc/misc.c, line 46 converts a pointer into an integer and
+ compares the result with 0. This is not portable and may fail if the
+ pointer has a larger size than the integer, and all bits that fit into
+ the integer are zero (rare case, but may happen). One can just remove
+ the conversion (and compare with NULL).
+--- a/stdred/mos/libsrc/misc.c
++++ b/stdred/mos/libsrc/misc.c
+@@ -25,6 +25,8 @@
+ #endif
+ #include <gl_defs.h>
+ 
++extern char *strstrs();
++
+ /* check for the existence of 'file' with the extension 'ext' (incl. dot) */
+ #ifdef __STDC__
+    int file_exists( char *file, char *ext )
+@@ -43,7 +45,7 @@
+ 	    break;
+ 	}
+ 
+-    if ( (int) strstrs(file, ext) == 0 )
++    if ( strstrs(file, ext) == NULL )
+     	sprintf( fileext, "%s%s", file, ext );
+     else
+ 	strcpy( fileext, file );
diff --git a/debian/patches/remove-sys_errlist.patch b/debian/patches/remove_sys_errlist.patch
similarity index 100%
rename from debian/patches/remove-sys_errlist.patch
rename to debian/patches/remove_sys_errlist.patch
diff --git a/debian/patches/resolve_conflictig_macro.patch b/debian/patches/resolve_conflictig_macro.patch
new file mode 100644
index 0000000..8d96257
--- /dev/null
+++ b/debian/patches/resolve_conflictig_macro.patch
@@ -0,0 +1,15 @@
+Author: Ole Streicher <olebole at debian.org>
+Description: Remove abs() macro
+ compiling stdred/feros/libsrc/wavecal.c results in an error because of
+ a conflicting definition of abs() in stdred/feros/incl/u_const.h.
+ Removing the relevant #define statement resolves this.
+--- a/stdred/feros/incl/u_const.h
++++ b/stdred/feros/incl/u_const.h
+@@ -110,7 +110,6 @@
+ 
+ #define min(X, Y) (((X) < (Y)) ? (X) : (Y))    /* Minimum von X,Y     */
+ #define max(X, Y) (((X) > (Y)) ? (X) : (Y))    /* Maximum von X,Y     */
+-#define abs(X) (((X) >= 0) ? (X) : -(X))       /* Absolutbetrag von X */
+ #define sign(X, Y) (((Y) < 0) ? -abs(X) : abs(X))  /* Vorzeichen von  */
+                                                /* Y mal abs(X)        */
+ #define sqr(X) ((X) * (X))                     /* Quadrat von X       */
diff --git a/debian/patches/series b/debian/patches/series
index 694daa2..01b7de0 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,7 +1,17 @@
-output-to-stdout.patch
-setup-debian.patch
+propagate_cflags.patch
+output_to_stdout.patch
+debian_setup.patch
+fix_cleanmidas.patch
+dont_strip_during_build.patch
+fix_library_search_path.patch
+fix_x11_include_path.patch
 syskeys.patch
 system_readline.patch
 fix_manpages.patch
-remove-sys_errlist.patch
-fix_trivial_errors.patch
+remove_sys_errlist.patch
+dont_compile_sp_pty.patch
+fix_unknown_type.patch
+resolve_conflictig_macro.patch
+fix_off_by_one_definitions.patch
+remove_pointer_conversion.patch
+fix_fitswdm_c.patch
diff --git a/debian/patches/setup-debian.patch b/debian/patches/setup-debian.patch
deleted file mode 100644
index c9c72c6..0000000
--- a/debian/patches/setup-debian.patch
+++ /dev/null
@@ -1,188 +0,0 @@
-Author: Ole Streicher <debian at liska.ath.cx>
-Description: Debian specific changes
---- a/install/unix/preinstall
-+++ b/install/unix/preinstall
-@@ -121,7 +121,10 @@
- urels=`(uname -r) 2>/dev/null`
- machine=`(uname -m) 2>/dev/null`
- 
--if [ "$uname" = "Darwin" ]; then
-+if [ -d "Debian" -a -f "/etc/debian_version" ];  then
-+    system="Debian"
-+
-+elif [ "$uname" = "Darwin" ]; then
-     system="Darwin"
- 
- elif [ "$machine" = "x86_64" ]; then
---- /dev/null
-+++ b/install/unix/systems/Debian/make_options
-@@ -0,0 +1,10 @@
-+CC=gcc
-+F_OPT=
-+C_OPT=
-+SYS=-DGCC
-+SLIB=-Wl,-rpath,/usr/lib/eso-midas/$(MIDVERS)/lib
-+SH_OPT=-fPIC
-+SH_CMD=$(MIDASHOME)/$(MIDVERS)/local/make_shared
-+GUI_OPT=-DPATH_MAX=1024
-+EDITFLAGS=-DVOID_SIGHANDLER -DHAVE_ALLOCA -DHAVE_ALLOCA_H -DHAVE_GETPW_DECLS -DHAVE_DIRENT_H -DHAVE_STRING_H -DLinux -DHAVE_UNISTD_H -DHAVE_STDLIB_H
-+EDITLIBS=-lncurses
---- /dev/null
-+++ b/install/unix/systems/Debian/make_shared
-@@ -0,0 +1,6 @@
-+#!/bin/sh
-+shift
-+library=`basename $1 | sed 's/\.so\..*$//'`
-+gcc $LDFLAGS -shared -Wl,-soname,$1 -o $* -lm
-+rm -f $library.so
-+ln -s $1 $library.so
---- /dev/null
-+++ b/install/unix/systems/Debian/setup
-@@ -0,0 +1,4 @@
-+host_os=Debian
-+debugger=gdb
-+ps_print="lpr -h"
-+ascii_print="lpr -h -P"
---- a/install/unix/install1
-+++ b/install/unix/install1
-@@ -331,12 +331,13 @@
- # 64 bit compiler
- else
-    echo installing Midas on a 64 bit system
--   MACH="-m64"
-+   MACH=" "
-    EO="-Z"
- fi
-  
- ed_moptions add "F77=gfortran $MACH" >/dev/null
--ed_moptions add "LD77_CMD=gfortran $MACH"  >/dev/null
-+ed_moptions add "LD77_CMD=gfortran $MACH $LDFLAGS"  >/dev/null
-+ed_moptions add "LDCC=gcc $LDFLAGS"  >/dev/null
- ed_moptions add "E_OPT= $EO"  >/dev/null
- 
- 
-@@ -535,9 +536,9 @@
-    fi
- else
-    echo "NOT FOUND."
--   echo "*** STRIP set to echo."
--   ed_moptions add STRIP=echo >/dev/null
- fi
-+echo "*** STRIP set to echo."
-+ed_moptions add STRIP=echo >/dev/null
- #*************** END: Checking the strip command **************
- 
- #*************** START: Checking the ranlib command ***********
-@@ -614,7 +615,7 @@
-   x11incl="found"
- else
-   ed_moptions delete X11INC >/dev/null
--  x11inclpth='/usr/openwin/include /usr/include/X11R6 /usr/include/X11R5 /usr/X11R6/include /usr/X11R6/include/X11 /usr/X11R5/include /usr/local/include /include /usr/X/include /opt/X-local/include'
-+  x11inclpth='/usr/include/X11 /usr/include/X11R6 /usr/include/X11R5 /usr/X11R6/include /usr/X11R6/include/X11 /usr/X11R5/include /usr/local/include /include /usr/X/include /opt/X-local/include'
-   for dir in $x11inclpth
-   do
-     if [ ! -d $dir ]; then
---- a/install/unix/default_mk
-+++ b/install/unix/default_mk
-@@ -32,7 +32,7 @@
- LD77_OPT = $(LDFLAGS)
- LD77 = $(LD77_CMD) $(LD77_OPT)
- RANLIB = ranlib
--STRIP = strip
-+STRIP = echo
- AR = ar
- AR_OPT = ruv
- AR_XOPT = xv
---- a/lib/makefile
-+++ b/lib/makefile
-@@ -82,7 +82,7 @@
- 	$(AR) $(AR_OPT) $(LIBGMIDAS) *.o
- 	rm -f __*
- 	$(RANLIB) $(LIBGMIDAS)
--	$(SH_CMD) -o $(LIBGMIDAS_SH) *.o -L -lmidas $(DEV_NULL)
-+	$(SH_CMD) -o $(LIBGMIDAS_SH) *.o -L$(LIBDIR) $(SLIB) -lmidas $(DEV_NULL)
- 	rm -f *.o
- 
- clean:
---- a/system/unix/cleanmidas
-+++ b/system/unix/cleanmidas
-@@ -54,11 +54,13 @@
-         [ $answer = y ]
- }
- 
--
- MID_HERE=`pwd`
--MIDVERS=`echo $MID_HERE | sed 's/^.*midas\/\([^\/]*\).*$/\1/'`
--MIDASHOME=`echo $MID_HERE | sed 's/\/'$MIDVERS'.*$//'`
--
-+if [ -z "$MIDVERS" ] ; then
-+  MIDVERS=`echo $MID_HERE | sed 's/^.*midas\/\([^\/]*\).*$/\1/'`
-+fi
-+if [ -z "$MIDASHOME" ] ; then
-+  MIDASHOME=`echo $MID_HERE | sed 's/\/'$MIDVERS'.*$//'`
-+fi
- MID_HOME=$MIDASHOME/$MIDVERS
- 
- export MIDASHOME MIDVERS
---- a/system/unix/inmidas
-+++ b/system/unix/inmidas
-@@ -425,7 +425,7 @@
- #
- os=`uname`
- case "$os" in
--    "SunOS"|"Linux")
-+    SunOS|Linux|GNU|GNU/*)
- 	if [ -z "$LD_LIBRARY_PATH" ] ; then
- 	  LD_LIBRARY_PATH=$MIDASHOME/$MIDVERS/lib
- 	else
---- a/prim/dio/libsrc/fitswdm.c
-+++ b/prim/dio/libsrc/fitswdm.c
-@@ -237,12 +237,7 @@
-          {                      /* NULL fill if needed  */
-          pi = p.i + ns;
-          i = n - ns;
--
--#ifdef LinuxAMD64
-          while (i--) toNULLINT (*pi++);
--#else
--         while (i--) toNULLLONG (*pi++);
--#endif
-          }
-       ioff += n;
-       np = 4 * ns;
-@@ -279,12 +274,7 @@
-          while (n--)
-          if (isNULLFLOAT (*pf))
-             {
--
--#ifdef LinuxAMD64
-             toNULLINT (*pi++);
--#else
--            toNULLLONG (*pi++);
--#endif
-             *pf++;
-             }
-          else
-@@ -332,12 +322,7 @@
-          while (n--)
-          if (isNULLFLOAT (*pd))
-             {
--
--#ifdef LinuxAMD64
-             toNULLINT (*pi++);
--#else
--            toNULLLONG (*pi++);
--#endif
-             *pd++;
-             }
-          else
---- a/test/prim/veriall.prg
-+++ b/test/prim/veriall.prg
-@@ -204,6 +204,7 @@
-       write/keyw in_b MID_WORK:veriall_{out_b(1:{inputi})}.{inputc}
-    endif
- endif
-+write/keyw in_b  MID_WORK:veriall_debian.{inputc}
- open/file {in_b} write  fc
- if fc(1) .lt. 0 then
-    write/out Could not create file: "MID_WORK:veriall_{out_b}.{inputc} ..."
diff --git a/debian/patches/system_readline.patch b/debian/patches/system_readline.patch
index c3a4dcf..da06a56 100644
--- a/debian/patches/system_readline.patch
+++ b/debian/patches/system_readline.patch
@@ -8,7 +8,7 @@ Description: Use the system provided readline instead of the copy
    echo "OK."
    ed_moptions replace "EDITSWITCH=-DEdit_dummy" >/dev/null
 -  ed_moptions replace "EDITLIBS=-lzreadline -lncurses" >/dev/null
-+  ed_moptions replace "EDITLIBS=-lreadline -lncurses" >/dev/null
++  ed_moptions replace "EDITLIBS=-lreadline" >/dev/null
  else
    echo "Not found."
    echo "*** WARNING: You'll not be able to edit Midas commands in the monitor."

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-astro/packages/eso-midas.git



More information about the debian-science-commits mailing list