From de2acb338519570ce255ff45902dbd6d532ec2be Mon Sep 17 00:00:00 2001 From: "Darryl L. Pierce" Date: Mon, 26 Aug 2013 13:20:18 -0400 Subject: [PATCH 1/7] Created the qpid-proton-c-devel-doc subpackage. - Resolves: BZ#1000615 --- qpid-proton.spec | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/qpid-proton.spec b/qpid-proton.spec index 5b06e79..a55d676 100644 --- a/qpid-proton.spec +++ b/qpid-proton.spec @@ -76,10 +76,23 @@ Provides: qpid-proton-devel = %{version}-%{release} %{_includedir}/proton %{_libdir}/libqpid-proton.so %{_libdir}/pkgconfig/libqpid-proton.pc + + +%package -n qpid-proton-c-devel-doc +Summary: Documentation for the C development libraries for Qpid Proton +BuildArch: noarch + +%description -n qpid-proton-c-devel-doc +%{summary}. + +%files -n qpid-proton-c-devel-doc +%defattr(-,root,root,-) %{proton_datadir}/docs/api-c %{_datadir}/proton/examples + + %package -n python-qpid-proton Summary: Python language bindings for the Qpid Proton messaging framework @@ -140,6 +153,10 @@ rm -rf %{buildroot}%{_datarootdir}/java rm -rf %{buildroot}%{_sysconfdir}/php.d %changelog +* Mon Aug 26 2013 Darryl L. Pierce - 0.4-4 +- Created the qpid-proton-c-devel-doc subpackage. +- Resolves: BZ#1000615 + * Sun Aug 04 2013 Fedora Release Engineering - 0.4-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild From 5adc3e2565e924f24cdf6d7943f22ffe595639a9 Mon Sep 17 00:00:00 2001 From: "Darryl L. Pierce" Date: Mon, 26 Aug 2013 13:23:13 -0400 Subject: [PATCH 2/7] Bumped the release number --- qpid-proton.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qpid-proton.spec b/qpid-proton.spec index a55d676..9636fd1 100644 --- a/qpid-proton.spec +++ b/qpid-proton.spec @@ -2,7 +2,7 @@ Name: qpid-proton Version: 0.4 -Release: 4%{?dist} +Release: 5%{?dist} Summary: A high performance, lightweight messaging library License: ASL 2.0 @@ -153,7 +153,7 @@ rm -rf %{buildroot}%{_datarootdir}/java rm -rf %{buildroot}%{_sysconfdir}/php.d %changelog -* Mon Aug 26 2013 Darryl L. Pierce - 0.4-4 +* Mon Aug 26 2013 Darryl L. Pierce - 0.4-5 - Created the qpid-proton-c-devel-doc subpackage. - Resolves: BZ#1000615 From a4d0de41569b2bcc50d47b1d231c2b45754020e9 Mon Sep 17 00:00:00 2001 From: "Darryl L. Pierce" Date: Wed, 28 Aug 2013 12:06:24 -0400 Subject: [PATCH 3/7] Rebased on Proton 0.5. - Resolves: BZ#1000620 --- .gitignore | 1 + 01-NO-JIRA-Fixed-RHEL5-build-errors.patch | 40 - ...he-include-and-lib-directories-in-li.patch | 50 + ...orm-neutral-helper-functions-for-exa.patch | 994 ------------------ 03-PROTON-364-Install-C-examples.patch | 76 -- qpid-proton.spec | 16 +- sources | 2 +- 7 files changed, 60 insertions(+), 1119 deletions(-) delete mode 100644 01-NO-JIRA-Fixed-RHEL5-build-errors.patch create mode 100644 01-PROTON-412-Fix-the-include-and-lib-directories-in-li.patch delete mode 100644 02-PROTON-348-Platform-neutral-helper-functions-for-exa.patch delete mode 100644 03-PROTON-364-Install-C-examples.patch diff --git a/.gitignore b/.gitignore index f9e5562..0f02224 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /qpid-proton-c-0.3.tar.gz /qpid-proton-0.4.tar.gz +/qpid-proton-0.5.tar.gz diff --git a/01-NO-JIRA-Fixed-RHEL5-build-errors.patch b/01-NO-JIRA-Fixed-RHEL5-build-errors.patch deleted file mode 100644 index 508edba..0000000 --- a/01-NO-JIRA-Fixed-RHEL5-build-errors.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 4be173d6a63b41326b341c3228b2c1074359c511 Mon Sep 17 00:00:00 2001 -From: "Darryl L. Pierce" -Date: Mon, 8 Apr 2013 17:06:22 -0400 -Subject: [PATCH 1/3] NO-JIRA: Fixed RHEL5 build errors. - -Set a value for err in pn_data_appendn(). ---- - proton-c/bindings/python/proton.py | 2 +- - proton-c/src/codec/codec.c | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/proton-c/bindings/python/proton.py b/proton-c/bindings/python/proton.py -index d76f931..492b015 100644 ---- a/proton-c/bindings/python/proton.py -+++ b/proton-c/bindings/python/proton.py -@@ -30,7 +30,7 @@ The proton APIs consist of the following classes: - - """ - --from cproton import * -+from _cproton import * - try: - import uuid - except ImportError: -diff --git a/proton-c/src/codec/codec.c b/proton-c/src/codec/codec.c -index c76c9dd..51dfe85 100644 ---- a/proton-c/src/codec/codec.c -+++ b/proton-c/src/codec/codec.c -@@ -2970,7 +2970,7 @@ int pn_data_append(pn_data_t *data, pn_data_t *src) - - int pn_data_appendn(pn_data_t *data, pn_data_t *src, int limit) - { -- int err; -+ int err = 0; - int level = 0, count = 0; - bool stop = false; - pn_point_t point = pn_data_point(src); --- -1.8.3.1 - diff --git a/01-PROTON-412-Fix-the-include-and-lib-directories-in-li.patch b/01-PROTON-412-Fix-the-include-and-lib-directories-in-li.patch new file mode 100644 index 0000000..0f1277a --- /dev/null +++ b/01-PROTON-412-Fix-the-include-and-lib-directories-in-li.patch @@ -0,0 +1,50 @@ +From 47a7169e007de34d720a50f415b70006664634f6 Mon Sep 17 00:00:00 2001 +From: mcpierce +Date: Mon, 26 Aug 2013 20:07:22 +0000 +Subject: [PATCH] PROTON-412: Fix the include and lib directories in + libqpid-proton.pc + +If the paths aren't passed in from the command line as absolute then +prepends them with CMAKE_INSTALL_PREFIX before generated the package +config file. + +git-svn-id: https://svn.apache.org/repos/asf/qpid/proton/trunk@1517673 13f79535-47bb-0310-9956-ffa450edef68 +--- + proton-c/CMakeLists.txt | 21 ++++++++++++++++----- + 1 file changed, 16 insertions(+), 5 deletions(-) + +diff --git a/proton-c/CMakeLists.txt b/proton-c/CMakeLists.txt +index dacc9f8..42211ba 100644 +--- a/proton-c/CMakeLists.txt ++++ b/proton-c/CMakeLists.txt +@@ -331,11 +331,22 @@ install (FILES ${CMAKE_CURRENT_BINARY_DIR}/include/proton/version.h + DESTINATION ${INCLUDE_INSTALL_DIR}/proton) + + # Pkg config file +-# Compatible variable names used in the pkg config files also for autoconf +-get_filename_component (PREFIX ${CMAKE_INSTALL_PREFIX} ABSOLUTE) +-get_filename_component (EXEC_PREFIX ${CMAKE_INSTALL_PREFIX} ABSOLUTE) +-get_filename_component (LIBDIR ${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR} ABSOLUTE) +-get_filename_component (INCLUDEDIR ${CMAKE_INSTALL_PREFIX}/${INCLUDE_INSTALL_DIR} ABSOLUTE) ++# make sure the install prefix is absolute ++set(INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}) ++ ++macro (pn_pkgconfig_dir NAME VALUE PREFIX) ++ if(IS_ABSOLUTE ${VALUE}) ++ set(${NAME} "${VALUE}") ++ else(IS_ABSOLUTE ${VALUE}) ++ set(${NAME} "${PREFIX}/${VALUE}") ++ endif(IS_ABSOLUTE ${VALUE}) ++ get_filename_component(${NAME} ${${NAME}} ABSOLUTE) ++endmacro(pn_pkgconfig_dir) ++ ++pn_pkgconfig_dir(PREFIX ${INSTALL_PREFIX} ${INSTALL_PREFIX}) ++pn_pkgconfig_dir(EXEC_PREFIX ${INSTALL_PREFIX} ${INSTALL_PREFIX}) ++pn_pkgconfig_dir(LIBDIR ${LIB_INSTALL_DIR} ${INSTALL_PREFIX}) ++pn_pkgconfig_dir(INCLUDEDIR ${INCLUDE_INSTALL_DIR} ${INSTALL_PREFIX}) + + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/libqpid-proton.pc.in + ${CMAKE_CURRENT_BINARY_DIR}/libqpid-proton.pc @ONLY) +-- +1.8.3.1 + diff --git a/02-PROTON-348-Platform-neutral-helper-functions-for-exa.patch b/02-PROTON-348-Platform-neutral-helper-functions-for-exa.patch deleted file mode 100644 index 53affd0..0000000 --- a/02-PROTON-348-Platform-neutral-helper-functions-for-exa.patch +++ /dev/null @@ -1,994 +0,0 @@ -From c519f03332764cba2c231560dbd43c9028fb3d09 Mon Sep 17 00:00:00 2001 -From: cliffjansen -Date: Tue, 16 Jul 2013 00:55:03 +0000 -Subject: [PATCH 2/3] PROTON-348: Platform neutral helper functions for - examples and tests. - -git-svn-id: https://svn.apache.org/repos/asf/qpid/proton/trunk@1503531 13f79535-47bb-0310-9956-ffa450edef68 ---- - examples/include/pncompat/internal/LICENSE | 33 ++++ - examples/include/pncompat/internal/getopt.c | 250 ++++++++++++++++++++++++++++ - examples/include/pncompat/internal/getopt.h | 63 +++++++ - examples/include/pncompat/misc_defs.h | 48 ++++++ - examples/include/pncompat/misc_funcs.inc | 67 ++++++++ - examples/messenger/c/recv.c | 6 +- - examples/messenger/c/send.c | 6 +- - proton-c/CMakeLists.txt | 1 + - proton-c/src/proton.c | 2 +- - proton-c/wincompat/getopt.h | 39 ----- - proton-c/wincompat/internal/LICENSE | 33 ---- - proton-c/wincompat/internal/getopt.c | 250 ---------------------------- - proton-c/wincompat/internal/getopt.h | 63 ------- - 13 files changed, 465 insertions(+), 396 deletions(-) - create mode 100644 examples/include/pncompat/internal/LICENSE - create mode 100644 examples/include/pncompat/internal/getopt.c - create mode 100644 examples/include/pncompat/internal/getopt.h - create mode 100644 examples/include/pncompat/misc_defs.h - create mode 100644 examples/include/pncompat/misc_funcs.inc - delete mode 100644 proton-c/wincompat/getopt.h - delete mode 100644 proton-c/wincompat/internal/LICENSE - delete mode 100644 proton-c/wincompat/internal/getopt.c - delete mode 100644 proton-c/wincompat/internal/getopt.h - -diff --git a/examples/include/pncompat/internal/LICENSE b/examples/include/pncompat/internal/LICENSE -new file mode 100644 -index 0000000..99efb42 ---- /dev/null -+++ b/examples/include/pncompat/internal/LICENSE -@@ -0,0 +1,33 @@ -+Free Getopt -+Copyright (c)2002-2003 Mark K. Kim -+All rights reserved. -+ -+Redistribution and use in source and binary forms, with or without -+modification, are permitted provided that the following conditions -+are met: -+ -+ * Redistributions of source code must retain the above copyright -+ notice, this list of conditions and the following disclaimer. -+ -+ * Redistributions in binary form must reproduce the above copyright -+ notice, this list of conditions and the following disclaimer in -+ the documentation and/or other materials provided with the -+ distribution. -+ -+ * Neither the original author of this software nor the names of its -+ contributors may be used to endorse or promote products derived -+ from this software without specific prior written permission. -+ -+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -+FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -+COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -+OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -+AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF -+THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH -+DAMAGE. -+ -diff --git a/examples/include/pncompat/internal/getopt.c b/examples/include/pncompat/internal/getopt.c -new file mode 100644 -index 0000000..7ef9a68 ---- /dev/null -+++ b/examples/include/pncompat/internal/getopt.c -@@ -0,0 +1,250 @@ -+/***************************************************************************** -+* getopt.c - competent and free getopt library. -+* $Header: /cvsroot/freegetopt/freegetopt/getopt.c,v 1.2 2003/10/26 03:10:20 vindaci Exp $ -+* -+* Copyright (c)2002-2003 Mark K. Kim -+* All rights reserved. -+* -+* Redistribution and use in source and binary forms, with or without -+* modification, are permitted provided that the following conditions -+* are met: -+* -+* * Redistributions of source code must retain the above copyright -+* notice, this list of conditions and the following disclaimer. -+* -+* * Redistributions in binary form must reproduce the above copyright -+* notice, this list of conditions and the following disclaimer in -+* the documentation and/or other materials provided with the -+* distribution. -+* -+* * Neither the original author of this software nor the names of its -+* contributors may be used to endorse or promote products derived -+* from this software without specific prior written permission. -+* -+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -+* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -+* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -+* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -+* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -+* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -+* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -+* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -+* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF -+* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH -+* DAMAGE. -+*/ -+#include -+#include -+#include -+#include "getopt.h" -+ -+ -+static const char* ID = "$Id: getopt.c,v 1.2 2003/10/26 03:10:20 vindaci Exp $"; -+ -+ -+char* optarg = NULL; -+int optind = 0; -+int opterr = 1; -+int optopt = '?'; -+ -+ -+static char** prev_argv = NULL; /* Keep a copy of argv and argc to */ -+static int prev_argc = 0; /* tell if getopt params change */ -+static int argv_index = 0; /* Option we're checking */ -+static int argv_index2 = 0; /* Option argument we're checking */ -+static int opt_offset = 0; /* Index into compounded "-option" */ -+static int dashdash = 0; /* True if "--" option reached */ -+static int nonopt = 0; /* How many nonopts we've found */ -+ -+static void increment_index() -+{ -+ /* Move onto the next option */ -+ if(argv_index < argv_index2) -+ { -+ while(prev_argv[++argv_index] && prev_argv[argv_index][0] != '-' -+ && argv_index < argv_index2+1); -+ } -+ else argv_index++; -+ opt_offset = 1; -+} -+ -+ -+/* -+* Permutes argv[] so that the argument currently being processed is moved -+* to the end. -+*/ -+static int permute_argv_once() -+{ -+ /* Movability check */ -+ if(argv_index + nonopt >= prev_argc) return 1; -+ /* Move the current option to the end, bring the others to front */ -+ else -+ { -+ char* tmp = prev_argv[argv_index]; -+ -+ /* Move the data */ -+ memmove(&prev_argv[argv_index], &prev_argv[argv_index+1], -+ sizeof(char**) * (prev_argc - argv_index - 1)); -+ prev_argv[prev_argc - 1] = tmp; -+ -+ nonopt++; -+ return 0; -+ } -+} -+ -+ -+int getopt(int argc, char** argv, char* optstr) -+{ -+ int c = 0; -+ -+ /* If we have new argv, reinitialize */ -+ if(prev_argv != argv || prev_argc != argc) -+ { -+ /* Initialize variables */ -+ prev_argv = argv; -+ prev_argc = argc; -+ argv_index = 1; -+ argv_index2 = 1; -+ opt_offset = 1; -+ dashdash = 0; -+ nonopt = 0; -+ } -+ -+ /* Jump point in case we want to ignore the current argv_index */ -+ getopt_top: -+ -+ /* Misc. initializations */ -+ optarg = NULL; -+ -+ /* Dash-dash check */ -+ if(argv[argv_index] && !strcmp(argv[argv_index], "--")) -+ { -+ dashdash = 1; -+ increment_index(); -+ } -+ -+ /* If we're at the end of argv, that's it. */ -+ if(argv[argv_index] == NULL) -+ { -+ c = -1; -+ } -+ /* Are we looking at a string? Single dash is also a string */ -+ else if(dashdash || argv[argv_index][0] != '-' || !strcmp(argv[argv_index], "-")) -+ { -+ /* If we want a string... */ -+ if(optstr[0] == '-') -+ { -+ c = 1; -+ optarg = argv[argv_index]; -+ increment_index(); -+ } -+ /* If we really don't want it (we're in POSIX mode), we're done */ -+ else if(optstr[0] == '+' || getenv("POSIXLY_CORRECT")) -+ { -+ c = -1; -+ -+ /* Everything else is a non-opt argument */ -+ nonopt = argc - argv_index; -+ } -+ /* If we mildly don't want it, then move it back */ -+ else -+ { -+ if(!permute_argv_once()) goto getopt_top; -+ else c = -1; -+ } -+ } -+ /* Otherwise we're looking at an option */ -+ else -+ { -+ char* opt_ptr = NULL; -+ -+ /* Grab the option */ -+ c = argv[argv_index][opt_offset++]; -+ -+ /* Is the option in the optstr? */ -+ if(optstr[0] == '-') opt_ptr = strchr(optstr+1, c); -+ else opt_ptr = strchr(optstr, c); -+ /* Invalid argument */ -+ if(!opt_ptr) -+ { -+ if(opterr) -+ { -+ fprintf(stderr, "%s: invalid option -- %c\n", argv[0], c); -+ } -+ -+ optopt = c; -+ c = '?'; -+ -+ /* Move onto the next option */ -+ increment_index(); -+ } -+ /* Option takes argument */ -+ else if(opt_ptr[1] == ':') -+ { -+ /* ie, -oARGUMENT, -xxxoARGUMENT, etc. */ -+ if(argv[argv_index][opt_offset] != '\0') -+ { -+ optarg = &argv[argv_index][opt_offset]; -+ increment_index(); -+ } -+ /* ie, -o ARGUMENT (only if it's a required argument) */ -+ else if(opt_ptr[2] != ':') -+ { -+ /* One of those "you're not expected to understand this" moment */ -+ if(argv_index2 < argv_index) argv_index2 = argv_index; -+ while(argv[++argv_index2] && argv[argv_index2][0] == '-'); -+ optarg = argv[argv_index2]; -+ -+ /* Don't cross into the non-option argument list */ -+ if(argv_index2 + nonopt >= prev_argc) optarg = NULL; -+ -+ /* Move onto the next option */ -+ increment_index(); -+ } -+ else -+ { -+ /* Move onto the next option */ -+ increment_index(); -+ } -+ -+ /* In case we got no argument for an option with required argument */ -+ if(optarg == NULL && opt_ptr[2] != ':') -+ { -+ optopt = c; -+ c = '?'; -+ -+ if(opterr) -+ { -+ fprintf(stderr,"%s: option requires an argument -- %c\n", -+ argv[0], optopt); -+ } -+ } -+ } -+ /* Option does not take argument */ -+ else -+ { -+ /* Next argv_index */ -+ if(argv[argv_index][opt_offset] == '\0') -+ { -+ increment_index(); -+ } -+ } -+ } -+ -+ /* Calculate optind */ -+ if(c == -1) -+ { -+ optind = argc - nonopt; -+ } -+ else -+ { -+ optind = argv_index; -+ } -+ -+ return c; -+} -+ -+ -+/* vim:ts=3 -+*/ -diff --git a/examples/include/pncompat/internal/getopt.h b/examples/include/pncompat/internal/getopt.h -new file mode 100644 -index 0000000..0b78650 ---- /dev/null -+++ b/examples/include/pncompat/internal/getopt.h -@@ -0,0 +1,63 @@ -+/***************************************************************************** -+* getopt.h - competent and free getopt library. -+* $Header: /cvsroot/freegetopt/freegetopt/getopt.h,v 1.2 2003/10/26 03:10:20 vindaci Exp $ -+* -+* Copyright (c)2002-2003 Mark K. Kim -+* All rights reserved. -+* -+* Redistribution and use in source and binary forms, with or without -+* modification, are permitted provided that the following conditions -+* are met: -+* -+* * Redistributions of source code must retain the above copyright -+* notice, this list of conditions and the following disclaimer. -+* -+* * Redistributions in binary form must reproduce the above copyright -+* notice, this list of conditions and the following disclaimer in -+* the documentation and/or other materials provided with the -+* distribution. -+* -+* * Neither the original author of this software nor the names of its -+* contributors may be used to endorse or promote products derived -+* from this software without specific prior written permission. -+* -+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -+* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -+* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -+* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -+* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -+* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -+* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -+* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -+* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF -+* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH -+* DAMAGE. -+*/ -+#ifndef GETOPT_H_ -+#define GETOPT_H_ -+ -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+ -+extern char* optarg; -+extern int optind; -+extern int opterr; -+extern int optopt; -+ -+int getopt(int argc, char** argv, char* optstr); -+ -+ -+#ifdef __cplusplus -+} -+#endif -+ -+ -+#endif /* GETOPT_H_ */ -+ -+ -+/* vim:ts=3 -+*/ -diff --git a/examples/include/pncompat/misc_defs.h b/examples/include/pncompat/misc_defs.h -new file mode 100644 -index 0000000..00d5f67 ---- /dev/null -+++ b/examples/include/pncompat/misc_defs.h -@@ -0,0 +1,48 @@ -+#ifndef PNCOMAPT_MISC_DEFS_H -+#define PNCOMAPT_MISC_DEFS_H -+ -+/* -+ * Licensed to the Apache Software Foundation (ASF) under one -+ * or more contributor license agreements. See the NOTICE file -+ * distributed with this work for additional information -+ * regarding copyright ownership. The ASF licenses this file -+ * to you under the Apache License, Version 2.0 (the -+ * "License"); you may not use this file except in compliance -+ * with the License. You may obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, -+ * software distributed under the License is distributed on an -+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -+ * KIND, either express or implied. See the License for the -+ * specific language governing permissions and limitations -+ * under the License. -+ * -+ */ -+ -+#if defined(qpid_proton_EXPORTS) -+#error This include file is not for use in the main proton library -+#endif -+ -+/* -+ * Platform neutral definitions. Only intended for use by Proton -+ * examples and test/debug programs. -+ * -+ * This file and any related support files may change or be removed -+ * at any time. -+ */ -+ -+// getopt() -+ -+#include -+ -+#if !defined(_WIN32) || defined (__CYGWIN__) -+#include -+#else -+#include "internal/getopt.h" -+#endif -+ -+pn_timestamp_t time_now(); -+ -+#endif /* PNCOMPAT_MISC_DEFS_H */ -diff --git a/examples/include/pncompat/misc_funcs.inc b/examples/include/pncompat/misc_funcs.inc -new file mode 100644 -index 0000000..921d1d3 ---- /dev/null -+++ b/examples/include/pncompat/misc_funcs.inc -@@ -0,0 +1,67 @@ -+/* -+ * Licensed to the Apache Software Foundation (ASF) under one -+ * or more contributor license agreements. See the NOTICE file -+ * distributed with this work for additional information -+ * regarding copyright ownership. The ASF licenses this file -+ * to you under the Apache License, Version 2.0 (the -+ * "License"); you may not use this file except in compliance -+ * with the License. You may obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, -+ * software distributed under the License is distributed on an -+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -+ * KIND, either express or implied. See the License for the -+ * specific language governing permissions and limitations -+ * under the License. -+ * -+ */ -+ -+/* -+ * This file provides the functions for "misc_defs.h" in the form of -+ * included code, as opposed to a separate library or object -+ * dependency. In the absence of portable "pragma weak" compiler -+ * directives, this provides a simple workaround. -+ * -+ * Usage for a single compilation unit: -+ * -+ * #include "pncompat/misc_funcs.inc" -+ * -+ * Usage for multiple combined compilation units: chose one to include -+ * "pncompat/misc_funcs.inc" as above and in each other unit needing the -+ * definitions use -+ * -+ * #include "pncompat/misc_defs.h" -+ * -+ */ -+ -+#include "misc_defs.h" -+ -+#if defined(_WIN32) && ! defined(__CYGWIN__) -+#include "pncompat/internal/getopt.c" -+#endif -+ -+#if defined(_WIN32) && ! defined(__CYGWIN__) -+#include -+pn_timestamp_t time_now(void) -+{ -+ FILETIME now; -+ GetSystemTimeAsFileTime(&now); -+ ULARGE_INTEGER t; -+ t.u.HighPart = now.dwHighDateTime; -+ t.u.LowPart = now.dwLowDateTime; -+ // Convert to milliseconds and adjust base epoch -+ return t.QuadPart / 10000 - 11644473600000; -+} -+#else -+#include -+#include -+#include -+pn_timestamp_t time_now(void) -+{ -+ struct timeval now; -+ if (gettimeofday(&now, NULL)) pn_fatal("gettimeofday failed\n"); -+ return ((pn_timestamp_t)now.tv_sec) * 1000 + (now.tv_usec / 1000); -+} -+#endif -diff --git a/examples/messenger/c/recv.c b/examples/messenger/c/recv.c -index 50a2787..b2c974d 100644 ---- a/examples/messenger/c/recv.c -+++ b/examples/messenger/c/recv.c -@@ -21,11 +21,7 @@ - #include "proton/message.h" - #include "proton/messenger.h" - --#if defined(_WIN32) && ! defined(__CYGWIN__) --#include "../../../proton-c/wincompat/getopt.h" --#else --#include --#endif -+#include "pncompat/misc_funcs.inc" - #include - #include - #include -diff --git a/examples/messenger/c/send.c b/examples/messenger/c/send.c -index 77f772a..a7e91a2 100644 ---- a/examples/messenger/c/send.c -+++ b/examples/messenger/c/send.c -@@ -21,11 +21,7 @@ - #include "proton/message.h" - #include "proton/messenger.h" - --#if defined(_WIN32) && ! defined(__CYGWIN__) --#include "../../../proton-c/wincompat/getopt.h" --#else --#include --#endif -+#include "pncompat/misc_funcs.inc" - #include - #include - #include -diff --git a/proton-c/CMakeLists.txt b/proton-c/CMakeLists.txt -index 74d302a..c8ee531 100644 ---- a/proton-c/CMakeLists.txt -+++ b/proton-c/CMakeLists.txt -@@ -57,6 +57,7 @@ configure_file ( - - include_directories ("${CMAKE_CURRENT_BINARY_DIR}") - include_directories ("${CMAKE_CURRENT_SOURCE_DIR}/include") -+include_directories ("${CMAKE_CURRENT_SOURCE_DIR}/../examples/include") - - add_custom_command ( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/encodings.h -diff --git a/proton-c/src/proton.c b/proton-c/src/proton.c -index 370bfd5..552c9c2 100644 ---- a/proton-c/src/proton.c -+++ b/proton-c/src/proton.c -@@ -22,7 +22,7 @@ - #if defined(_WIN32) && ! defined(__CYGWIN__) - #define NOGDI - #include --#include "../wincompat/getopt.h" -+#include "pncompat/misc_funcs.inc" - #else - #include - #include -diff --git a/proton-c/wincompat/getopt.h b/proton-c/wincompat/getopt.h -deleted file mode 100644 -index 5106c29..0000000 ---- a/proton-c/wincompat/getopt.h -+++ /dev/null -@@ -1,39 +0,0 @@ --/* -- * -- * Licensed to the Apache Software Foundation (ASF) under one -- * or more contributor license agreements. See the NOTICE file -- * distributed with this work for additional information -- * regarding copyright ownership. The ASF licenses this file -- * to you under the Apache License, Version 2.0 (the -- * "License"); you may not use this file except in compliance -- * with the License. You may obtain a copy of the License at -- * -- * http://www.apache.org/licenses/LICENSE-2.0 -- * -- * Unless required by applicable law or agreed to in writing, -- * software distributed under the License is distributed on an -- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -- * KIND, either express or implied. See the License for the -- * specific language governing permissions and limitations -- * under the License. -- * -- */ -- --/* -- * Provides an embedded getopt implementation to the C file including -- * this. Only intended for use by Proton examples and test/debug -- * programs to run on Windows. -- * -- * This file and any internal support files may change or be removed -- * at any time. -- */ -- --#if defined(qpid_proton_EXPORTS) --#error This include file is not for use in the main proton library --#endif -- --#if !defined(_WIN32) || defined (__CYGWIN__) --#error This include file only intended for Windows compatibility. --#endif -- --#include "internal/getopt.c" -diff --git a/proton-c/wincompat/internal/LICENSE b/proton-c/wincompat/internal/LICENSE -deleted file mode 100644 -index 99efb42..0000000 ---- a/proton-c/wincompat/internal/LICENSE -+++ /dev/null -@@ -1,33 +0,0 @@ --Free Getopt --Copyright (c)2002-2003 Mark K. Kim --All rights reserved. -- --Redistribution and use in source and binary forms, with or without --modification, are permitted provided that the following conditions --are met: -- -- * Redistributions of source code must retain the above copyright -- notice, this list of conditions and the following disclaimer. -- -- * Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in -- the documentation and/or other materials provided with the -- distribution. -- -- * Neither the original author of this software nor the names of its -- contributors may be used to endorse or promote products derived -- from this software without specific prior written permission. -- --THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS --FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE --COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, --INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, --BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS --OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED --AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, --OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF --THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH --DAMAGE. -- -diff --git a/proton-c/wincompat/internal/getopt.c b/proton-c/wincompat/internal/getopt.c -deleted file mode 100644 -index 7ef9a68..0000000 ---- a/proton-c/wincompat/internal/getopt.c -+++ /dev/null -@@ -1,250 +0,0 @@ --/***************************************************************************** --* getopt.c - competent and free getopt library. --* $Header: /cvsroot/freegetopt/freegetopt/getopt.c,v 1.2 2003/10/26 03:10:20 vindaci Exp $ --* --* Copyright (c)2002-2003 Mark K. Kim --* All rights reserved. --* --* Redistribution and use in source and binary forms, with or without --* modification, are permitted provided that the following conditions --* are met: --* --* * Redistributions of source code must retain the above copyright --* notice, this list of conditions and the following disclaimer. --* --* * Redistributions in binary form must reproduce the above copyright --* notice, this list of conditions and the following disclaimer in --* the documentation and/or other materials provided with the --* distribution. --* --* * Neither the original author of this software nor the names of its --* contributors may be used to endorse or promote products derived --* from this software without specific prior written permission. --* --* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS --* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE --* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, --* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, --* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS --* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED --* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, --* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF --* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH --* DAMAGE. --*/ --#include --#include --#include --#include "getopt.h" -- -- --static const char* ID = "$Id: getopt.c,v 1.2 2003/10/26 03:10:20 vindaci Exp $"; -- -- --char* optarg = NULL; --int optind = 0; --int opterr = 1; --int optopt = '?'; -- -- --static char** prev_argv = NULL; /* Keep a copy of argv and argc to */ --static int prev_argc = 0; /* tell if getopt params change */ --static int argv_index = 0; /* Option we're checking */ --static int argv_index2 = 0; /* Option argument we're checking */ --static int opt_offset = 0; /* Index into compounded "-option" */ --static int dashdash = 0; /* True if "--" option reached */ --static int nonopt = 0; /* How many nonopts we've found */ -- --static void increment_index() --{ -- /* Move onto the next option */ -- if(argv_index < argv_index2) -- { -- while(prev_argv[++argv_index] && prev_argv[argv_index][0] != '-' -- && argv_index < argv_index2+1); -- } -- else argv_index++; -- opt_offset = 1; --} -- -- --/* --* Permutes argv[] so that the argument currently being processed is moved --* to the end. --*/ --static int permute_argv_once() --{ -- /* Movability check */ -- if(argv_index + nonopt >= prev_argc) return 1; -- /* Move the current option to the end, bring the others to front */ -- else -- { -- char* tmp = prev_argv[argv_index]; -- -- /* Move the data */ -- memmove(&prev_argv[argv_index], &prev_argv[argv_index+1], -- sizeof(char**) * (prev_argc - argv_index - 1)); -- prev_argv[prev_argc - 1] = tmp; -- -- nonopt++; -- return 0; -- } --} -- -- --int getopt(int argc, char** argv, char* optstr) --{ -- int c = 0; -- -- /* If we have new argv, reinitialize */ -- if(prev_argv != argv || prev_argc != argc) -- { -- /* Initialize variables */ -- prev_argv = argv; -- prev_argc = argc; -- argv_index = 1; -- argv_index2 = 1; -- opt_offset = 1; -- dashdash = 0; -- nonopt = 0; -- } -- -- /* Jump point in case we want to ignore the current argv_index */ -- getopt_top: -- -- /* Misc. initializations */ -- optarg = NULL; -- -- /* Dash-dash check */ -- if(argv[argv_index] && !strcmp(argv[argv_index], "--")) -- { -- dashdash = 1; -- increment_index(); -- } -- -- /* If we're at the end of argv, that's it. */ -- if(argv[argv_index] == NULL) -- { -- c = -1; -- } -- /* Are we looking at a string? Single dash is also a string */ -- else if(dashdash || argv[argv_index][0] != '-' || !strcmp(argv[argv_index], "-")) -- { -- /* If we want a string... */ -- if(optstr[0] == '-') -- { -- c = 1; -- optarg = argv[argv_index]; -- increment_index(); -- } -- /* If we really don't want it (we're in POSIX mode), we're done */ -- else if(optstr[0] == '+' || getenv("POSIXLY_CORRECT")) -- { -- c = -1; -- -- /* Everything else is a non-opt argument */ -- nonopt = argc - argv_index; -- } -- /* If we mildly don't want it, then move it back */ -- else -- { -- if(!permute_argv_once()) goto getopt_top; -- else c = -1; -- } -- } -- /* Otherwise we're looking at an option */ -- else -- { -- char* opt_ptr = NULL; -- -- /* Grab the option */ -- c = argv[argv_index][opt_offset++]; -- -- /* Is the option in the optstr? */ -- if(optstr[0] == '-') opt_ptr = strchr(optstr+1, c); -- else opt_ptr = strchr(optstr, c); -- /* Invalid argument */ -- if(!opt_ptr) -- { -- if(opterr) -- { -- fprintf(stderr, "%s: invalid option -- %c\n", argv[0], c); -- } -- -- optopt = c; -- c = '?'; -- -- /* Move onto the next option */ -- increment_index(); -- } -- /* Option takes argument */ -- else if(opt_ptr[1] == ':') -- { -- /* ie, -oARGUMENT, -xxxoARGUMENT, etc. */ -- if(argv[argv_index][opt_offset] != '\0') -- { -- optarg = &argv[argv_index][opt_offset]; -- increment_index(); -- } -- /* ie, -o ARGUMENT (only if it's a required argument) */ -- else if(opt_ptr[2] != ':') -- { -- /* One of those "you're not expected to understand this" moment */ -- if(argv_index2 < argv_index) argv_index2 = argv_index; -- while(argv[++argv_index2] && argv[argv_index2][0] == '-'); -- optarg = argv[argv_index2]; -- -- /* Don't cross into the non-option argument list */ -- if(argv_index2 + nonopt >= prev_argc) optarg = NULL; -- -- /* Move onto the next option */ -- increment_index(); -- } -- else -- { -- /* Move onto the next option */ -- increment_index(); -- } -- -- /* In case we got no argument for an option with required argument */ -- if(optarg == NULL && opt_ptr[2] != ':') -- { -- optopt = c; -- c = '?'; -- -- if(opterr) -- { -- fprintf(stderr,"%s: option requires an argument -- %c\n", -- argv[0], optopt); -- } -- } -- } -- /* Option does not take argument */ -- else -- { -- /* Next argv_index */ -- if(argv[argv_index][opt_offset] == '\0') -- { -- increment_index(); -- } -- } -- } -- -- /* Calculate optind */ -- if(c == -1) -- { -- optind = argc - nonopt; -- } -- else -- { -- optind = argv_index; -- } -- -- return c; --} -- -- --/* vim:ts=3 --*/ -diff --git a/proton-c/wincompat/internal/getopt.h b/proton-c/wincompat/internal/getopt.h -deleted file mode 100644 -index 0b78650..0000000 ---- a/proton-c/wincompat/internal/getopt.h -+++ /dev/null -@@ -1,63 +0,0 @@ --/***************************************************************************** --* getopt.h - competent and free getopt library. --* $Header: /cvsroot/freegetopt/freegetopt/getopt.h,v 1.2 2003/10/26 03:10:20 vindaci Exp $ --* --* Copyright (c)2002-2003 Mark K. Kim --* All rights reserved. --* --* Redistribution and use in source and binary forms, with or without --* modification, are permitted provided that the following conditions --* are met: --* --* * Redistributions of source code must retain the above copyright --* notice, this list of conditions and the following disclaimer. --* --* * Redistributions in binary form must reproduce the above copyright --* notice, this list of conditions and the following disclaimer in --* the documentation and/or other materials provided with the --* distribution. --* --* * Neither the original author of this software nor the names of its --* contributors may be used to endorse or promote products derived --* from this software without specific prior written permission. --* --* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS --* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE --* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, --* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, --* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS --* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED --* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, --* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF --* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH --* DAMAGE. --*/ --#ifndef GETOPT_H_ --#define GETOPT_H_ -- -- --#ifdef __cplusplus --extern "C" { --#endif -- -- --extern char* optarg; --extern int optind; --extern int opterr; --extern int optopt; -- --int getopt(int argc, char** argv, char* optstr); -- -- --#ifdef __cplusplus --} --#endif -- -- --#endif /* GETOPT_H_ */ -- -- --/* vim:ts=3 --*/ --- -1.8.3.1 - diff --git a/03-PROTON-364-Install-C-examples.patch b/03-PROTON-364-Install-C-examples.patch deleted file mode 100644 index a1542d9..0000000 --- a/03-PROTON-364-Install-C-examples.patch +++ /dev/null @@ -1,76 +0,0 @@ -From bd97c8923c55063a66233e400fbd57cb772664e4 Mon Sep 17 00:00:00 2001 -From: mcpierce -Date: Wed, 24 Jul 2013 18:31:44 +0000 -Subject: [PATCH 3/3] PROTON-364: Install C examples. - -Added a install variable, EXAMPLES_INSTALL_DIR. - -Installs the send.c, recv.c, CMakeLists.txt files from the -examples/messenger/c directory. Also installs the getopt.c and getopt.h -files, related LICENSE, and the misc_defs.h and misc_funcs.inc files. - -git-svn-id: https://svn.apache.org/repos/asf/qpid/proton/trunk@1506653 13f79535-47bb-0310-9956-ffa450edef68 ---- - CMakeLists.txt | 21 +++++++++++++++++++++ - examples/messenger/c/CMakeLists.txt | 6 ++++++ - 2 files changed, 27 insertions(+) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index f16a570..9e852c3 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -69,6 +69,14 @@ set (SYSCONF_INSTALL_DIR etc CACHE PATH "System read only configuration director - set (SHARE_INSTALL_DIR share CACHE PATH "Shared read only data directory") - set (MAN_INSTALL_DIR share/man CACHE PATH "Manpage directory") - -+if (WIN32) -+ set (EXAMPLES_INSTALL_DIR proton/examples) -+endif (WIN32) -+ -+if (UNIX) -+ set (EXAMPLES_INSTALL_DIR ${SHARE_INSTALL_DIR}/proton/examples) -+endif (UNIX) -+ - set (JAVA_INSTALL_DIR ${SHARE_INSTALL_DIR}/java CACHE PATH "Installation directory for all JARs except those using JNI") - set (JNI_INSTALL_DIR ${LIB_INSTALL_DIR}/java CACHE PATH "Installation directory for all JARs utilising JNI") - set (JNI_SHARED_LIB_INSTALL_DIR ${LIB_INSTALL_DIR} CACHE PATH "Installation directory for shared objects used by JNI JARs") -@@ -99,6 +107,19 @@ add_subdirectory(proton-c) - install (FILES LICENSE README TODO - DESTINATION ${PROTON_SHARE}) - -+# install the C messenger example -+install (FILES examples/messenger/c/CMakeLists.txt -+ examples/messenger/c/send.c -+ examples/messenger/c/recv.c -+ DESTINATION ${EXAMPLES_INSTALL_DIR}/messenger) -+ -+install (FILES examples/include/pncompat/internal/LICENSE -+ examples/include/pncompat/internal/getopt.c -+ examples/include/pncompat/internal/getopt.h -+ examples/include/pncompat/misc_defs.h -+ examples/include/pncompat/misc_funcs.inc -+ DESTINATION ${EXAMPLES_INSTALL_DIR}/messenger/pncompat) -+ - # add relevant CTest support - find_program (MAVEN_EXECUTABLE mvn DOC "Location of the maven program") - if (JAVA_FOUND AND MAVEN_EXECUTABLE AND DEFINED ENV{M2_HOME}) -diff --git a/examples/messenger/c/CMakeLists.txt b/examples/messenger/c/CMakeLists.txt -index 4d2719c..faf5e85 100644 ---- a/examples/messenger/c/CMakeLists.txt -+++ b/examples/messenger/c/CMakeLists.txt -@@ -17,6 +17,12 @@ - # under the License. - # - -+cmake_minimum_required (VERSION 2.6) -+ -+find_path(PROTON_INCLUDE_DIR proton/types.h) -+find_library(PROTON_LIBRARY -+ NAMES qpid-proton) -+ - add_executable(recv recv.c) - add_executable(send send.c) - --- -1.8.3.1 - diff --git a/qpid-proton.spec b/qpid-proton.spec index 9636fd1..6683ab8 100644 --- a/qpid-proton.spec +++ b/qpid-proton.spec @@ -1,8 +1,8 @@ %global proton_datadir %{_datadir}/proton-%{version} Name: qpid-proton -Version: 0.4 -Release: 5%{?dist} +Version: 0.5 +Release: 1%{?dist} Summary: A high performance, lightweight messaging library License: ASL 2.0 @@ -19,10 +19,8 @@ BuildRequires: python-devel BuildRequires: epydoc -Patch1: 01-NO-JIRA-Fixed-RHEL5-build-errors.patch -# BZ#975723 -Patch2: 02-PROTON-348-Platform-neutral-helper-functions-for-exa.patch -Patch3: 03-PROTON-364-Install-C-examples.patch +# BZ#1000620 +Patch1: 01-PROTON-412-Fix-the-include-and-lib-directories-in-li.patch %description Proton is a high performance, lightweight messaging library. It can be used in @@ -129,8 +127,6 @@ Summary: Documentation for the Python language bindings for Qpid Proton %setup -q -n %{name}-%{version} %patch1 -p1 -%patch2 -p1 -%patch3 -p1 %build %cmake -DPROTON_DISABLE_RPATH=true . @@ -153,6 +149,10 @@ rm -rf %{buildroot}%{_datarootdir}/java rm -rf %{buildroot}%{_sysconfdir}/php.d %changelog +* Wed Aug 28 2013 Darryl L. Pierce - 0.5-5 +- Rebased on Proton 0.5. +- Resolves: BZ#1000620 + * Mon Aug 26 2013 Darryl L. Pierce - 0.4-5 - Created the qpid-proton-c-devel-doc subpackage. - Resolves: BZ#1000615 diff --git a/sources b/sources index b090d36..4cb15ca 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -73d1a18017010934b2780ccc820f0773 qpid-proton-0.4.tar.gz +fb2dc704e4d2727d664966f301bfb017 qpid-proton-0.5.tar.gz From dc03c63f1965c1691c61ae5a3448b3e902f2f29e Mon Sep 17 00:00:00 2001 From: "Darryl L. Pierce" Date: Fri, 6 Sep 2013 13:58:07 -0400 Subject: [PATCH 4/7] Made python-qpid-proton-doc a noarch package. - Resolves: BZ#1005058 --- qpid-proton.spec | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/qpid-proton.spec b/qpid-proton.spec index 6683ab8..d6deb6a 100644 --- a/qpid-proton.spec +++ b/qpid-proton.spec @@ -2,7 +2,7 @@ Name: qpid-proton Version: 0.5 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A high performance, lightweight messaging library License: ASL 2.0 @@ -111,7 +111,8 @@ Requires: python %package -n python-qpid-proton-doc -Summary: Documentation for the Python language bindings for Qpid Proton +Summary: Documentation for the Python language bindings for Qpid Proton +BuildArch: noarch %description -n python-qpid-proton-doc @@ -149,7 +150,11 @@ rm -rf %{buildroot}%{_datarootdir}/java rm -rf %{buildroot}%{_sysconfdir}/php.d %changelog -* Wed Aug 28 2013 Darryl L. Pierce - 0.5-5 +* Fri Sep 6 2013 Darryl L. Pierce - 0.5-2 +- Made python-qpid-proton-doc a noarch package. +- Resolves: BZ#1005058 + +* Wed Aug 28 2013 Darryl L. Pierce - 0.5-1 - Rebased on Proton 0.5. - Resolves: BZ#1000620 From 7c9c753bed71b0b7b97906f1fc75ce60a775a873 Mon Sep 17 00:00:00 2001 From: Marek Goldmann Date: Thu, 12 Sep 2013 16:27:07 +0200 Subject: [PATCH 5/7] Add java bindings --- qpid-proton.spec | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/qpid-proton.spec b/qpid-proton.spec index d6deb6a..e0ce0b9 100644 --- a/qpid-proton.spec +++ b/qpid-proton.spec @@ -2,7 +2,7 @@ Name: qpid-proton Version: 0.5 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A high performance, lightweight messaging library License: ASL 2.0 @@ -18,6 +18,10 @@ BuildRequires: openssl-devel BuildRequires: python-devel BuildRequires: epydoc +# Java +BuildRequires: maven-local +BuildRequires: mockito +BuildRequires: bouncycastle # BZ#1000620 Patch1: 01-PROTON-412-Fix-the-include-and-lib-directories-in-li.patch @@ -123,33 +127,61 @@ BuildArch: noarch %defattr(-,root,root,-) %{proton_datadir}/docs +%package -n qpid-proton-java +Summary: Java libraries for Qpid Proton + +%description -n qpid-proton-java +Java language bindings for the Qpid Proton messaging framework + +%package -n qpid-proton-javadoc +Summary: Javadocs for Qpid Proton + +%description -n qpid-proton-javadoc +This package contains the API documentation for %{name}. + +%files -n qpid-proton-java -f .mfiles +%dir %{_javadir}/%{name} + +%files -n qpid-proton-javadoc -f .mfiles-javadoc + %prep %setup -q -n %{name}-%{version} %patch1 -p1 +sed -i 's|bcpkix-jdk15on|bcprov-jdk16|' proton-j/proton/pom.xml + +%pom_disable_module "contrib/proton-hawtdispatch" proton-j/pom.xml +%pom_disable_module "tests" + %build %cmake -DPROTON_DISABLE_RPATH=true . make all docs %{?_smp_mflags} +%mvn_build %install %make_install +%mvn_install + chmod +x %{buildroot}%{python_sitearch}/_cproton.so # clean up files that are not shipped rm -rf %{buildroot}%{_libdir}/perl5 rm -rf %{buildroot}%{_libdir}/php -rm -rf %{buildroot}%{_libdir}/java rm -rf %{buildroot}%{_libdir}/ruby +rm -rf %{buildroot}%{_libdir}/java/*.jar rm -rf %{buildroot}%{_libdir}/libproton-jni.so rm -rf %{buildroot}%{_datarootdir}/php -rm -rf %{buildroot}%{_datarootdir}/java +rm -rf %{buildroot}%{_datarootdir}/java/*.jar rm -rf %{buildroot}%{_sysconfdir}/php.d %changelog +* Thu Sep 12 2013 Marek Goldmann - 0.5-3 +- Add java bindings + * Fri Sep 6 2013 Darryl L. Pierce - 0.5-2 - Made python-qpid-proton-doc a noarch package. - Resolves: BZ#1005058 From 54dec04ca8d46ff6714d75f2b4193b6f61ff509c Mon Sep 17 00:00:00 2001 From: "Darryl L. Pierce" Date: Thu, 16 Jan 2014 10:36:28 -0500 Subject: [PATCH 6/7] Rebased on Proton 0.6. - Update spec to delete ruby and perl5 directories if Cmake creates them. - Removed Java sub-packages - those will be packaged separate in future. --- .gitignore | 1 + ...he-include-and-lib-directories-in-li.patch | 50 --- ...ic-languages-honor-CMAKE_INSTALL_PRE.patch | 382 ++++++++++++++++++ ...N-482-Fix-the-Ruby-install-directory.patch | 34 ++ qpid-proton.spec | 74 ++-- sources | 2 +- 6 files changed, 444 insertions(+), 99 deletions(-) delete mode 100644 01-PROTON-412-Fix-the-include-and-lib-directories-in-li.patch create mode 100644 01-PROTON-445-Dynamic-languages-honor-CMAKE_INSTALL_PRE.patch create mode 100644 01-PROTON-482-Fix-the-Ruby-install-directory.patch diff --git a/.gitignore b/.gitignore index 0f02224..af3540d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /qpid-proton-c-0.3.tar.gz /qpid-proton-0.4.tar.gz /qpid-proton-0.5.tar.gz +/qpid-proton-0.6.tar.gz diff --git a/01-PROTON-412-Fix-the-include-and-lib-directories-in-li.patch b/01-PROTON-412-Fix-the-include-and-lib-directories-in-li.patch deleted file mode 100644 index 0f1277a..0000000 --- a/01-PROTON-412-Fix-the-include-and-lib-directories-in-li.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 47a7169e007de34d720a50f415b70006664634f6 Mon Sep 17 00:00:00 2001 -From: mcpierce -Date: Mon, 26 Aug 2013 20:07:22 +0000 -Subject: [PATCH] PROTON-412: Fix the include and lib directories in - libqpid-proton.pc - -If the paths aren't passed in from the command line as absolute then -prepends them with CMAKE_INSTALL_PREFIX before generated the package -config file. - -git-svn-id: https://svn.apache.org/repos/asf/qpid/proton/trunk@1517673 13f79535-47bb-0310-9956-ffa450edef68 ---- - proton-c/CMakeLists.txt | 21 ++++++++++++++++----- - 1 file changed, 16 insertions(+), 5 deletions(-) - -diff --git a/proton-c/CMakeLists.txt b/proton-c/CMakeLists.txt -index dacc9f8..42211ba 100644 ---- a/proton-c/CMakeLists.txt -+++ b/proton-c/CMakeLists.txt -@@ -331,11 +331,22 @@ install (FILES ${CMAKE_CURRENT_BINARY_DIR}/include/proton/version.h - DESTINATION ${INCLUDE_INSTALL_DIR}/proton) - - # Pkg config file --# Compatible variable names used in the pkg config files also for autoconf --get_filename_component (PREFIX ${CMAKE_INSTALL_PREFIX} ABSOLUTE) --get_filename_component (EXEC_PREFIX ${CMAKE_INSTALL_PREFIX} ABSOLUTE) --get_filename_component (LIBDIR ${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR} ABSOLUTE) --get_filename_component (INCLUDEDIR ${CMAKE_INSTALL_PREFIX}/${INCLUDE_INSTALL_DIR} ABSOLUTE) -+# make sure the install prefix is absolute -+set(INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}) -+ -+macro (pn_pkgconfig_dir NAME VALUE PREFIX) -+ if(IS_ABSOLUTE ${VALUE}) -+ set(${NAME} "${VALUE}") -+ else(IS_ABSOLUTE ${VALUE}) -+ set(${NAME} "${PREFIX}/${VALUE}") -+ endif(IS_ABSOLUTE ${VALUE}) -+ get_filename_component(${NAME} ${${NAME}} ABSOLUTE) -+endmacro(pn_pkgconfig_dir) -+ -+pn_pkgconfig_dir(PREFIX ${INSTALL_PREFIX} ${INSTALL_PREFIX}) -+pn_pkgconfig_dir(EXEC_PREFIX ${INSTALL_PREFIX} ${INSTALL_PREFIX}) -+pn_pkgconfig_dir(LIBDIR ${LIB_INSTALL_DIR} ${INSTALL_PREFIX}) -+pn_pkgconfig_dir(INCLUDEDIR ${INCLUDE_INSTALL_DIR} ${INSTALL_PREFIX}) - - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/libqpid-proton.pc.in - ${CMAKE_CURRENT_BINARY_DIR}/libqpid-proton.pc @ONLY) --- -1.8.3.1 - diff --git a/01-PROTON-445-Dynamic-languages-honor-CMAKE_INSTALL_PRE.patch b/01-PROTON-445-Dynamic-languages-honor-CMAKE_INSTALL_PRE.patch new file mode 100644 index 0000000..59ea0ff --- /dev/null +++ b/01-PROTON-445-Dynamic-languages-honor-CMAKE_INSTALL_PRE.patch @@ -0,0 +1,382 @@ +From 9b28009aa2cc117017ce03690ebaae73f17dbcf7 Mon Sep 17 00:00:00 2001 +From: "Darryl L. Pierce" +Date: Mon, 6 Jan 2014 14:00:21 -0500 +Subject: [PATCH] PROTON-445: Dynamic languages honor CMAKE_INSTALL_PREFIX + +All languages are installed to $CMAKE_INSTALL_PREFIX/bindings/$LANG by +default. + +If the ASK_BINDINGS macro is set to 1 at the command line, then each +language is interrogated as to the location of where they will be +installed, and that path modified wit the install prefix. + +Individual languages can be told to interrogate for the install path +with: + + ASK_[LANG]=1 +--- + CMakeLists.txt | 21 +++++++++++ + README | 28 +++++++++++++++ + proton-c/bindings/perl/CMakeLists.txt | 63 +++++++++++++++++---------------- + proton-c/bindings/php/CMakeLists.txt | 57 ++++++++++++++++------------- + proton-c/bindings/python/CMakeLists.txt | 23 +++++++----- + proton-c/bindings/ruby/CMakeLists.txt | 44 ++++++++--------------- + 6 files changed, 144 insertions(+), 92 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a41970a..5f567dd 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -69,6 +69,27 @@ set (SYSCONF_INSTALL_DIR etc CACHE PATH "System read only configuration director + set (SHARE_INSTALL_DIR share CACHE PATH "Shared read only data directory") + set (MAN_INSTALL_DIR share/man CACHE PATH "Manpage directory") + ++## LANGUAGE BINDINGS ++# If ASK_$LANG is 1 then the language is queried for the directory into which ++# those language bindings are to be installed. If it is 0 then the bindings ++# are installed to $CMAKE_INSTALL_PREFIX/bindings/$LANG ++# ++set (BINDINGS_DIR bindings CACHE PATH "Default directory for language bindings") ++set (ASK_PERL 0 CACHE INTEGER "Ask Perl for install directories") ++set (ASK_PHP 0 CACHE INTEGER "Ask PHP for install directories") ++set (ASK_PYTHON 0 CACHE INTEGER "Ask Python for install directories") ++set (ASK_RUBY 0 CACHE INTEGER "Ask Ruby for install directories") ++set (ASK_BINDINGS 0 CACHE INTEGER "If 1 then ask all languages for their directory") ++ ++if (ASK_BINDINGS) ++ set (ASK_PERL 1) ++ set (ASK_PHP 1) ++ set (ASK_PYTHON 1) ++ set (ASK_RUBY 1) ++endif (ASK_BINDINGS) ++ ++message(STATUS "PYTHON_ARCHLIB_DIR=${PYTHON_ARCHLIB_DIR}") ++ + if (WIN32) + set (EXAMPLES_INSTALL_DIR proton/examples) + endif (WIN32) +diff --git a/README b/README +index eca7f08..b8e7ce7 100644 +--- a/README ++++ b/README +@@ -100,6 +100,34 @@ For more on the use of DESTDIR, see the following: + + http://www.gnu.org/prep/standards/html_node/DESTDIR.html + ++== Specifying The Language Binding Install Directories == ++ ++Most dynamic languages provide a way for asking where to install libraries in ++order to place them in a default search path. ++ ++By default, Proton installs all dynamic language bindings into a central, ++default location: ++ ++ $CMAKE_INSTALL_PREFIX/bindings/$LANG ++ ++In order to use these bindings, you'll need to modify any environment variable ++to include the appropriate directories. The environment variables to be set are: ++ ++ * Perl - Add the bindings/perl and bindings/perl/lib path to PERL5PATH ++ * PHP - Set the PHPRC variable to point to bindings/php/ini/php.ini ++ * Python - Add the bindings/python path to PYTHONPATH ++ * Ruby - Add the bindings/ruby and bindings/ruby/lib path to RUBYLIB ++ ++You can tell any single language to install to the correct path for that ++language with: ++ ++ cmake -DASK_[LANGUAGE]=1 . ++ ++where [LANGUAGE] is one of: PERL, PHP, PYTHON or RUBY. To tell the build system ++to ask ALL languages, use: ++ ++ cmake -DASK_BINDINGS=1 . ++ + == Disable Building The Language Bindings == + + To disable any language bindings, you can disable them individually with: +diff --git a/proton-c/bindings/perl/CMakeLists.txt b/proton-c/bindings/perl/CMakeLists.txt +index 3f16436..158fdc6 100644 +--- a/proton-c/bindings/perl/CMakeLists.txt ++++ b/proton-c/bindings/perl/CMakeLists.txt +@@ -22,15 +22,29 @@ include_directories("${PERL_INCLUDE_PATH}") + # Need to pass in the same compiler flags used to build Perl itself + execute_process(COMMAND perl -MConfig -e "print \$Config{ccflags}" + OUTPUT_VARIABLE PERLCFLAGS) +-if (NOT PERL_VENDORLIB) ++ ++if (ASK_PERL) ++ + execute_process(COMMAND perl -V:installvendorlib +- OUTPUT_VARIABLE PERL_VENDORLIB_OUTPUT_VARIABLE +- RESULT_VARIABLE PERL_VENDORLIB_RESULT_VARIABLE) +- if (NOT PERL_VENDORLIB_RESULT_VARIABLE) +- string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_VENDORLIB ${PERL_VENDORLIB_OUTPUT_VARIABLE}) +- file(TO_CMAKE_PATH "${PERL_VENDORLIB}" PERL_VENDORLIB) +- endif (NOT PERL_VENDORLIB_RESULT_VARIABLE) +-endif (NOT PERL_VENDORLIB) ++ OUTPUT_VARIABLE PERL_ARCHLIB_OUTPUT_VARIABLE ++ RESULT_VARIABLE PERL_ARCHLIB_RESULT_VARIABLE) ++ if (NOT PERL_ARCHLIB_RESULT_VARIABLE) ++ string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_ARCHLIB ${PERL_ARCHLIB_OUTPUT_VARIABLE}) ++ file(TO_CMAKE_PATH "${PERL_ARCHLIB}" PERL_ARCHLIB_DIR) ++ endif (NOT PERL_ARCHLIB_RESULT_VARIABLE) ++ ++ execute_process(COMMAND perl -V:installsitelib ++ OUTPUT_VARIABLE PERL_SITELIB_OUTPUT_VARIABLE ++ RESULT_VARIABLE PERL_SITELIB_RESULT_VARIABLE) ++ if (NOT PERL_SITELIB_RESULT_VARIABLE) ++ string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_SITELIB ${PERL_SITELIB_OUTPUT_VARIABLE}) ++ file(TO_CMAKE_PATH "${PERL_SITELIB}" PERL_SITELIB_DIR) ++ endif (NOT PERL_SITELIB_RESULT_VARIABLE) ++ ++else (ASK_PERL) ++ set (PERL_ARCHLIB_DIR ${BINDINGS_DIR}/perl/lib${LIB_SUFFIX} CACHE PATH "Perl platform code") ++ set (PERL_SITELIB_DIR ${BINDINGS_DIR}/perl/ CACHE PATH "Perl code") ++endif (ASK_PERL) + + set (CMAKE_C_FLAGS ${PERLCFLAGS}) + +@@ -39,45 +53,32 @@ swig_link_libraries(cproton_perl ${BINDING_DEPS} ${PERL_LIBRARY}) + + if ((${CMAKE_MAJOR_VERSION} EQUAL 2) AND (${CMAKE_MINOR_VERSION} LESS 8)) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cproton_perl.so +- DESTINATION ${PERL_ARCHLIB} ++ DESTINATION ${PERL_ARCHLIB_DIR} + COMPONENT ${QPID_COMPONENT_CLIENT} + ) + else() + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libcproton_perl.so + RENAME cproton_perl.so +- DESTINATION ${PERL_ARCHLIB} ++ DESTINATION ${PERL_ARCHLIB_DIR} + COMPONENT ${QPID_COMPONENT_CLIENT} + ) + endif ((${CMAKE_MAJOR_VERSION} EQUAL 2) AND (${CMAKE_MINOR_VERSION} LESS 8)) + +-set(PERL_LIBRARIES +- lib/qpid/proton/array_helper.pm +- lib/qpid/proton/Constants.pm +- lib/qpid/proton/Data.pm +- lib/qpid/proton/Mapping.pm +- lib/qpid/proton/Message.pm +- lib/qpid/proton/Messenger.pm +-) +- + # get the perl vendor library if it's not already defined +-#if (NOT PERL_VENDORLIB) ++#if (NOT PERL_ARCHLIB) + # execute_process(COMMAND ${PERL_EXECUTABLE} "-V:installvendorlib" +-# OUTPUT_VARIABLE PERL_VENDORLIB_OUTPUT_VARIABLE +-# RESULT_VARIABLE PERL_VENDORLIB_RESULT_VARIABLE) +-#endif (!DEFINED PERL_VENDORLIB) ++# OUTPUT_VARIABLE PERL_ARCHLIB_OUTPUT_VARIABLE ++# RESULT_VARIABLE PERL_ARCHLIB_RESULT_VARIABLE) ++#endif (!DEFINED PERL_ARCHLIB) + + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cproton_perl.pm +- DESTINATION ${PERL_ARCHLIB} ++ DESTINATION ${PERL_ARCHLIB_DIR} + COMPONENT Perl) + + install(FILES lib/qpid_proton.pm +- DESTINATION ${PERL_VENDORLIB} +- COMPONENT Perl) +- +-INSTALL(FILES lib/qpid/proton.pm +- DESTINATION ${PERL_VENDORLIB}/qpid ++ DESTINATION ${PERL_SITELIB_DIR} + COMPONENT Perl) + +-INSTALL(FILES ${PERL_LIBRARIES} +- DESTINATION ${PERL_VENDORLIB}/qpid/proton ++INSTALL(DIRECTORY lib/qpid ++ DESTINATION ${PERL_SITELIB_DIR} + COMPONENT Perl) +diff --git a/proton-c/bindings/php/CMakeLists.txt b/proton-c/bindings/php/CMakeLists.txt +index d64d568..9b6ee2c 100644 +--- a/proton-c/bindings/php/CMakeLists.txt ++++ b/proton-c/bindings/php/CMakeLists.txt +@@ -39,35 +39,44 @@ set_target_properties(cproton + PREFIX "" + LINK_FLAGS "${ALLOW_UNDEFINED}") + +-execute_process(COMMAND ${PHP_CONFIG_EXE} --extension-dir +- OUTPUT_VARIABLE PHP_EXT_DIR_DEFAULT +- OUTPUT_STRIP_TRAILING_WHITESPACE) +-execute_process(COMMAND ${PHP_CONFIG_EXE} --prefix +- OUTPUT_VARIABLE QPHP_PREFIX +- OUTPUT_STRIP_TRAILING_WHITESPACE) +-execute_process(COMMAND ${PHP_CONFIG_EXE} --config-options +- OUTPUT_VARIABLE PHP_OPTS +- OUTPUT_STRIP_TRAILING_WHITESPACE) ++if (ASK_PHP) ++ execute_process(COMMAND ${PHP_CONFIG_EXE} --extension-dir ++ OUTPUT_VARIABLE PHP_EXT_DIR_DEFAULT ++ OUTPUT_STRIP_TRAILING_WHITESPACE) ++ execute_process(COMMAND ${PHP_CONFIG_EXE} --prefix ++ OUTPUT_VARIABLE QPHP_PREFIX ++ OUTPUT_STRIP_TRAILING_WHITESPACE) ++ execute_process(COMMAND ${PHP_CONFIG_EXE} --config-options ++ OUTPUT_VARIABLE PHP_OPTS ++ OUTPUT_STRIP_TRAILING_WHITESPACE) + +-set(GET_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/get_include_dir.php) +-execute_process(COMMAND ${PHP_EXE} -n ${GET_INCLUDE_DIR} ${QPHP_PREFIX} +- OUTPUT_VARIABLE PHP_INCLUDE_DIR_DEFAULT +- OUTPUT_STRIP_TRAILING_WHITESPACE) ++ set(GET_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/get_include_dir.php) ++ execute_process(COMMAND ${PHP_EXE} -n ${GET_INCLUDE_DIR} ${QPHP_PREFIX} ++ OUTPUT_VARIABLE PHP_INCLUDE_DIR_DEFAULT ++ OUTPUT_STRIP_TRAILING_WHITESPACE) ++ ++ if ("${PHP_INCLUDE_DIR_DEFAULT}" STREQUAL "") ++ set(PHP_INCLUDE_DIR_DEFAULT "/usr/share/php") ++ endif() ++ ++ string(REGEX MATCH "--with-config-file-scan-dir=([^ ]*)" PHP_OPT_MATCH ${PHP_OPTS}) ++ set (PHP_INI_DIR_DEFAULT ${CMAKE_MATCH_1}) ++ ++ if ("${PHP_INI_DIR_DEFAULT}" STREQUAL "") ++ set(PHP_INI_DIR_DEFAULT "/etc/php.d") ++ endif() + +-if ("${PHP_INCLUDE_DIR_DEFAULT}" STREQUAL "") +- set(PHP_INCLUDE_DIR_DEFAULT "/usr/share/php") +-endif() ++ set(PHP_EXT_DIR ${PHP_EXT_DIR_DEFAULT} CACHE PATH "PHP extensions directory.") ++ set(PHP_INI_DIR ${PHP_INI_DIR_DEFAULT} CACHE PATH "Directory scanned for PHP ini files.") ++ set(PHP_INCLUDE_DIR ${PHP_INCLUDE_DIR_DEFAULT} CACHE PATH "PHP include directory.") + +-string(REGEX MATCH "--with-config-file-scan-dir=([^ ]*)" PHP_OPT_MATCH ${PHP_OPTS}) +-set (PHP_INI_DIR_DEFAULT ${CMAKE_MATCH_1}) ++else (ASK_PHP) + +-if ("${PHP_INI_DIR_DEFAULT}" STREQUAL "") +- set(PHP_INI_DIR_DEFAULT "/etc/php.d") +-endif() ++ set (PHP_EXT_DIR ${BINDINGS_DIR}/php CACHE PATH "PHP extensions directory") ++ set (PHP_INCLUDE_DIR ${BINDINGS_DIR}/php/include CACHE PATH "PHP include directory") ++ set (PHP_INI_DIR ${BINDINGS_DIR}/php/ini CACHE PATH "PHP ini directory") + +-set(PHP_EXT_DIR ${PHP_EXT_DIR_DEFAULT} CACHE PATH "PHP extensions directory.") +-set(PHP_INI_DIR ${PHP_INI_DIR_DEFAULT} CACHE PATH "Directory scanned for PHP ini files.") +-set(PHP_INCLUDE_DIR ${PHP_INCLUDE_DIR_DEFAULT} CACHE PATH "PHP include directory.") ++endif (ASK_PHP) + + install(TARGETS cproton + DESTINATION ${PHP_EXT_DIR} +diff --git a/proton-c/bindings/python/CMakeLists.txt b/proton-c/bindings/python/CMakeLists.txt +index a61277a..b63b6fd 100644 +--- a/proton-c/bindings/python/CMakeLists.txt ++++ b/proton-c/bindings/python/CMakeLists.txt +@@ -30,12 +30,19 @@ set_target_properties(_cproton + + find_package(PythonInterp REQUIRED) + +-if (NOT PYTHON_SITEARCH_PACKAGES) +- execute_process(COMMAND ${PYTHON_EXECUTABLE} +- -c "from distutils.sysconfig import get_python_lib; print get_python_lib(True)" +- OUTPUT_VARIABLE PYTHON_SITEARCH_PACKAGES +- OUTPUT_STRIP_TRAILING_WHITESPACE) +-endif () ++if (ASK_PYTHON) ++ ++ if (NOT PYTHON_SITEARCH_PACKAGES) ++ execute_process(COMMAND ${PYTHON_EXECUTABLE} ++ -c "from distutils.sysconfig import get_python_lib; print get_python_lib(True)" ++ OUTPUT_VARIABLE PYTHON_ARCHLIB_DIR ++ OUTPUT_STRIP_TRAILING_WHITESPACE) ++ else (NOT PYTHON_SITEARCH_PACKAGES) ++ set (PYTHON_ARCHLIB_DIR "${PYTHON_SITEARCH_PACKAGES}") ++ endif () ++else (ASK_PYTHON) ++ set (PYTHON_ARCHLIB_DIR ${BINDINGS_DIR}/python/lib${LIB_SUFFIX} CACHE PATH "Python platform code") ++endif (ASK_PYTHON) + + install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -m py_compile cproton.py + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})") +@@ -64,8 +71,8 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cproton.py + ${CMAKE_CURRENT_SOURCE_DIR}/proton.py + ${CMAKE_CURRENT_SOURCE_DIR}/proton.pyc + ${CMAKE_CURRENT_SOURCE_DIR}/proton.pyo +- DESTINATION ${PYTHON_SITEARCH_PACKAGES} ++ DESTINATION ${PYTHON_ARCHLIB_DIR} + COMPONENT Python) + install(TARGETS _cproton +- DESTINATION ${PYTHON_SITEARCH_PACKAGES} ++ DESTINATION ${PYTHON_ARCHLIB_DIR} + COMPONENT Python) +diff --git a/proton-c/bindings/ruby/CMakeLists.txt b/proton-c/bindings/ruby/CMakeLists.txt +index 4d62819..5768907 100644 +--- a/proton-c/bindings/ruby/CMakeLists.txt ++++ b/proton-c/bindings/ruby/CMakeLists.txt +@@ -26,38 +26,16 @@ set_target_properties(cproton-ruby + OUTPUT_NAME "cproton" + LINK_FLAGS "${CATCH_UNDEFINED}" ) + +-install(TARGETS cproton-ruby +- DESTINATION ${RUBY_ARCH_DIR} +- COMPONENT Ruby) +- +-# Install the Ruby libraries +-set(RUBY_LIBRARIES +- lib/qpid_proton/array.rb +- lib/qpid_proton/data.rb +- lib/qpid_proton/described.rb +- lib/qpid_proton/exception_handling.rb +- lib/qpid_proton/exceptions.rb +- lib/qpid_proton/hash.rb +- lib/qpid_proton/mapping.rb +- lib/qpid_proton/message_format.rb +- lib/qpid_proton/message.rb +- lib/qpid_proton/messenger.rb +- lib/qpid_proton/subscription.rb +- lib/qpid_proton/tracker.rb +- lib/qpid_proton/tracker_status.rb +-) ++if (ASK_RUBY) + +-set(RUBY_ARCHLIB_DIR "${RUBY_VENDORLIB_DIR}") +- +-if (NOT RUBY_ARCHLIB_DIR) + execute_process(COMMAND ${RUBY_EXECUTABLE} +- -r rbconfig -e "print RbConfig::CONFIG['vendorarchdir'] || ''" ++ -r rbconfig -e "print RbConfig::CONFIG['vendorarchdir'] || ''" + RESULT_VARIABLE RESULT_RUBY_ARCHLIB_DIR + OUTPUT_VARIABLE OUTPUT_RUBY_ARCHLIB_DIR) + + if(OUTPUT_RUBY_ARCHLIB_DIR STREQUAL "") + execute_process(COMMAND ${RUBY_EXECUTABLE} +- -r rbconfig -e "print RbConfig::CONFIG['sitearchdir'] || ''" ++ -r rbconfig -e "print RbConfig::CONFIG['archdir'] || ''" + RESULT_VARIABLE RESULT_RUBY_ARCHLIB_DIR + OUTPUT_VARIABLE OUTPUT_RUBY_ARCHLIB_DIR) + +@@ -65,12 +43,20 @@ if (NOT RUBY_ARCHLIB_DIR) + + set(RUBY_ARCHLIB_DIR "${OUTPUT_RUBY_ARCHLIB_DIR}") + +-endif () ++else (ASK_RUBY) ++ ++ set (RUBY_SITELIB_DIR ${BINDINGS_DIR}/ruby CACHE PATH "Ruby portable code") ++ set (RUBY_ARCHLIB_DIR ${BINDINGS_DIR}/ruby/lib${LIB_SUFFIX} CACHE PATH "Ruby platform code") ++ ++endif (ASK_RUBY) + ++ ++install(TARGETS cproton-ruby ++ DESTINATION ${RUBY_ARCHLIB_DIR} ++ COMPONENT Ruby) + install(FILES lib/qpid_proton.rb + DESTINATION ${RUBY_ARCHLIB_DIR} + COMPONENT Ruby) +- +-install(FILES ${RUBY_LIBRARIES} +- DESTINATION ${RUBY_ARCHLIB_DIR}/qpid_proton ++install(DIRECTORY lib/qpid_proton ++ DESTINATION ${RUBY_ARCHLIB_DIR} + COMPONENT Ruby) +-- +1.8.4.2 + diff --git a/01-PROTON-482-Fix-the-Ruby-install-directory.patch b/01-PROTON-482-Fix-the-Ruby-install-directory.patch new file mode 100644 index 0000000..a2a72a1 --- /dev/null +++ b/01-PROTON-482-Fix-the-Ruby-install-directory.patch @@ -0,0 +1,34 @@ +From 8dbabe96f2363893b83ac0bc4fa124bca0e46bf4 Mon Sep 17 00:00:00 2001 +From: "Darryl L. Pierce" +Date: Thu, 19 Dec 2013 09:47:57 -0500 +Subject: [PATCH] PROTON-482: Fix the Ruby install directory. + +Use vendorarchdir rather than vendorlibdir. +--- + proton-c/bindings/ruby/CMakeLists.txt | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/proton-c/bindings/ruby/CMakeLists.txt b/proton-c/bindings/ruby/CMakeLists.txt +index 65c71f1..4d62819 100644 +--- a/proton-c/bindings/ruby/CMakeLists.txt ++++ b/proton-c/bindings/ruby/CMakeLists.txt +@@ -51,13 +51,13 @@ set(RUBY_ARCHLIB_DIR "${RUBY_VENDORLIB_DIR}") + + if (NOT RUBY_ARCHLIB_DIR) + execute_process(COMMAND ${RUBY_EXECUTABLE} +- -r rbconfig -e "print RbConfig::CONFIG['vendorlibdir']" ++ -r rbconfig -e "print RbConfig::CONFIG['vendorarchdir'] || ''" + RESULT_VARIABLE RESULT_RUBY_ARCHLIB_DIR + OUTPUT_VARIABLE OUTPUT_RUBY_ARCHLIB_DIR) + +- if(NOT RESULT_RUBY_ARCHLIB_DIR AND OUTPUT_RUBY_ARCHLIB_DIR ) ++ if(OUTPUT_RUBY_ARCHLIB_DIR STREQUAL "") + execute_process(COMMAND ${RUBY_EXECUTABLE} +- -r rbconfig -e "print RbConfig::CONFIG['sitearchdir']" ++ -r rbconfig -e "print RbConfig::CONFIG['sitearchdir'] || ''" + RESULT_VARIABLE RESULT_RUBY_ARCHLIB_DIR + OUTPUT_VARIABLE OUTPUT_RUBY_ARCHLIB_DIR) + +-- +1.8.3.1 + diff --git a/qpid-proton.spec b/qpid-proton.spec index e0ce0b9..7cf36a1 100644 --- a/qpid-proton.spec +++ b/qpid-proton.spec @@ -1,14 +1,16 @@ %global proton_datadir %{_datadir}/proton-%{version} Name: qpid-proton -Version: 0.5 -Release: 3%{?dist} +Version: 0.6 +Release: 1%{?dist} Summary: A high performance, lightweight messaging library License: ASL 2.0 URL: http://qpid.apache.org/proton/ Source0: http://www.apache.org/dist/qpid/proton/%{version}/%{name}-%{version}.tar.gz +Patch1: 01-PROTON-445-Dynamic-languages-honor-CMAKE_INSTALL_PRE.patch + BuildRequires: cmake >= 2.6 BuildRequires: swig BuildRequires: pkgconfig @@ -18,13 +20,7 @@ BuildRequires: openssl-devel BuildRequires: python-devel BuildRequires: epydoc -# Java -BuildRequires: maven-local -BuildRequires: mockito -BuildRequires: bouncycastle -# BZ#1000620 -Patch1: 01-PROTON-412-Fix-the-include-and-lib-directories-in-li.patch %description Proton is a high performance, lightweight messaging library. It can be used in @@ -34,8 +30,9 @@ standard. Using Proton it is trivial to integrate with the AMQP 1.0 ecosystem from any platform, environment, or language. + %package -n qpid-proton-c -Summary: C librarys for Qpid Proton +Summary: C libraries for Qpid Proton Obsoletes: qpid-proton < %{version}-%{release} Provides: qpid-proton = %{version}-%{release} @@ -62,6 +59,7 @@ Provides: qpid-proton = %{version}-%{release} %postun -n qpid-proton-c -p /sbin/ldconfig + %package -n qpid-proton-c-devel Requires: qpid-proton-c%{?_isa} = %{version}-%{release} Summary: Development libraries for writing messaging apps with Qpid Proton @@ -78,6 +76,8 @@ Provides: qpid-proton-devel = %{version}-%{release} %{_includedir}/proton %{_libdir}/libqpid-proton.so %{_libdir}/pkgconfig/libqpid-proton.pc +%{_datadir}/proton/examples + %package -n qpid-proton-c-devel-doc @@ -89,9 +89,7 @@ BuildArch: noarch %files -n qpid-proton-c-devel-doc %defattr(-,root,root,-) -%{proton_datadir}/docs/api-c -%{_datadir}/proton/examples - +%doc %{proton_datadir}/docs/api-c @@ -102,7 +100,6 @@ Requires: qpid-proton-c%{?_isa} = %{version}-%{release} Requires: python - %description -n python-qpid-proton %{summary}. @@ -114,6 +111,7 @@ Requires: python %{python_sitearch}/proton.* + %package -n python-qpid-proton-doc Summary: Documentation for the Python language bindings for Qpid Proton BuildArch: noarch @@ -125,60 +123,40 @@ BuildArch: noarch %files -n python-qpid-proton-doc %defattr(-,root,root,-) -%{proton_datadir}/docs - -%package -n qpid-proton-java -Summary: Java libraries for Qpid Proton - -%description -n qpid-proton-java -Java language bindings for the Qpid Proton messaging framework - -%package -n qpid-proton-javadoc -Summary: Javadocs for Qpid Proton - -%description -n qpid-proton-javadoc -This package contains the API documentation for %{name}. - -%files -n qpid-proton-java -f .mfiles -%dir %{_javadir}/%{name} - -%files -n qpid-proton-javadoc -f .mfiles-javadoc - +%doc %{proton_datadir}/docs/api-py %prep %setup -q -n %{name}-%{version} %patch1 -p1 -sed -i 's|bcpkix-jdk15on|bcprov-jdk16|' proton-j/proton/pom.xml - -%pom_disable_module "contrib/proton-hawtdispatch" proton-j/pom.xml -%pom_disable_module "tests" %build -%cmake -DPROTON_DISABLE_RPATH=true . +%cmake \ + -DPROTON_DISABLE_RPATH=true \ + -DPYTHON_ARCHLIB_DIR=%{python_sitearch} \ + . make all docs %{?_smp_mflags} -%mvn_build %install %make_install -%mvn_install - chmod +x %{buildroot}%{python_sitearch}/_cproton.so # clean up files that are not shipped -rm -rf %{buildroot}%{_libdir}/perl5 -rm -rf %{buildroot}%{_libdir}/php -rm -rf %{buildroot}%{_libdir}/ruby -rm -rf %{buildroot}%{_libdir}/java/*.jar +rm -rf %{buildroot}%{_exec_prefix}/bindings +rm -rf %{buildroot}%{_libdir}/java rm -rf %{buildroot}%{_libdir}/libproton-jni.so -rm -rf %{buildroot}%{_datarootdir}/php -rm -rf %{buildroot}%{_datarootdir}/java/*.jar -rm -rf %{buildroot}%{_sysconfdir}/php.d +rm -rf %{buildroot}%{_datarootdir}/java +rm -rf %{buildroot}%{_libdir}/proton.cmake %changelog +* Thu Jan 16 2014 Darryl L. Pierce - 0.6-1 +- Rebased on Proton 0.6. +- Update spec to delete ruby and perl5 directories if Cmake creates them. +- Removed Java sub-packages - those will be packaged separate in future. + * Thu Sep 12 2013 Marek Goldmann - 0.5-3 - Add java bindings @@ -201,7 +179,7 @@ rm -rf %{buildroot}%{_sysconfdir}/php.d - Provide examples for qpid-proton-c - Resolves: BZ#975723 -* Fri Apr 4 2013 Darryl L. Pierce - 0.4-2.2 +* Fri Apr 5 2013 Darryl L. Pierce - 0.4-2.2 - Added Obsoletes and Provides for packages whose names changed. - Resolves: BZ#948784 diff --git a/sources b/sources index 4cb15ca..a81ddae 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -fb2dc704e4d2727d664966f301bfb017 qpid-proton-0.5.tar.gz +8987587270dd8208cab072daa44cdc37 qpid-proton-0.6.tar.gz From 13551be9820e0669c5a5b643cd1063850dfc1912 Mon Sep 17 00:00:00 2001 From: "Darryl L. Pierce" Date: Mon, 24 Feb 2014 15:01:36 -0500 Subject: [PATCH 7/7] Reorganized the subpackages. --- qpid-proton.spec | 52 ++++++++++++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 19 deletions(-) diff --git a/qpid-proton.spec b/qpid-proton.spec index 7cf36a1..52543b7 100644 --- a/qpid-proton.spec +++ b/qpid-proton.spec @@ -2,21 +2,31 @@ Name: qpid-proton Version: 0.6 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A high performance, lightweight messaging library License: ASL 2.0 URL: http://qpid.apache.org/proton/ -Source0: http://www.apache.org/dist/qpid/proton/%{version}/%{name}-%{version}.tar.gz +Source0: http://www.apache.org/dist/qpid/proton/%{version}/%{name}-%{version}.tar.gz Patch1: 01-PROTON-445-Dynamic-languages-honor-CMAKE_INSTALL_PRE.patch +%if (0%{?fedora} || 0%{?rhel} == 7) BuildRequires: cmake >= 2.6 +%global cmake_exe %{cmake} +%endif + +%if 0%{?rhel} == 6 +BuildRequires: cmake28 +%global cmake_exe %{cmake28} +%endif + BuildRequires: swig BuildRequires: pkgconfig BuildRequires: doxygen BuildRequires: libuuid-devel BuildRequires: openssl-devel +BuildRequires: python BuildRequires: python-devel BuildRequires: epydoc @@ -29,19 +39,19 @@ routers, bridges, proxies, and more. Proton is based on the AMQP 1.0 messaging standard. Using Proton it is trivial to integrate with the AMQP 1.0 ecosystem from any platform, environment, or language. +# === qpid-proton-c - -%package -n qpid-proton-c +%package c Summary: C libraries for Qpid Proton Obsoletes: qpid-proton < %{version}-%{release} Provides: qpid-proton = %{version}-%{release} -%description -n qpid-proton-c +%description c %{summary}. -%files -n qpid-proton-c +%files c %defattr(-,root,root,-) %dir %{proton_datadir} %doc %{proton_datadir}/LICENSE @@ -53,45 +63,45 @@ Provides: qpid-proton = %{version}-%{release} %{_libdir}/libqpid-proton.so.* -%post -n qpid-proton-c -p /sbin/ldconfig - +%post c -p /sbin/ldconfig -%postun -n qpid-proton-c -p /sbin/ldconfig +%postun c -p /sbin/ldconfig +# === qpid-proton-c-devel -%package -n qpid-proton-c-devel +%package c-devel Requires: qpid-proton-c%{?_isa} = %{version}-%{release} Summary: Development libraries for writing messaging apps with Qpid Proton Obsoletes: qpid-proton-devel < %{version}-%{release} Provides: qpid-proton-devel = %{version}-%{release} -%description -n qpid-proton-c-devel +%description c-devel %{summary}. -%files -n qpid-proton-c-devel +%files c-devel %defattr(-,root,root,-) %{_includedir}/proton %{_libdir}/libqpid-proton.so %{_libdir}/pkgconfig/libqpid-proton.pc %{_datadir}/proton/examples +# === qpid-proton-c-devel-doc - -%package -n qpid-proton-c-devel-doc +%package c-devel-doc Summary: Documentation for the C development libraries for Qpid Proton BuildArch: noarch -%description -n qpid-proton-c-devel-doc +%description c-devel-doc %{summary}. -%files -n qpid-proton-c-devel-doc +%files c-devel-doc %defattr(-,root,root,-) %doc %{proton_datadir}/docs/api-c - +# === python-qpid-proton %package -n python-qpid-proton Summary: Python language bindings for the Qpid Proton messaging framework @@ -110,7 +120,7 @@ Requires: python %{python_sitearch}/cproton.* %{python_sitearch}/proton.* - +# === python-qpid-proton-doc %package -n python-qpid-proton-doc Summary: Documentation for the Python language bindings for Qpid Proton @@ -132,7 +142,8 @@ BuildArch: noarch %build -%cmake \ + +%cmake_exe \ -DPROTON_DISABLE_RPATH=true \ -DPYTHON_ARCHLIB_DIR=%{python_sitearch} \ . @@ -152,6 +163,9 @@ rm -rf %{buildroot}%{_datarootdir}/java rm -rf %{buildroot}%{_libdir}/proton.cmake %changelog +* Thu Feb 24 2014 Darryl L. Pierce - 0.6-2 +- Reorganized the subpackages. + * Thu Jan 16 2014 Darryl L. Pierce - 0.6-1 - Rebased on Proton 0.6. - Update spec to delete ruby and perl5 directories if Cmake creates them.