a158709
#! /bin/sh /usr/share/dpatch/dpatch-run
a158709
## 124-integrate-patchy-bootstrap.dpatch by Kevin B. McCarty <kmccarty@debian.org>
a158709
##
a158709
## All lines beginning with `## DP:' are a description of the patch.
a158709
## DP: Write a stub Imakefile for the "p5boot" directory so it can easily
a158709
## DP: be integrated into the build.
a158709
a158709
@DPATCH@
a158709
diff -urNad cernlib-2006.dfsg.2~/src/Imakefile cernlib-2006.dfsg.2/src/Imakefile
a158709
--- cernlib-2006.dfsg.2~/src/Imakefile	2008-02-26 14:39:40.000000000 -0800
a158709
+++ cernlib-2006.dfsg.2/src/Imakefile	2008-02-26 14:41:31.000000000 -0800
a158709
@@ -7,7 +7,7 @@
a158709
 SUBDIRS= $(LIBDIRS) patchy cfortran
a158709
 
a158709
 #ifdef CERNLIB_UNIX
a158709
-SUBDIRS:= $(SUBDIRS) scripts mgr
a158709
+SUBDIRS:= $(SUBDIRS) p5boot scripts mgr
a158709
 #endif
a158709
 
a158709
 InstallLibSubdirs($(LIBDIRS))
a158709
diff -urNad cernlib-2006.dfsg.2~/src/p5boot/Imakefile cernlib-2006.dfsg.2/src/p5boot/Imakefile
a158709
--- cernlib-2006.dfsg.2~/src/p5boot/Imakefile	1969-12-31 16:00:00.000000000 -0800
a158709
+++ cernlib-2006.dfsg.2/src/p5boot/Imakefile	2008-02-26 14:39:46.000000000 -0800
a158709
@@ -0,0 +1,7 @@
a158709
+install.bin: $(CERN_ROOT)/bin/ypatchy
a158709
+
a158709
+$(CERN_ROOT)/bin/ypatchy: $(CVSCOSRC)/p5boot/p5boot.sh
a158709
+	chmod a+x $<
a158709
+	FCOMP="$(FC) $(FCFLAGS)" $<
a158709
+
a158709
+.PHONY: install.bin
a158709
diff -urNad cernlib-2006.dfsg.2~/src/p5boot/p5boot.sh cernlib-2006.dfsg.2/src/p5boot/p5boot.sh
a158709
--- cernlib-2006.dfsg.2~/src/p5boot/p5boot.sh	2006-12-07 06:17:53.000000000 -0800
a158709
+++ cernlib-2006.dfsg.2/src/p5boot/p5boot.sh	2008-02-26 14:39:46.000000000 -0800
a158709
@@ -1,20 +1,22 @@
a158709
-#!/bin/sh
a158709
+#!/bin/sh -e
a158709
 
a158709
-mkdir -p $CERN_ROOT/build/p5boot
a158709
-cd $CERN_ROOT/build/p5boot
a158709
-cp -p -r $CERN_ROOT/src/p5boot/* .
a158709
+mkdir -p "$CERN_ROOT"/build/p5boot
a158709
+cd "$CERN_ROOT"/build/p5boot
a158709
+cp -p -r -f "$CERN_ROOT"/src/p5boot/* .
a158709
 
a158709
 AR="ar cr"
a158709
 
a158709
-cd $CERN_ROOT/build/p5boot/p5lib
a158709
+cd "$CERN_ROOT"/build/p5boot/p5lib
a158709
 $FCOMP -c *.f
a158709
+# This file contains a "main" program which we don't want in the library:
a158709
+rm -f nsynopt.o
a158709
 $AR ../p5lib.a *.o
a158709
 
a158709
-cd $CERN_ROOT/build/p5boot
a158709
+cd "$CERN_ROOT"/build/p5boot
a158709
 
a158709
-$FCOMP -o nypatchy nypatchy.f p5lib.a $CERN_ROOT/lib/libkernlib.a
a158709
+$FCOMP -o nypatchy nypatchy.f p5lib.a "$CERN_ROOT"/lib/libkernlib.a
a158709
 
a158709
-cd $CERN_ROOT/bin
a158709
-ln -s $CERN_ROOT/build/p5boot/nypatchy ypatchy
a158709
+cd "$CERN_ROOT"/bin
a158709
+ln -s "$CERN_ROOT"/build/p5boot/nypatchy ypatchy
a158709
 
a158709
-cd $CERN_ROOT/build
a158709
+cd "$CERN_ROOT"/build