Force the build system to apply out patch, rather than excpecting
users to do so by hand.

Filter out hba.conf to only include comments and blank lines when
the wrapper library is installed.

Signed-off-by: Chris Leech <[email protected]>
---

 Makefile.am       |   21 +++++++++++++++++++--
 hbaapi-conf.patch |   16 ----------------
 libHBAAPI.spec    |    4 ----
 3 files changed, 19 insertions(+), 22 deletions(-)
 delete mode 100644 hbaapi-conf.patch

diff --git a/Makefile.am b/Makefile.am
index d38eb0c..704031d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,6 @@
 lib_LTLIBRARIES = libHBAAPI.la
-libHBAAPI_la_SOURCES = HBAAPILIB.c hbaapi.h vendorhbaapi.h
+libHBAAPI_la_SOURCES = hbaapi.h vendorhbaapi.h
+nodist_libHBAAPI_la_SOURCES = hbaapilib.c
 libHBAAPI_la_LDFLAGS = -version-info 2:2:0
 
 nobase_include_HEADERS = hbaapi.h vendorhbaapi.h
@@ -8,5 +9,21 @@ pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = HBAAPI.pc
 
 dist_sysconf_DATA = hba.conf
-dist_noinst_DATA = HBAAPI.pc.in libHBAAPI.spec
+dist_noinst_DATA = HBAAPILIB.c HBAAPI.pc.in libHBAAPI.spec hbaapi2.2.patch
+
+hbaapilib.c: ${srcdir}/HBAAPILIB.c ${srcdir}/hbaapi2.2.patch
+       cp ${srcdir}/HBAAPILIB.c $@
+       patch $@ < ${srcdir}/hbaapi2.2.patch
+
+clean-local:
+       -rm -f hbaapilib.c
+       -if [ ${abs_srcdir} != ${abs_builddir} ]; then \
+               rm -f hba.conf; \
+       fi
+
+# re-write hba.conf to edit out everything except for comments and blank lines
+FORCE:
+hba.conf: FORCE
+       grep "^#\|^[[:space:]]*$$" ${srcdir}/$@ > [email protected]
+       mv [email protected] $@
 
diff --git a/hbaapi-conf.patch b/hbaapi-conf.patch
deleted file mode 100644
index cf8e4aa..0000000
--- a/hbaapi-conf.patch
+++ /dev/null
@@ -1,16 +0,0 @@
---- hba.conf.orig      2009-02-24 11:37:16.000000000 -0800
-+++ hba.conf   2009-02-24 11:37:42.000000000 -0800
-@@ -16,12 +16,7 @@
- #   the load will fail with the result that the 32 bit vendor
- #   library is ignored.
- 
--org.snia.sample32     /usr/lib/libsample.so             
--com.qlogic.qla32      /usr/lib/libhbaapiqla.so
--com.emulex.lightpulse32 /usr/lib/libhbaapiemu.so
--com.emulex.lightpulse64       /usr/lib/sparcv9/libhbaapiemu.so
--JniHbaLib             /opt/JNIsnia/Solaris/Jni/32bit/JniHbaLib.so
--JniHbaLib             /opt/JNIsnia/Solaris/Jni/64bit/JniHbaLib.so
-+# org.snia.sample32   /usr/lib/libsample.so             
- 
- 
- # Set a debug level (depends on compilation switches)
diff --git a/libHBAAPI.spec b/libHBAAPI.spec
index 0cf637d..067a989 100644
--- a/libHBAAPI.spec
+++ b/libHBAAPI.spec
@@ -8,8 +8,6 @@ License:        SNIA
 URL:            http://www.sourceforge.net/projects/hbaapi
 Source0:        hbaapi_src_2.2.tgz
 Source1:        hbaapi_build_2.2.tar.gz
-Patch0:         hbaapi2.2.patch
-Patch1:         hbaapi-conf.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 # BuildRequires:  
@@ -31,8 +29,6 @@ developing applications that use %{name}.
 %prep
 %setup -q -n hbaapi_src_2.2
 %setup -q -T -D -a 1 -n hbaapi_src_2.2
-%patch -P 0
-%patch -P 1
 
 
 %build

_______________________________________________
devel mailing list
[email protected]
http://www.open-fcoe.org/mailman/listinfo/devel

Reply via email to