[openchange] Add patch to compile only certain parts of the package

Milan Crha mcrha at fedoraproject.org
Fri Jun 1 12:19:02 UTC 2012


commit e8ca793d8c92a668820223ca0441555ec25f7df6
Author: Milan Crha <mcrha at redhat.com>
Date:   Fri Jun 1 14:18:55 2012 +0200

    Add patch to compile only certain parts of the package

 openchange-1.0-OC_RULE_ADD-fix.patch |  170 ++++++++++++++++++++++++++++++++++
 openchange.spec                      |    4 +
 2 files changed, 174 insertions(+), 0 deletions(-)
---
diff --git a/openchange-1.0-OC_RULE_ADD-fix.patch b/openchange-1.0-OC_RULE_ADD-fix.patch
new file mode 100644
index 0000000..9c08e5b
--- /dev/null
+++ b/openchange-1.0-OC_RULE_ADD-fix.patch
@@ -0,0 +1,170 @@
+--- openchange-1.0-BORG/configure.ac	2012-03-15 15:50:43.000000000 +0200
++++ openchange-1.0-BORG.new/configure.ac	2012-06-01 14:38:52.175821507 +0300
+@@ -103,7 +103,7 @@
+ [ 
+ AC_ARG_VAR([NAME], [rule name])
+ AC_ARG_VAR([TYPE], [rule type])
+-if test "x$1_set" != "xset"; then
++if test "x${$1}set" != "xset"; then
+    case "$2" in
+    	LIBS)
+ 		OC_$2="$OC_$2 $1"
+@@ -361,7 +361,8 @@
+ dnl ---------------------------------------------------------------------------
+ PKG_CHECK_MODULES(TALLOC, talloc)
+ PKG_CHECK_MODULES(SAMBA, dcerpc ndr samba-hostconfig samba-util tevent samba-credentials)
+-PKG_CHECK_MODULES(SAMBASERVER, dcerpc_server samdb)
++PKG_CHECK_MODULES(SAMBASERVER, dcerpc_server, [], [AC_MSG_WARN([No mapiproxy support])])
++PKG_CHECK_MODULES(SAMDB, samdb, [], [AC_MSG_WARN([No mapiproxy support])])
+ PKG_CHECK_MODULES(TDB, tdb)
+ PKG_CHECK_MODULES(LDB, ldb)
+ 
+@@ -387,6 +388,9 @@
+ dnl ---------------------------------------------------------------------------
+ dnl Finally add libmapi to the library list
+ dnl ---------------------------------------------------------------------------
++if test "x$SAMBA_LIBS" != "x" ; then
++    libmapi=1
++fi
+ OC_RULE_ADD(libmapi, LIBS)
+ 
+ dnl nasty hack: only compile IDL if we have a library
+@@ -489,6 +493,7 @@
+ if test x"$ac_cv_libmapixx_gxx_works" = "xyes"; then
+    if test x"$ov_cv_boost_thread" = "xyes"; then
+       AC_PROG_CXX 
++      libmapixx=1
+       OC_RULE_ADD(libmapixx, LIBS)
+    fi
+ fi
+@@ -506,10 +511,12 @@
+    AC_PATH_PROG([BISON], [bison], [bison])
+ 
+    if test x"$BISON" != x""; then
++      libocpf=1
+       OC_RULE_ADD(libocpf, LIBS)
+       AC_SUBST(BISON)
+    fi
+ else
++   libocpf=1
+    OC_RULE_ADD(libocpf, LIBS)
+ fi
+ 
+@@ -527,6 +534,7 @@
+ 
+ if test x"$enable_libmapiadmin" = x"yes"; then
+    	PKG_CHECK_MODULES(SAMR, dcerpc_samr ndr_standard)
++	libmapiadmin=1
+ 	OC_RULE_ADD(libmapiadmin, LIBS)
+ fi
+ 
+@@ -561,28 +569,37 @@
+ 
+ if test x"$enable_libpopt" = x"yes"; then
+    	if test x"$enable_libmapiadmin" = x"yes"; then
+-	   OC_RULE_ADD(openchangepfadmin, TOOLS)
+-	   OC_RULE_ADD(mapitest, TOOLS)
++	   openchangepfadmin=1
++	   mapitest=1
+ 	fi
+ 
+ 	if test x"$enable_libocpf" = x"yes"; then
+-	   OC_RULE_ADD(openchangeclient, TOOLS)
+-           #	   OC_RULE_ADD(mapistore_fsocpf, MAPISTORE)
++	   openchangeclient=1
+ 	fi
+ 
+ 	if test x"$have_libical" = x"yes"; then
+-	    OC_RULE_ADD(exchange2ical, TOOLS)
++	    exchange2ical=1
+ 	fi
+ 
+ 	MAPISTORE_TEST=mapistore_test
+-	OC_RULE_ADD(mapiprofile, TOOLS)
+-	OC_RULE_ADD(openchangemapidump, TOOLS)
+-	OC_RULE_ADD(schemaIDGUID, TOOLS)
+-
+-	OC_RULE_ADD(check_fasttransfer, TOOLS)
+-	OC_RULE_ADD(test_asyncnotif, TOOLS)
++	mapiprofile=1
++	openchangemapidump=1
++	schemaIDGUID=1
++	check_fasttransfer=1
++	test_asyncnotif=1
+ fi
+ AC_SUBST(MAPISTORE_TEST)
++OC_RULE_ADD(openchangeclient, TOOLS)
++#OC_RULE_ADD(mapistore_fsocpf, MAPISTORE)
++OC_RULE_ADD(exchange2ical, TOOLS)
++OC_RULE_ADD(openchangepfadmin, TOOLS)
++OC_RULE_ADD(mapitest, TOOLS)
++OC_RULE_ADD(mapiprofile, TOOLS)
++OC_RULE_ADD(openchangemapidump, TOOLS)
++OC_RULE_ADD(schemaIDGUID, TOOLS)
++
++OC_RULE_ADD(check_fasttransfer, TOOLS)
++OC_RULE_ADD(test_asyncnotif, TOOLS)
+ 
+ dnl --------------------------------------------------------------------------
+ dnl Check for libmagic
+@@ -605,9 +622,10 @@
+ 		       AC_MSG_ERROR([Z library not found, please install zlib-devel.], [1])
+ 		     ])
+    	if test x"$enable_libpopt" = x"yes"; then
+-		OC_RULE_ADD(exchange2mbox, TOOLS)
++		exchange2mbox=1
+ 	fi
+ fi
++OC_RULE_ADD(exchange2mbox, TOOLS)
+ 
+ dnl ##########################################################################
+ dnl libmapistore dependencies
+@@ -644,8 +662,11 @@
+ dnl mapiproxy server
+ dnl ##########################################################################
+ if test x$PYTHON != x; then
+-	OC_RULE_ADD(mapiproxy, SERVER)
++	if test "x$SAMDB_LIBS" != x -a "x$SAMBASERVER_LIBS" != x ; then
++		mapiproxy=1
++	fi
+ fi
++OC_RULE_ADD(mapiproxy, SERVER)
+ 
+ AC_ARG_WITH(modulesdir, 
+ [AS_HELP_STRING([--with-modulesdir], [Modules path to use])],
+--- openchange-1.0-BORG/Makefile	2012-06-01 14:40:30.872485845 +0300
++++ openchange-1.0-BORG.new/Makefile	2012-06-01 14:26:18.975993983 +0300
+@@ -722,7 +722,7 @@
+ 						gen_ndr/ndr_exchange.po				
+ 
+ 	@echo "Linking $@"
+-	@$(CC) -o $@ $(DSOOPT) $^ -L. $(LDFLAGS) $(LIBS) $(SAMBASERVER_LIBS) -Lmapiproxy mapiproxy/libmapiproxy.$(SHLIBEXT).$(PACKAGE_VERSION) libmapi-openchange.$(SHLIBEXT).$(PACKAGE_VERSION)
++	@$(CC) -o $@ $(DSOOPT) $^ -L. $(LDFLAGS) $(LIBS) $(SAMBASERVER_LIBS) $(SAMDB_LIBS) -Lmapiproxy mapiproxy/libmapiproxy.$(SHLIBEXT).$(PACKAGE_VERSION) libmapi-openchange.$(SHLIBEXT).$(PACKAGE_VERSION)
+ 
+ mapiproxy/dcesrv_mapiproxy.c: gen_ndr/ndr_exchange_s.c gen_ndr/ndr_exchange.c
+ 
+@@ -1031,7 +1031,7 @@
+ 						mapiproxy/servers/default/nspi/emsabp_tdb.po		\
+ 						mapiproxy/servers/default/nspi/emsabp_property.po	
+ 	@echo "Linking $@"
+-	@$(CC) -o $@ $(DSOOPT) $(LDFLAGS) $^ -L. $(LIBS) $(TDB_LIBS) $(SAMBASERVER_LIBS) -Lmapiproxy mapiproxy/libmapiproxy.$(SHLIBEXT).$(PACKAGE_VERSION)
++	@$(CC) -o $@ $(DSOOPT) $(LDFLAGS) $^ -L. $(LIBS) $(TDB_LIBS) $(SAMBASERVER_LIBS) $(SAMDB_LIBS) -Lmapiproxy mapiproxy/libmapiproxy.$(SHLIBEXT).$(PACKAGE_VERSION)
+ 
+ mapiproxy/servers/exchange_emsmdb.$(SHLIBEXT):	mapiproxy/servers/default/emsmdb/dcesrv_exchange_emsmdb.po	\
+ 						mapiproxy/servers/default/emsmdb/emsmdbp.po			\
+@@ -1048,13 +1048,13 @@
+ 						mapiproxy/servers/default/emsmdb/oxorule.po			\
+ 						mapiproxy/servers/default/emsmdb/oxcperm.po
+ 	@echo "Linking $@"
+-	@$(CC) -o $@ $(DSOOPT) $(LDFLAGS) $^ -L. $(LIBS) $(SAMBASERVER_LIBS) -Lmapiproxy mapiproxy/libmapiproxy.$(SHLIBEXT).$(PACKAGE_VERSION) \
++	@$(CC) -o $@ $(DSOOPT) $(LDFLAGS) $^ -L. $(LIBS) $(SAMBASERVER_LIBS) $(SAMDB_LIBS) -Lmapiproxy mapiproxy/libmapiproxy.$(SHLIBEXT).$(PACKAGE_VERSION) \
+ 						mapiproxy/libmapiserver.$(SHLIBEXT).$(PACKAGE_VERSION)		\
+ 						mapiproxy/libmapistore.$(SHLIBEXT).$(PACKAGE_VERSION)
+ 
+ mapiproxy/servers/exchange_ds_rfr.$(SHLIBEXT):	mapiproxy/servers/default/rfr/dcesrv_exchange_ds_rfr.po
+ 	@echo "Linking $@"
+-	@$(CC) -o $@ $(DSOOPT) $(LDFLAGS) $^ -L. $(LIBS) $(SAMBASERVER_LIBS) -Lmapiproxy mapiproxy/libmapiproxy.$(SHLIBEXT).$(PACKAGE_VERSION)
++	@$(CC) -o $@ $(DSOOPT) $(LDFLAGS) $^ -L. $(LIBS) $(SAMBASERVER_LIBS) $(SAMDB_LIBS) -Lmapiproxy mapiproxy/libmapiproxy.$(SHLIBEXT).$(PACKAGE_VERSION)
+ 
+ #################################################################
+ # Tools compilation rules
diff --git a/openchange.spec b/openchange.spec
index c0780d3..e5bec4e 100644
--- a/openchange.spec
+++ b/openchange.spec
@@ -64,6 +64,8 @@ Patch1: openchange-0.9-generate-xml-doc.patch
 # Use system's popt.h
 Patch2: openchange-1.0-popt.patch
 
+Patch3: openchange-1.0-OC_RULE_ADD-fix.patch
+
 %description
 OpenChange provides libraries to access Microsoft Exchange servers
 using native protocols.
@@ -125,6 +127,7 @@ This package provides the server elements for OpenChange.
 %patch0 -p1 -b .libmapi-conflict
 %patch1 -p1 -b .generate-xml-doc
 %patch2 -p1 -b .popt
+%patch3 -p1 -b .OC_RULE_ADD-fix
 
 %build
 %configure \
@@ -266,6 +269,7 @@ rm -rf $RPM_BUILD_ROOT
 %changelog
 * Fri Jun 01 2012 Milan Crha <mcrha at redhat.com> - 1.0-7
 - Add patch to use system's popt.h
+- Add patch to compile only certain parts of the package
 - Disable openchange-server for rawhide too (due to samba4 changes)
 
 * Thu May 17 2012 Matthew Barnes <mbarnes at redhat.com> -1.0-6


More information about the scm-commits mailing list