diff options
author | Dave Cobbley <david.j.cobbley@linux.intel.com> | 2018-08-14 20:05:37 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-08-23 04:26:31 +0300 |
commit | eb8dc40360f0cfef56fb6947cc817a547d6d9bc6 (patch) | |
tree | de291a73dc37168da6370e2cf16c347d1eba9df8 /meta-openembedded/meta-oe/recipes-dbs | |
parent | 9c3cf826d853102535ead04cebc2d6023eff3032 (diff) | |
download | openbmc-eb8dc40360f0cfef56fb6947cc817a547d6d9bc6.tar.xz |
[Subtree] Removing import-layers directory
As part of the move to subtrees, need to bring all the import layers
content to the top level.
Change-Id: I4a163d10898cbc6e11c27f776f60e1a470049d8f
Signed-off-by: Dave Cobbley <david.j.cobbley@linux.intel.com>
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'meta-openembedded/meta-oe/recipes-dbs')
57 files changed, 2981 insertions, 0 deletions
diff --git a/meta-openembedded/meta-oe/recipes-dbs/leveldb/leveldb/0001-Makefile-Fix-parallel-build.patch b/meta-openembedded/meta-oe/recipes-dbs/leveldb/leveldb/0001-Makefile-Fix-parallel-build.patch new file mode 100644 index 0000000000..3135d4d5ac --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/leveldb/leveldb/0001-Makefile-Fix-parallel-build.patch @@ -0,0 +1,34 @@ +From c85978e77725ef233543370d24e23f853f449170 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Thu, 21 Sep 2017 17:47:02 -0700 +Subject: [PATCH] Makefile: Fix parallel build + +Sometimes mkdir $(SHARED_OUTDIR)/db races with compiler which is +creating .o file in the same directory $(SHARED_OUTDIR)/db/db_bench.o + +Fixes error like + +| mkdir out-static +| mkdir out-shared/db +| Assembler messages: +| Fatal error: can't create out-shared/db/db_bench.o: No such file or directory + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Submitted + + Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Makefile b/Makefile +index f7cc7d7..51a0bcd 100644 +--- a/Makefile ++++ b/Makefile +@@ -386,6 +386,7 @@ $(STATIC_OUTDIR)/write_batch_test:db/write_batch_test.cc $(STATIC_LIBOBJECTS) $( + $(STATIC_OUTDIR)/memenv_test:$(STATIC_OUTDIR)/helpers/memenv/memenv_test.o $(STATIC_OUTDIR)/libmemenv.a $(STATIC_OUTDIR)/libleveldb.a $(TESTHARNESS) + $(XCRUN) $(CXX) $(LDFLAGS) $(STATIC_OUTDIR)/helpers/memenv/memenv_test.o $(STATIC_OUTDIR)/libmemenv.a $(STATIC_OUTDIR)/libleveldb.a $(TESTHARNESS) -o $@ $(LIBS) + ++$(SHARED_OUTDIR)/db/db_bench.o: | $(SHARED_OUTDIR)/db + $(SHARED_OUTDIR)/db_bench:$(SHARED_OUTDIR)/db/db_bench.o $(SHARED_LIBS) $(TESTUTIL) + $(XCRUN) $(CXX) $(LDFLAGS) $(CXXFLAGS) $(PLATFORM_SHARED_CFLAGS) $(SHARED_OUTDIR)/db/db_bench.o $(TESTUTIL) $(SHARED_OUTDIR)/$(SHARED_LIB3) -o $@ $(LIBS) + diff --git a/meta-openembedded/meta-oe/recipes-dbs/leveldb/leveldb/0001-build_detect_platform-Check-for-__SSE4_2__.patch b/meta-openembedded/meta-oe/recipes-dbs/leveldb/leveldb/0001-build_detect_platform-Check-for-__SSE4_2__.patch new file mode 100644 index 0000000000..8f93cb325b --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/leveldb/leveldb/0001-build_detect_platform-Check-for-__SSE4_2__.patch @@ -0,0 +1,37 @@ +From 5fd0918df2bb30e8f3edb2ee895d178edbf26f40 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Mon, 4 Sep 2017 22:38:03 -0700 +Subject: [PATCH 1/2] build_detect_platform: Check for __SSE4_2__ + +just using -msse4.2 is not enough, especially with clang +where it may accept -msse4.2 even during cross compiling +for say arm, however the difference is that builtin defines +wont be defined. + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Pending + + build_detect_platform | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +Index: git/build_detect_platform +=================================================================== +--- git.orig/build_detect_platform ++++ git/build_detect_platform +@@ -224,13 +224,13 @@ EOF + rm -f $CXXOUTPUT 2>/dev/null + + # Test if gcc SSE 4.2 is supported +- $CXX $CXXFLAGS -x c++ - -o $CXXOUTPUT -msse4.2 2>/dev/null <<EOF ++ $CXX $CXXFLAGS -Werror -x c++ - -o $CXXOUTPUT -msse4.2 -dD -E 2>/dev/null <<EOF + int main() {} + EOF ++ eval fgrep __SSE4_2__ $CXXOUTPUT >/dev/null 2>&1 + if [ "$?" = 0 ]; then + PLATFORM_SSEFLAGS="-msse4.2" + fi +- + rm -f $CXXOUTPUT 2>/dev/null + fi + diff --git a/meta-openembedded/meta-oe/recipes-dbs/leveldb/leveldb/0002-makefile-build-SHARED_MEMENVLIB.patch b/meta-openembedded/meta-oe/recipes-dbs/leveldb/leveldb/0002-makefile-build-SHARED_MEMENVLIB.patch new file mode 100644 index 0000000000..fc708b23ad --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/leveldb/leveldb/0002-makefile-build-SHARED_MEMENVLIB.patch @@ -0,0 +1,43 @@ +From 1ed8cec1fcf666904bb3ebd29fc85e235b72d122 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Mon, 4 Sep 2017 22:40:49 -0700 +Subject: [PATCH 2/2] makefile: build SHARED_MEMENVLIB + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Pending + + Makefile | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/Makefile b/Makefile +index f7cc7d7..cb42278 100644 +--- a/Makefile ++++ b/Makefile +@@ -126,12 +126,12 @@ SHARED_VERSION_MINOR = 20 + SHARED_LIB1 = libleveldb.$(PLATFORM_SHARED_EXT) + SHARED_LIB2 = $(SHARED_LIB1).$(SHARED_VERSION_MAJOR) + SHARED_LIB3 = $(SHARED_LIB1).$(SHARED_VERSION_MAJOR).$(SHARED_VERSION_MINOR) +-SHARED_LIBS = $(SHARED_OUTDIR)/$(SHARED_LIB1) $(SHARED_OUTDIR)/$(SHARED_LIB2) $(SHARED_OUTDIR)/$(SHARED_LIB3) ++SHARED_LIBS = $(SHARED_OUTDIR)/$(SHARED_LIB1) $(SHARED_OUTDIR)/$(SHARED_LIB2) $(SHARED_OUTDIR)/$(SHARED_LIB3) $(SHARED_MEMENVLIB) + $(SHARED_OUTDIR)/$(SHARED_LIB1): $(SHARED_OUTDIR)/$(SHARED_LIB3) + ln -fs $(SHARED_LIB3) $(SHARED_OUTDIR)/$(SHARED_LIB1) + $(SHARED_OUTDIR)/$(SHARED_LIB2): $(SHARED_OUTDIR)/$(SHARED_LIB3) + ln -fs $(SHARED_LIB3) $(SHARED_OUTDIR)/$(SHARED_LIB2) +-SHARED_MEMENVLIB = $(SHARED_OUTDIR)/libmemenv.a ++SHARED_MEMENVLIB = $(SHARED_OUTDIR)/libmemenv.$(PLATFORM_SHARED_EXT).$(SHARED_VERSION_MAJOR).$(SHARED_VERSION_MINOR) + endif + + $(SHARED_OUTDIR)/$(SHARED_LIB3): $(SHARED_LIBOBJECTS) +@@ -294,7 +294,7 @@ endif + + $(SHARED_MEMENVLIB):$(SHARED_MEMENVOBJECTS) + rm -f $@ +- $(AR) -rs $@ $(SHARED_MEMENVOBJECTS) ++ $(CXX) $(LDFLAGS) $(PLATFORM_SHARED_LDFLAGS)$(basename $(notdir $(SHARED_MEMENVLIB))) $(SHARED_MEMENVOBJECTS) -o $(SHARED_MEMENVLIB) $(LIBS) + + $(STATIC_OUTDIR)/db_bench:db/db_bench.cc $(STATIC_LIBOBJECTS) $(TESTUTIL) + $(CXX) $(LDFLAGS) $(CXXFLAGS) db/db_bench.cc $(STATIC_LIBOBJECTS) $(TESTUTIL) -o $@ $(LIBS) +-- +2.14.1 + diff --git a/meta-openembedded/meta-oe/recipes-dbs/leveldb/leveldb_git.bb b/meta-openembedded/meta-oe/recipes-dbs/leveldb/leveldb_git.bb new file mode 100644 index 0000000000..8fec89c6f1 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/leveldb/leveldb_git.bb @@ -0,0 +1,37 @@ +SUMMARY = "LevelDB is a fast key-value storage library" +DESCRIPTION = "LevelDB is a fast key-value storage library that provides an ordered mapping from string keys to string values" +HOMEPAGE = "http://leveldb.googlecode.com" +LICENSE = "BSD-3-Clause" +LIC_FILES_CHKSUM = "file://LICENSE;md5=92d1b128950b11ba8495b64938fc164d" + +SRCREV = "a53934a3ae1244679f812d998a4f16f2c7f309a6" +PV = "1.20+git${SRCPV}" + +SRC_URI = "git://github.com/google/${BPN}.git \ + file://0001-build_detect_platform-Check-for-__SSE4_2__.patch \ + file://0002-makefile-build-SHARED_MEMENVLIB.patch \ + file://0001-Makefile-Fix-parallel-build.patch \ + " + +S = "${WORKDIR}/git" + +inherit utils + +do_compile() { + # do not use oe_runmake. oe_runmake pass to make compilation arguments and override + # leveldb makefile variable CFLAGS and broke leveldb build. + CFLAGS="${CFLAGS}" make ${PARALLEL_MAKE}|| die +} + +do_install() { + install -d ${D}${libdir} ${D}${bindir} ${D}${includedir}/leveldb + oe_libinstall -C ${B}/out-shared libleveldb ${D}${libdir} + oe_libinstall -C ${S}/out-static libleveldb ${D}${libdir} + oe_libinstall -C ${S}/out-static libmemenv ${D}${libdir} + install -m 0755 ${B}/out-shared/db_bench ${D}${bindir} + install -m 0755 ${B}/out-static/*_test ${D}${bindir} + install -m 644 ${S}/include/leveldb/*.h ${D}${includedir}/leveldb/ +} + +PACKAGES =+ "${PN}-ptest" +FILES_${PN}-ptest = "${bindir}" diff --git a/meta-openembedded/meta-oe/recipes-dbs/libdbi/libdbi.inc b/meta-openembedded/meta-oe/recipes-dbs/libdbi/libdbi.inc new file mode 100644 index 0000000000..cea2838e36 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/libdbi/libdbi.inc @@ -0,0 +1,17 @@ +# libdbi OE build file +# Copyright (C) 2005, Koninklijke Philips Electronics NV. All Rights Reserved +# Released under the MIT license (see packages/COPYING) + +DESCRIPTION = "Database Independent Abstraction Layer for C" +HOMEPAGE = "http://libdbi.sourceforge.net/" +LICENSE = "LGPLv2.1" +LIC_FILES_CHKSUM = "file://COPYING;md5=d8045f3b8f929c1cb29a1e3fd737b499" +SECTION = "libs" + +INC_PR = "r0" + +SRC_URI = "${SOURCEFORGE_MIRROR}/libdbi/libdbi-${PV}.tar.gz" + +inherit autotools + +EXTRA_OECONF = "--disable-docs" diff --git a/meta-openembedded/meta-oe/recipes-dbs/libdbi/libdbi_0.9.0.bb b/meta-openembedded/meta-oe/recipes-dbs/libdbi/libdbi_0.9.0.bb new file mode 100644 index 0000000000..24eae28501 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/libdbi/libdbi_0.9.0.bb @@ -0,0 +1,6 @@ +require ${PN}.inc + +PR = "${INC_PR}.0" + +SRC_URI[md5sum] = "05e2ceeac4bc85fbe40de8b4b22d9ab3" +SRC_URI[sha256sum] = "dafb6cdca524c628df832b6dd0bf8fabceb103248edb21762c02d3068fca4503" diff --git a/meta-openembedded/meta-oe/recipes-dbs/mongodb/mongodb/0001-IntelRDFPMathLib20U1-Check-for-__DEFINED_wchar_t.patch b/meta-openembedded/meta-oe/recipes-dbs/mongodb/mongodb/0001-IntelRDFPMathLib20U1-Check-for-__DEFINED_wchar_t.patch new file mode 100644 index 0000000000..5da34480e7 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/mongodb/mongodb/0001-IntelRDFPMathLib20U1-Check-for-__DEFINED_wchar_t.patch @@ -0,0 +1,36 @@ +From fbfceebce2121831904f2f7115252dd03b413a6d Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Tue, 19 Sep 2017 18:52:53 -0700 +Subject: [PATCH] IntelRDFPMathLib20U1: Check for __DEFINED_wchar_t + +This is defined by musl if wchar_t is already defined + +avoids errors like + +src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid_functions.h:46:15: error: typedef redefinition with different types + ('int' vs 'unsigned int') +typedef int wchar_t; + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Pending + + src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid_functions.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid_functions.h b/src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid_functions.h +index 2b3f76db86..cc80305775 100755 +--- a/src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid_functions.h ++++ b/src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid_functions.h +@@ -42,7 +42,7 @@ + #include <ctype.h> + + // Fix system header issue on Sun solaris and define required type by ourselves +-#if !defined(_WCHAR_T) && !defined(_WCHAR_T_DEFINED) && !defined(__QNX__) ++#if !defined(_WCHAR_T) && !defined(_WCHAR_T_DEFINED) && !defined(__QNX__) && !defined(__DEFINED_wchar_t) + typedef int wchar_t; + #endif + +-- +2.14.1 + diff --git a/meta-openembedded/meta-oe/recipes-dbs/mongodb/mongodb/0001-Tell-scons-to-use-build-settings-from-environment-va.patch b/meta-openembedded/meta-oe/recipes-dbs/mongodb/mongodb/0001-Tell-scons-to-use-build-settings-from-environment-va.patch new file mode 100644 index 0000000000..aa01e954f7 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/mongodb/mongodb/0001-Tell-scons-to-use-build-settings-from-environment-va.patch @@ -0,0 +1,64 @@ +From 53368d3f4adc09dd84234a9af31771bcd8ca2757 Mon Sep 17 00:00:00 2001 +From: Sven Ebenfeld <sven.ebenfeld@gmail.com> +Date: Fri, 15 Jan 2016 22:41:28 +0100 +Subject: [PATCH] Tell scons to use build settings from environment variables + +Signed-off-by: Sven Ebenfeld <sven.ebenfeld@gmail.com> +--- + SConstruct | 8 ++++++-- + src/mongo/util/SConscript | 2 ++ + 2 files changed, 8 insertions(+), 2 deletions(-) + +Index: git/SConstruct +=================================================================== +--- git.orig/SConstruct ++++ git/SConstruct +@@ -548,6 +548,7 @@ def variable_arch_converter(val): + 'amd64': 'x86_64', + 'emt64': 'x86_64', + 'x86': 'i386', ++ 'aarch64': 'arm64', + } + val = val.lower() + +@@ -627,7 +628,8 @@ env_vars.Add( + ) + + env_vars.Add('CC', +- help='Select the C compiler to use') ++ help='Select the C compiler to use', ++ default=os.getenv('CC')) + + env_vars.Add('CCFLAGS', + help='Sets flags for the C and C++ compiler', +@@ -647,7 +649,8 @@ env_vars.Add('CPPPATH', + converter=variable_shlex_converter) + + env_vars.Add('CXX', +- help='Select the C++ compiler to use') ++ help='Select the C++ compiler to use', ++ default=os.getenv('CXX')) + + env_vars.Add('CXXFLAGS', + help='Sets flags for the C++ compiler', +@@ -895,6 +898,7 @@ envDict = dict(BUILD_ROOT=buildDir, + ) + + env = Environment(variables=env_vars, **envDict) ++env.PrependENVPath('PATH', os.getenv('PATH')) + del envDict + + env.AddMethod(env_os_is_wrapper, 'TargetOSIs') +Index: git/src/mongo/util/SConscript +=================================================================== +--- git.orig/src/mongo/util/SConscript ++++ git/src/mongo/util/SConscript +@@ -274,6 +274,8 @@ if env['MONGO_ALLOCATOR'] == 'tcmalloc': + 'MONGO_HAVE_GPERFTOOLS_SIZE_CLASS_STATS' + ] + ) ++ if not use_system_version_of_library('valgrind'): ++ tcmspEnv.InjectThirdPartyIncludePaths('valgrind') + + if not use_system_version_of_library('valgrind'): + # Include valgrind since tcmalloc disables itself while running under valgrind diff --git a/meta-openembedded/meta-oe/recipes-dbs/mongodb/mongodb/0001-Use-__GLIBC__-to-control-use-of-gnu_get_libc_version.patch b/meta-openembedded/meta-oe/recipes-dbs/mongodb/mongodb/0001-Use-__GLIBC__-to-control-use-of-gnu_get_libc_version.patch new file mode 100644 index 0000000000..f8c419d8a3 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/mongodb/mongodb/0001-Use-__GLIBC__-to-control-use-of-gnu_get_libc_version.patch @@ -0,0 +1,50 @@ +From 3eed8388b49d5d3cbc2db74fee1b017eb4b40d0a Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sat, 2 Sep 2017 10:06:24 -0700 +Subject: [PATCH] Use __GLIBC__ to control use of gnu_get_libc_version + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Pending + src/mongo/util/processinfo_linux.cpp | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/src/mongo/util/processinfo_linux.cpp b/src/mongo/util/processinfo_linux.cpp +index 910015215e..bf8c1ffd15 100644 +--- a/src/mongo/util/processinfo_linux.cpp ++++ b/src/mongo/util/processinfo_linux.cpp +@@ -40,7 +40,7 @@ + #include <sys/mman.h> + #include <sys/utsname.h> + #include <unistd.h> +-#ifdef __UCLIBC__ ++#ifndef __GLIBC__ + #include <features.h> + #else + #include <gnu/libc-version.h> +@@ -451,11 +451,13 @@ double ProcessInfo::getSystemMemoryPressurePercentage() { + } + + void ProcessInfo::getExtraInfo(BSONObjBuilder& info) { ++#if defined(__GLIBC__) + LinuxProc p(_pid); + if (p._maj_flt <= std::numeric_limits<long long>::max()) + info.appendNumber("page_faults", static_cast<long long>(p._maj_flt)); + else + info.appendNumber("page_faults", static_cast<double>(p._maj_flt)); ++#endif + } + + /** +@@ -491,7 +493,7 @@ void ProcessInfo::SystemInfo::collectSystemInfo() { + stringstream ss; + ss << "uClibc-" << __UCLIBC_MAJOR__ << "." << __UCLIBC_MINOR__ << "." << __UCLIBC_SUBLEVEL__; + bExtra.append("libcVersion", ss.str()); +-#else ++#elif defined(__GLIBC__) + bExtra.append("libcVersion", gnu_get_libc_version()); + #endif + if (!verSig.empty()) +-- +2.14.1 + diff --git a/meta-openembedded/meta-oe/recipes-dbs/mongodb/mongodb/0001-Use-long-long-instead-of-int64_t.patch b/meta-openembedded/meta-oe/recipes-dbs/mongodb/mongodb/0001-Use-long-long-instead-of-int64_t.patch new file mode 100644 index 0000000000..389b302c3c --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/mongodb/mongodb/0001-Use-long-long-instead-of-int64_t.patch @@ -0,0 +1,64 @@ +From a4951489d649c2b609cbb80f6cfb49fdcad8bd43 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sat, 2 Sep 2017 10:03:37 -0700 +Subject: [PATCH] Use long long instead of int64_t + +Fixes +error: call to member function 'appendNumber' is ambiguous +since this function expects long long as parameter and not int64_t + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Pending + src/mongo/util/procparser.cpp | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +Index: git/src/mongo/util/procparser.cpp +=================================================================== +--- git.orig/src/mongo/util/procparser.cpp ++++ git/src/mongo/util/procparser.cpp +@@ -260,7 +260,7 @@ Status parseProcStat(const std::vector<S + + StringData stringValue((*partIt).begin(), (*partIt).end() - (*partIt).begin()); + +- uint64_t value; ++ long long value; + + if (!parseNumberFromString(stringValue, &value).isOK()) { + value = 0; +@@ -272,7 +272,7 @@ Status parseProcStat(const std::vector<S + } else { + StringData stringValue((*partIt).begin(), (*partIt).end() - (*partIt).begin()); + +- uint64_t value; ++ long long value; + + if (!parseNumberFromString(stringValue, &value).isOK()) { + value = 0; +@@ -365,7 +365,7 @@ Status parseProcMemInfo(const std::vecto + + StringData stringValue((*partIt).begin(), (*partIt).end()); + +- uint64_t value; ++ long long value; + + if (!parseNumberFromString(stringValue, &value).isOK()) { + value = 0; +@@ -426,7 +426,7 @@ Status parseProcDiskStats(const std::vec + StringData data, + BSONObjBuilder* builder) { + bool foundKeys = false; +- std::vector<uint64_t> stats; ++ std::vector<long long> stats; + stats.reserve(kDiskFieldCount); + + using string_split_iterator = boost::split_iterator<StringData::const_iterator>; +@@ -501,7 +501,7 @@ Status parseProcDiskStats(const std::vec + + StringData stringValue((*partIt).begin(), (*partIt).end()); + +- uint64_t value; ++ long long value; + + if (!parseNumberFromString(stringValue, &value).isOK()) { + value = 0; diff --git a/meta-openembedded/meta-oe/recipes-dbs/mongodb/mongodb/0001-Use-strerror_r-only-on-glibc-systems.patch b/meta-openembedded/meta-oe/recipes-dbs/mongodb/mongodb/0001-Use-strerror_r-only-on-glibc-systems.patch new file mode 100644 index 0000000000..0334d994e4 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/mongodb/mongodb/0001-Use-strerror_r-only-on-glibc-systems.patch @@ -0,0 +1,26 @@ +From a4dfc92ff342e59596ab64267a8d4f22f173c23b Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sat, 2 Sep 2017 12:40:41 -0700 +Subject: [PATCH 1/4] Use strerror_r only on glibc systems + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + src/mongo/util/log.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/mongo/util/log.cpp b/src/mongo/util/log.cpp +index 1957eb4791..ddf3908818 100644 +--- a/src/mongo/util/log.cpp ++++ b/src/mongo/util/log.cpp +@@ -101,7 +101,7 @@ string errnoWithDescription(int errNumber) { + char buf[kBuflen]; + char* msg{nullptr}; + +-#if defined(__GNUC__) && defined(_GNU_SOURCE) ++#if defined(__GNUC__) && defined(_GNU_SOURCE) && defined(__GLIBC__) + msg = strerror_r(errNumber, buf, kBuflen); + #elif defined(_WIN32) + +-- +2.14.1 + diff --git a/meta-openembedded/meta-oe/recipes-dbs/mongodb/mongodb/0002-Add-a-definition-for-the-macro-__ELF_NATIVE_CLASS.patch b/meta-openembedded/meta-oe/recipes-dbs/mongodb/mongodb/0002-Add-a-definition-for-the-macro-__ELF_NATIVE_CLASS.patch new file mode 100644 index 0000000000..098306f500 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/mongodb/mongodb/0002-Add-a-definition-for-the-macro-__ELF_NATIVE_CLASS.patch @@ -0,0 +1,35 @@ +From df7ef16afcc6ab55daa686e4f15c16e3d1280337 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sat, 2 Sep 2017 12:42:30 -0700 +Subject: [PATCH 2/4] Add a definition for the macro __ELF_NATIVE_CLASS + +It depends on the native arch's word size. + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + src/mongo/util/stacktrace_posix.cpp | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/src/mongo/util/stacktrace_posix.cpp b/src/mongo/util/stacktrace_posix.cpp +index 53ab85f56f..7c458e7ef2 100644 +--- a/src/mongo/util/stacktrace_posix.cpp ++++ b/src/mongo/util/stacktrace_posix.cpp +@@ -37,6 +37,15 @@ + #include <string> + #include <sys/utsname.h> + ++#if !defined(__GLIBC__) ++#if defined __x86_64__ && !defined __ILP32__ ++# define __WORDSIZE 64 ++#else ++# define __WORDSIZE 32 ++#endif ++#define __ELF_NATIVE_CLASS __WORDSIZE ++#endif ++ + #include "mongo/base/init.h" + #include "mongo/config.h" + #include "mongo/db/jsobj.h" +-- +2.14.1 + diff --git a/meta-openembedded/meta-oe/recipes-dbs/mongodb/mongodb/0002-d_state.cpp-Add-missing-dependenncy-on-local_shardin.patch b/meta-openembedded/meta-oe/recipes-dbs/mongodb/mongodb/0002-d_state.cpp-Add-missing-dependenncy-on-local_shardin.patch new file mode 100644 index 0000000000..dc488ad7ea --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/mongodb/mongodb/0002-d_state.cpp-Add-missing-dependenncy-on-local_shardin.patch @@ -0,0 +1,25 @@ +From 5759878e5d278f11a1063e8fccd1e6b7b54caadf Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Wed, 2 Aug 2017 16:25:37 -0700 +Subject: [PATCH 2/2] d_state.cpp: Add missing dependenncy on + local_sharding_info + +Fixes +| src/mongo/s/d_state.cpp:81: error: undefined reference to 'mongo::enableLocalShardingInfo(mongo::ServiceContext*, std::function<bool (mongo::OperationContext*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)>)' + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + src/mongo/s/SConscript | 1 + + 1 file changed, 1 insertion(+) + +Index: git/src/mongo/s/SConscript +=================================================================== +--- git.orig/src/mongo/s/SConscript ++++ git/src/mongo/s/SConscript +@@ -317,5 +317,6 @@ env.Library( + "$BUILD_DIR/mongo/db/s/sharding", + "$BUILD_DIR/mongo/executor/network_interface_factory", + "$BUILD_DIR/mongo/s/client/shard_local", ++ "$BUILD_DIR/mongo/s/local_sharding_info", + ], + ) diff --git a/meta-openembedded/meta-oe/recipes-dbs/mongodb/mongodb/0003-Conditionalize-glibc-specific-strerror_r.patch b/meta-openembedded/meta-oe/recipes-dbs/mongodb/mongodb/0003-Conditionalize-glibc-specific-strerror_r.patch new file mode 100644 index 0000000000..1591f94c96 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/mongodb/mongodb/0003-Conditionalize-glibc-specific-strerror_r.patch @@ -0,0 +1,39 @@ +From 458f80f482a201b427a1c92235804d0c3f98fd51 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sat, 2 Sep 2017 13:01:11 -0700 +Subject: [PATCH 3/4] Conditionalize glibc specific strerror_r + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + .../asio-asio-1-11-0/asio/include/asio/impl/error_code.ipp | 11 ++++------- + 1 file changed, 4 insertions(+), 7 deletions(-) + +diff --git a/src/third_party/asio-asio-1-11-0/asio/include/asio/impl/error_code.ipp b/src/third_party/asio-asio-1-11-0/asio/include/asio/impl/error_code.ipp +index 4e7badb14a..0eeae884e2 100644 +--- a/src/third_party/asio-asio-1-11-0/asio/include/asio/impl/error_code.ipp ++++ b/src/third_party/asio-asio-1-11-0/asio/include/asio/impl/error_code.ipp +@@ -97,17 +97,14 @@ public: + #if defined(__sun) || defined(__QNX__) || defined(__SYMBIAN32__) + using namespace std; + return strerror(value); +-#elif defined(__MACH__) && defined(__APPLE__) \ +- || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) \ +- || defined(_AIX) || defined(__hpux) || defined(__osf__) \ +- || defined(__ANDROID__) ++#elif defined(__GLIBC__) && defined(_GNU_SOURCE) ++ char buf[256] = ""; ++ return strerror_r(value, buf, sizeof(buf)); ++#else + char buf[256] = ""; + using namespace std; + strerror_r(value, buf, sizeof(buf)); + return buf; +-#else +- char buf[256] = ""; +- return strerror_r(value, buf, sizeof(buf)); + #endif + #endif // defined(ASIO_WINDOWS) + } +-- +2.14.1 + diff --git a/meta-openembedded/meta-oe/recipes-dbs/mongodb/mongodb/0004-wiredtiger-Disable-strtouq-on-musl.patch b/meta-openembedded/meta-oe/recipes-dbs/mongodb/mongodb/0004-wiredtiger-Disable-strtouq-on-musl.patch new file mode 100644 index 0000000000..e871f2ba90 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/mongodb/mongodb/0004-wiredtiger-Disable-strtouq-on-musl.patch @@ -0,0 +1,26 @@ +From a1c77702926eb8546ff96b00b5b994f7478dabae Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sat, 2 Sep 2017 13:13:15 -0700 +Subject: [PATCH 4/4] wiredtiger: Disable strtouq on musl + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + src/third_party/wiredtiger/build_linux/wiredtiger_config.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/third_party/wiredtiger/build_linux/wiredtiger_config.h b/src/third_party/wiredtiger/build_linux/wiredtiger_config.h +index 1122e1e319..fdfd48687b 100644 +--- a/src/third_party/wiredtiger/build_linux/wiredtiger_config.h ++++ b/src/third_party/wiredtiger/build_linux/wiredtiger_config.h +@@ -101,7 +101,7 @@ + #define HAVE_STRING_H 1 + + /* Define to 1 if you have the `strtouq' function. */ +-#define HAVE_STRTOUQ 1 ++/* #undef HAVE_STRTOUQ 1 */ + + /* Define to 1 if you have the `sync_file_range' function. */ + /* #undef HAVE_SYNC_FILE_RANGE */ +-- +2.14.1 + diff --git a/meta-openembedded/meta-oe/recipes-dbs/mongodb/mongodb/arm64-support.patch b/meta-openembedded/meta-oe/recipes-dbs/mongodb/mongodb/arm64-support.patch new file mode 100644 index 0000000000..9046bb2f45 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/mongodb/mongodb/arm64-support.patch @@ -0,0 +1,43 @@ +Add alises for arm64 which is same as aarch64 + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +Upstream-Status: Pending + +Index: git/SConstruct +=================================================================== +--- git.orig/SConstruct ++++ git/SConstruct +@@ -990,6 +990,7 @@ elif endian == "big": + processor_macros = { + 'arm' : { 'endian': 'little', 'defines': ('__arm__',) }, + 'aarch64' : { 'endian': 'little', 'defines': ('__arm64__', '__aarch64__')}, ++ 'arm64' : { 'endian': 'little', 'defines': ('__arm64__', '__aarch64__')}, + 'i386' : { 'endian': 'little', 'defines': ('__i386', '_M_IX86')}, + 'ppc64le' : { 'endian': 'little', 'defines': ('__powerpc64__',)}, + 's390x' : { 'endian': 'big', 'defines': ('__s390x__',)}, +Index: git/src/third_party/IntelRDFPMathLib20U1/SConscript +=================================================================== +--- git.orig/src/third_party/IntelRDFPMathLib20U1/SConscript ++++ git/src/third_party/IntelRDFPMathLib20U1/SConscript +@@ -301,7 +301,7 @@ if processor == 'i386': + elif processor == 'arm': + cpp_defines['IA32'] = '1' + cpp_defines['ia32'] = '1' +-elif processor == "aarch64": ++elif processor == "aarch64" or processor == 'arm64': + cpp_defines['efi2'] = '1' + cpp_defines['EFI2'] = '1' + # Using 64 bit little endian +Index: git/src/third_party/wiredtiger/SConscript +=================================================================== +--- git.orig/src/third_party/wiredtiger/SConscript ++++ git/src/third_party/wiredtiger/SConscript +@@ -139,7 +139,7 @@ condition_map = { + 'POSIX_HOST' : not env.TargetOSIs('windows'), + 'WINDOWS_HOST' : env.TargetOSIs('windows'), + +- 'ARM64_HOST' : env['TARGET_ARCH'] == 'aarch64', ++ 'ARM64_HOST' : env['TARGET_ARCH'] in ('aarch64', 'arm64'), + 'POWERPC_HOST' : env['TARGET_ARCH'] == 'ppc64le', + 'X86_HOST' : env['TARGET_ARCH'] == 'x86_64', + 'ZSERIES_HOST' : env['TARGET_ARCH'] == 's390x', diff --git a/meta-openembedded/meta-oe/recipes-dbs/mongodb/mongodb/disable-hw-crc32-on-arm64-s390x.patch b/meta-openembedded/meta-oe/recipes-dbs/mongodb/mongodb/disable-hw-crc32-on-arm64-s390x.patch new file mode 100644 index 0000000000..5c5c20ce34 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/mongodb/mongodb/disable-hw-crc32-on-arm64-s390x.patch @@ -0,0 +1,50 @@ +imported from debian + +Upstream-Status: Pending +Index: git/src/third_party/wiredtiger/SConscript +=================================================================== +--- git.orig/src/third_party/wiredtiger/SConscript ++++ git/src/third_party/wiredtiger/SConscript +@@ -169,7 +169,9 @@ if useSnappy: + # If not available at runtime, we fall back to software in some cases. + # + # On zSeries we may disable because SLES 11 kernel doe not support the instructions. +-if not (env['TARGET_ARCH'] == 's390x' and get_option("use-s390x-crc32") == "off"): ++# Debian: disable hardware-assisted crc32 on s390x and arm64, as at least the ++# buildd's do not support the instructions. ++if env['TARGET_ARCH'] not in ('s390x', 'arm64', 'aarch64'): + env.Append(CPPDEFINES=["HAVE_CRC32_HARDWARE"]) + + wtlib = env.Library( +Index: git/src/third_party/wiredtiger/dist/filelist +=================================================================== +--- git.orig/src/third_party/wiredtiger/dist/filelist ++++ git/src/third_party/wiredtiger/dist/filelist +@@ -54,7 +54,6 @@ src/checksum/power8/crc32_wrapper.c POWE + src/checksum/software/checksum.c + src/checksum/x86/crc32-x86.c X86_HOST + src/checksum/zseries/crc32-s390x.c ZSERIES_HOST +-src/checksum/zseries/crc32le-vx.sx ZSERIES_HOST + src/config/config.c + src/config/config_api.c + src/config/config_check.c +Index: git/src/third_party/wiredtiger/src/checksum/zseries/crc32-s390x.c +=================================================================== +--- git.orig/src/third_party/wiredtiger/src/checksum/zseries/crc32-s390x.c ++++ git/src/third_party/wiredtiger/src/checksum/zseries/crc32-s390x.c +@@ -78,6 +78,7 @@ unsigned int __wt_crc32c_le(unsigned int + return crc; \ + } + ++#if defined(HAVE_CRC32_HARDWARE) + /* Main CRC-32 functions */ + DEFINE_CRC32_VX(__wt_crc32c_le_vx, __wt_crc32c_le_vgfm_16, __wt_crc32c_le) + +@@ -90,6 +91,7 @@ __wt_checksum_hw(const void *chunk, size + { + return (~__wt_crc32c_le_vx(0xffffffff, chunk, len)); + } ++#endif + + #endif + diff --git a/meta-openembedded/meta-oe/recipes-dbs/mongodb/mongodb_git.bb b/meta-openembedded/meta-oe/recipes-dbs/mongodb/mongodb_git.bb new file mode 100644 index 0000000000..bb3ff3b403 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/mongodb/mongodb_git.bb @@ -0,0 +1,76 @@ +SUMMARY = "mongodb" +LICENSE = "AGPL-3.0 & Apache-2.0 & Zlib" +LIC_FILES_CHKSUM = "file://GNU-AGPL-3.0.txt;md5=73f1eb20517c55bf9493b7dd6e480788 \ + file://APACHE-2.0.txt;md5=3b83ef96387f14655fc854ddc3c6bd57" + +DEPENDS = "openssl libpcre libpcap zlib python boost" + +inherit scons dos2unix siteinfo + +PV = "3.4.13+git${SRCPV}" +SRCREV = "fbdef2ccc53e0fcc9afb570063633d992b2aae42" +SRC_URI = "git://github.com/mongodb/mongo.git;branch=v3.4 \ + file://0001-Tell-scons-to-use-build-settings-from-environment-va.patch \ + file://0002-d_state.cpp-Add-missing-dependenncy-on-local_shardin.patch \ + file://0001-Use-long-long-instead-of-int64_t.patch \ + file://0001-Use-__GLIBC__-to-control-use-of-gnu_get_libc_version.patch \ + file://0001-Use-strerror_r-only-on-glibc-systems.patch \ + file://0002-Add-a-definition-for-the-macro-__ELF_NATIVE_CLASS.patch \ + file://0003-Conditionalize-glibc-specific-strerror_r.patch \ + file://arm64-support.patch \ + file://0001-IntelRDFPMathLib20U1-Check-for-__DEFINED_wchar_t.patch \ + file://disable-hw-crc32-on-arm64-s390x.patch \ + " +SRC_URI_append_libc-musl ="\ + file://0004-wiredtiger-Disable-strtouq-on-musl.patch \ + " +S = "${WORKDIR}/git" + +# Wiredtiger supports only 64-bit platforms +PACKAGECONFIG_x86-64 ??= "tcmalloc wiredtiger" +PACKAGECONFIG_aarch64 ??= "tcmalloc wiredtiger" +PACKAGECONFIG ??= "tcmalloc" +# gperftools compilation fails for arm below v7 because of missing support of +# dmb operation. So we use system-allocator instead of tcmalloc +PACKAGECONFIG_remove_armv6 = "tcmalloc" +PACKAGECONFIG_remove_libc-musl = "tcmalloc" + +#std::current_exception is undefined for arm < v6 +COMPATIBLE_MACHINE_armv4 = "(!.*armv4).*" +COMPATIBLE_MACHINE_armv5 = "(!.*armv5).*" +COMPATIBLE_MACHINE_armv7a = "(!.*armv7a).*" +COMPATIBLE_MACHINE_armv7ve = "(!.*armv7ve).*" +COMPATIBLE_MACHINE_mips64 = "(!.*mips64).*" +COMPATIBLE_MACHINE_powerpc = "(!.*ppc).*" + +PACKAGECONFIG[tcmalloc] = "--use-system-tcmalloc,--allocator=system,gperftools," +PACKAGECONFIG[wiredtiger] = "--wiredtiger=on,--wiredtiger=off,," + +EXTRA_OESCONS = "--prefix=${D}${prefix} \ + LIBPATH=${STAGING_LIBDIR} \ + LINKFLAGS='${LDFLAGS}' \ + CXXFLAGS='${CXXFLAGS}' \ + TARGET_ARCH=${TARGET_ARCH} \ + --ssl \ + --disable-warnings-as-errors \ + --use-system-pcre \ + --use-system-zlib \ + --js-engine=none \ + --nostrip \ + --endian=${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', 'little', 'big', d)} \ + ${PACKAGECONFIG_CONFARGS} \ + mongod mongos" + +do_configure_prepend() { + # tests use hex floats, not supported in plain C++ + sed -e 's|-std=c++11|-std=gnu++11|g' -i ${S}/SConstruct +} +scons_do_compile() { + ${STAGING_BINDIR_NATIVE}/scons ${PARALLEL_MAKE} ${EXTRA_OESCONS} || \ + die "scons build execution failed." +} + +scons_do_install() { + ${STAGING_BINDIR_NATIVE}/scons install ${EXTRA_OESCONS}|| \ + die "scons install execution failed." +} diff --git a/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb-native_5.5.59.bb b/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb-native_5.5.59.bb new file mode 100644 index 0000000000..4ce960d7da --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb-native_5.5.59.bb @@ -0,0 +1,19 @@ +require mariadb.inc +inherit native + +PROVIDES += "mysql5-native" +DEPENDS = "ncurses-native zlib-native bison-native" + +RDEPENDS_${PN} = "" +PACKAGES = "" +EXTRA_OEMAKE = "" + +do_install() { + oe_runmake 'DESTDIR=${D}' install + + install -d ${D}${bindir} + install -m 0755 sql/gen_lex_hash ${D}${bindir}/ + install -m 0755 extra/comp_err ${D}${bindir}/ + install -m 0755 scripts/comp_sql ${D}${bindir}/ +} + diff --git a/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb.inc b/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb.inc new file mode 100644 index 0000000000..99e7050945 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb.inc @@ -0,0 +1,297 @@ +SUMMARY = "A robust, scalable, and reliable SQL server" +HOMEPAGE = "http://mariadb.org" +SECTION = "libs" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" + +SRC_URI = "https://downloads.mariadb.org/f/${BP}/source/${BP}.tar.gz \ + file://fix-cmake-module-path.patch \ + file://remove-bad-path.patch \ + file://fix-mysqlclient-r-version.patch \ + file://my.cnf \ + file://mysqld.service \ + file://install_db.service \ + file://install_db \ + file://mysql-systemd-start \ + file://configure.cmake-fix-valgrind.patch \ + file://fix-a-building-failure.patch \ + file://change-cc-to-cc-version.patch \ + file://0001-disable-ucontext-on-musl.patch \ + " + +SRC_URI[md5sum] = "3cec4afc06b468687ef576c90148d10d" +SRC_URI[sha256sum] = "c3269ce20b45b177239fd1e3d6d9428a94131711f12758ebf5f65222278bb110" + +S = "${WORKDIR}/mariadb-${PV}" + +BINCONFIG_GLOB = "mysql_config" + +inherit cmake gettext binconfig update-rc.d useradd systemd + +INITSCRIPT_PACKAGES = "${PN}-server ${PN}-setupdb" +INITSCRIPT_NAME_${PN}-server = "mysqld" +INITSCRIPT_PARAMS_${PN}-server ?= "start 45 5 . stop 45 0 6 1 ." + +USERADD_PACKAGES = "${PN}-server" +USERADD_PARAM_${PN}-server = "--system --home-dir /var/mysql -g mysql --shell /bin/false mysql" +GROUPADD_PARAM_${PN}-server = "--system mysql" + +INITSCRIPT_NAME_${PN}-setupdb = "install_db" +INITSCRIPT_PARAMS_${PN}-setupdb ?= "defaults 44 44" + +SYSTEMD_PACKAGES = "${PN}-server ${PN}-setupdb" +SYSTEMD_SERVICE_${PN}-server = "mysqld.service" +SYSTEMD_AUTO_ENABLE_${PN}-server ?= "disable" + +SYSTEMD_SERVICE_${PN}-setupdb = "install_db.service" +SYSTEMD_AUTO_ENABLE_${PN}-setupdb ?= "enable" +ALLOW_EMPTY_${PN}-setupdb ?= "1" +FILES_${PN}-setupdb = "${sysconfdir}/init.d/install_db" + +EXTRA_OEMAKE = "'GEN_LEX_HASH=${STAGING_BINDIR_NATIVE}/gen_lex_hash'" + +PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)} setupdb" +PACKAGECONFIG_class-native = "" +PACKAGECONFIG[pam] = ",-DWITHOUT_AUTH_PAM=TRUE,libpam" +PACKAGECONFIG[valgrind] = "-DWITH_VALGRIND=TRUE,-DWITH_VALGRIND=FALSE,valgrind" +PACKAGECONFIG[libedit] = "-DLIBEDIT_INTERFACE=TRUE,-DLIBEDIT_INTERFACE=FALSE,libedit" +PACKAGECONFIG[krb5] = ", ,krb5" +PACKAGECONFIG[setupdb] = ", ,,${PN}-setupdb" + +# MariaDB doesn't link properly with gold +# https://mariadb.atlassian.net/browse/MDEV-5982 +TARGET_CFLAGS += "-fuse-ld=bfd" + +BUILD_CFLAGS += "-fuse-ld=bfd" +BUILD_CXXFLAGS += "-fuse-ld=bfd" + +EXTRA_OECMAKE = "-DWITH_EMBEDDED_SERVER=ON \ + -DWITH_JEMALLOC=no \ + -DWITHOUT_TOKUDB=TRUE \ + -DCMAKE_DISABLE_FIND_PACKAGE_Boost=TRUE \ + -DGROFF=FALSE \ + -DNROFF=FALSE \ + -DENABLE_DTRACE=FALSE \ + -DWITH_PIC=ON \ + -DINSTALL_LAYOUT=RPM \ + -DINSTALL_DOCDIR:PATH=${datadir}/doc/${BPN} \ + -DINSTALL_LIBDIR:PATH=${baselib} \ + -DINSTALL_PLUGINDIR:PATH=${baselib}/plugin \ + -DINSTALL_SYSCONFDIR:PATH=${sysconfdir} \ + -DMYSQL_DATADIR:PATH=/var/mysql \ + -DCAT_EXECUTABLE=`which cat` \ + -DCMAKE_AR:FILEPATH=${AR}" + +# With Ninja it fails with: +# make: *** No rule to make target `install'. Stop. +OECMAKE_GENERATOR = "Unix Makefiles" + +ARM_INSTRUCTION_SET_armv4 = "arm" +ARM_INSTRUCTION_SET_armv5 = "arm" + +do_configure_append() { + # handle distros with different values of ${libexecdir} + libexecdir2=`echo ${libexecdir} | sed -e 's+/usr/++g'` + sed -i -e "s:/libexec:/$libexecdir2:g" ${S}/scripts/mysql_install_db.sh + sed -i -e "s:mysqld libexec:mysqld $libexecdir2:g" ${S}/scripts/mysql_install_db.sh + sed -i -e "s:/libexec:/$libexecdir2:g" ${S}/scripts/mysqld_safe.sh +} + +do_generate_toolchain_file_append_class-native () { + # If these are set cmake will assume we're cross-compiling, which will + # result in certain things we want being disabled + sed -i "/set( CMAKE_SYSTEM_NAME/d" ${WORKDIR}/toolchain.cmake + sed -i "/set( CMAKE_SYSTEM_PROCESSOR/d" ${WORKDIR}/toolchain.cmake +} + +do_compile_prepend_class-target () { + # These need to be in-tree or make will think they need to be built, + # and since we're cross-compiling that is disabled + cp ${STAGING_BINDIR_NATIVE}/comp_err ${S}/extra + cp ${STAGING_BINDIR_NATIVE}/comp_sql ${S}/scripts + + if [ "${@bb.utils.contains('PACKAGECONFIG', 'krb5', 'yes', 'no', d)}" = "no" ]; then + if ! [ -e ${B}/include/openssl/kssl.h ] ; then + mkdir -p ${B}/include/openssl + echo "#ifndef KSSL_H" >${B}/include/openssl/kssl.h + echo "#define KSSL_H" >>${B}/include/openssl/kssl.h + echo "#include <openssl/opensslconf.h>">>${B}/include/openssl/kssl.h + echo "#endif" >>${B}/include/openssl/kssl.h + fi + fi +} + +SYSROOT_PREPROCESS_FUNCS += "mariadb_sysroot_preprocess" + +# We need to append this so it runs *after* binconfig's preprocess function +# +# We really don't care exactly what the directories were set to originally. +# plugindir is not fixed, but we don't create any plugins. +# +mariadb_sysroot_preprocess () { + sed -i -es,^pkgincludedir=.*,pkgincludedir=\'${STAGING_INCDIR}/mysql\', ${SYSROOT_DESTDIR}${bindir_crossscripts}/mysql_config + sed -i -es,^pkglibdir=.*,pkglibdir=\'${STAGING_LIBDIR}\', ${SYSROOT_DESTDIR}${bindir_crossscripts}/mysql_config +} + +do_install() { + oe_runmake 'DESTDIR=${D}' install + + install -d ${D}/${sysconfdir}/init.d + install -m 0644 ${WORKDIR}/my.cnf ${D}/${sysconfdir}/ + install -m 0755 ${WORKDIR}/install_db ${D}/${sysconfdir}/init.d/ + mv ${D}/${sysconfdir}/init.d/mysql ${D}/${sysconfdir}/init.d/mysqld + + install -d ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/mysqld.service ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/install_db.service ${D}${systemd_unitdir}/system + sed -i -e 's,@BINDIR@,${bindir},g' -e 's,@PREFIX@,${prefix},g' ${D}${systemd_unitdir}/system/mysqld.service \ + ${D}${systemd_unitdir}/system/install_db.service + + if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then + install -d ${D}${sysconfdir}/tmpfiles.d + echo "f /var/log/mysqld.err 0640 mysql mysql -" \ + > ${D}${sysconfdir}/tmpfiles.d/99-mysqld.conf + fi + install -d ${D}${bindir} + install -m 755 ${WORKDIR}/mysql-systemd-start ${D}${bindir} + install -d ${D}${datadir}/doc/${PN} + if [ -f ${D}${datadir}/doc/README ]; then + mv ${D}${datadir}/doc/README ${D}${datadir}/doc/${PN}/ + fi +} + +PACKAGES = "${PN}-dbg ${PN} \ + libmysqlclient-r libmysqlclient-r-dev libmysqlclient-r-staticdev libmysqlclient-r-dbg \ + libmysqlclient libmysqlclient-dev libmysqlclient-staticdev libmysqlclient-dbg \ + libmysqld libmysqld-dev ${PN}-client ${PN}-server ${PN}-setupdb ${PN}-leftovers" +CONFFILES_${PN}-server += "${sysconfdir}/my.cnf ${sysconfdir}/my.cnf.d/server.cnf" +CONFFILES_${PN}-client += "${sysconfdir}/my.cnf.d/mysql-clients.cnf" +CONFFILES_libmysqlclient += "${sysconfdir}/my.cnf.d/client.cnf" + +FILES_${PN} = " " +RDEPENDS_${PN} = "${PN}-client ${PN}-server" +ALLOW_EMPTY_${PN} = "1" + +RDEPENDS_${PN}-client = "perl perl-module-getopt-long perl-module-file-temp \ + perl-module-fcntl perl-module-sys-hostname perl-module-ipc-open3 \ + perl-module-exporter" +RDEPENDS_${PN}-server = "perl perl-module-getopt-long perl-module-data-dumper \ + perl-module-file-basename perl-module-file-path perl-module-sys-hostname \ + perl-module-file-copy perl-module-file-temp perl-module-posix \ + ${PN}-client libdbi-perl libdbd-mysql-perl" +RDEPENDS_${PN}-leftovers = "perl perl-module-cwd perl-module-benchmark perl-module-getopt-long \ + perl-module-posix perl-module-data-dumper perl-module-sigtrap perl-module-threads \ + perl-module-threads-shared perl-module-io-socket perl-module-sys-hostname perl-module-file-copy \ + perl-module-file-spec perl-module-file-find perl-module-file-basename perl-module-file-path \ + perl-module-constant perl-module-lib perl-module-file-temp perl-module-file-spec-functions \ + perl-module-io-socket-inet perl-module-io-select" +RDEPENDS_${PN}-setupdb = "coreutils" + +# Allow old code to link to the backward compatible library +RDEPENDS_libmysqlclient-dev = "libmysqlclient-r-dev" + +FILES_libmysqlclient = "\ + ${libdir}/libmysqlclient.so.* \ + ${sysconfdir}/my.cnf.d/client.cnf" +FILES_libmysqlclient-dev = " \ + ${includedir}/mysql/ \ + ${libdir}/libmysqlclient.so \ + ${sysconfdir}/aclocal \ + ${bindir}/mysql_config" +FILES_libmysqlclient-staticdev = "\ + ${libdir}/*.a" +FILES_libmysqlclient-dbg = "${libdir}/plugin/.debug/ \ + ${datadir}/mysql-test/lib/My/SafeProcess/.debug/my_safe_process" + +# Avoid warnings about ha_xtradb.so.0.0.0 and ha_innodb_plugin.so.0.0.0 +# which are intentionally non-PIC on 32-bit x86 (see e.g. +# storage/xtradb/plug.in in the source) +INSANE_SKIP_libmysqlclient_append_x86 = " textrel" + +FILES_libmysqlclient-r = "${libdir}/libmysqlclient_r.so.*" +FILES_libmysqlclient-r-dev = "\ + ${libdir}/libmysqlclient_r.so" +FILES_libmysqlclient-r-staticdev = "${libdir}/libmysqlclient_r.a" +FILES_libmysqlclient-r-dbg = "${libdir}/plugin/.debuglibmysqlclient_r.so.*" + +FILES_libmysqld = "\ + ${libdir}/libmysqld.so.*" +FILES_libmysqld-dev = "\ + ${libdir}/libmysqld.so" + +FILES_${PN}-client = "\ + ${bindir}/myisam_ftdump \ + ${bindir}/mysql \ + ${bindir}/mysql_client_test \ + ${bindir}/mysql_client_test_embedded \ + ${bindir}/mysql_find_rows \ + ${bindir}/mysql_fix_extensions \ + ${bindir}/mysql_waitpid \ + ${bindir}/mysqlaccess \ + ${bindir}/mysqladmin \ + ${bindir}/mysqlbug \ + ${bindir}/mysqlcheck \ + ${bindir}/mysqldump \ + ${bindir}/mysqldumpslow \ + ${bindir}/mysqlimport \ + ${bindir}/mysqlshow \ + ${bindir}/mysqlslap \ + ${bindir}/mysqltest_embedded \ + ${libexecdir}/mysqlmanager \ + ${sysconfdir}/my.cnf.d/mysql-clients.cnf" + +FILES_${PN}-server = "\ + ${bindir}/comp_err \ + ${bindir}/isamchk \ + ${bindir}/isamlog \ + ${bindir}/msql2mysql \ + ${bindir}/my_print_defaults \ + ${bindir}/myisamchk \ + ${bindir}/myisamlog \ + ${bindir}/myisampack \ + ${bindir}/mysql_convert_table_format \ + ${bindir}/mysql_fix_privilege_tables \ + ${bindir}/mysql_install_db \ + ${bindir}/mysql_secure_installation \ + ${bindir}/mysql_setpermission \ + ${bindir}/mysql-systemd-start \ + ${bindir}/mysql_tzinfo_to_sql \ + ${bindir}/mysql_upgrade \ + ${bindir}/mysql_plugin \ + ${bindir}/mysql_zap \ + ${bindir}/mysqlbinlog \ + ${bindir}/mysqld_multi \ + ${bindir}/mysqld_safe \ + ${bindir}/mysqld_safe_helper \ + ${bindir}/mysqlhotcopy \ + ${bindir}/mysqltest \ + ${bindir}/ndb_delete_all \ + ${bindir}/ndb_desc \ + ${bindir}/ndb_drop_index \ + ${bindir}/ndb_drop_table \ + ${bindir}/ndb_mgm \ + ${bindir}/ndb_restore \ + ${bindir}/ndb_select_all \ + ${bindir}/ndb_select_count \ + ${bindir}/ndb_show_tables \ + ${bindir}/ndb_waiter \ + ${bindir}/pack_isam \ + ${bindir}/perror \ + ${bindir}/replace \ + ${bindir}/resolve_stack_dump \ + ${bindir}/resolveip \ + ${libexecdir}/mysqld \ + ${sbindir}/mysqld \ + ${sbindir}/ndb_cpcd \ + ${sbindir}/ndbd \ + ${sbindir}/ndb_mgmd \ + ${libdir}/plugin/*.so \ + ${datadir}/mysql/ \ + ${localstatedir}/mysql/ \ + ${sysconfdir}/init.d/mysqld \ + ${sysconfdir}/my.cnf \ + ${sysconfdir}/my.cnf.d/server.cnf \ + ${sysconfdir}/tmpfiles.d" + +DESCRIPTION_${PN}-leftovers = "unpackaged and probably unneeded files for ${PN}" +FILES_${PN}-leftovers = "/" diff --git a/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb/0001-disable-ucontext-on-musl.patch b/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb/0001-disable-ucontext-on-musl.patch new file mode 100644 index 0000000000..60e9199f95 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb/0001-disable-ucontext-on-musl.patch @@ -0,0 +1,28 @@ +From 5bc3e7ef9700d12054e0125a126f1bb093f01ef9 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sun, 26 Mar 2017 14:30:33 -0700 +Subject: [PATCH] disable ucontext on musl + +musl does not have *contex() APIs even though it has ucontext.h header + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + include/my_context.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/my_context.h b/include/my_context.h +index dd44103..9b28c17 100644 +--- a/include/my_context.h ++++ b/include/my_context.h +@@ -31,7 +31,7 @@ + #define MY_CONTEXT_USE_X86_64_GCC_ASM + #elif defined(__GNUC__) && __GNUC__ >= 3 && defined(__i386__) + #define MY_CONTEXT_USE_I386_GCC_ASM +-#elif defined(HAVE_UCONTEXT_H) ++#elif defined(__GLIBC__) && defined(HAVE_UCONTEXT_H) + #define MY_CONTEXT_USE_UCONTEXT + #else + #define MY_CONTEXT_DISABLE +-- +2.12.1 + diff --git a/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb/change-cc-to-cc-version.patch b/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb/change-cc-to-cc-version.patch new file mode 100644 index 0000000000..02bda24f7b --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb/change-cc-to-cc-version.patch @@ -0,0 +1,26 @@ +mariadb: replace the CC with CC_VERSION and CXX with CXX_VERSION + +mysqlbug.sh is a bug report script. It makes a report with the build information, +including gcc version. The CC is the local path of gcc, which is useless for bug +report, and the path may expose private information, so change it to CC_VERSION. + +Upstream-Status: Pending + +Signed-off-by: Yue Tao <Yue.Tao@windriver.com> +Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com> +================================ +diff --git a/scripts/mysqlbug.sh.old b/scripts/mysqlbug.sh +index e9df210..d4b8d53 100644 +--- a/scripts/mysqlbug.sh.old ++++ b/scripts/mysqlbug.sh +@@ -24,8 +24,8 @@ VERSION="@VERSION@@MYSQL_SERVER_SUFFIX@" + COMPILATION_COMMENT="@COMPILATION_COMMENT@" + BUGmysql="maria-developers@lists.launchpad.net" + # This is set by configure +-COMP_CALL_INFO="CC='@SAVE_CC@' CFLAGS='@SAVE_CFLAGS@' CXX='@SAVE_CXX@' CXXFLAGS='@SAVE_CXXFLAGS@' LDFLAGS='@SAVE_LDFLAGS@' ASFLAGS='@SAVE_ASFLAGS@'" +-COMP_RUN_INFO="CC='@CC@' CFLAGS='@CFLAGS@' CXX='@CXX@' CXXFLAGS='@CXXFLAGS@' LDFLAGS='@LDFLAGS@' ASFLAGS='@ASFLAGS@'" ++COMP_CALL_INFO="CC='@CC_VERSION@' CFLAGS='@SAVE_CFLAGS@' CXX='@CXX_VERSION@' CXXFLAGS='@SAVE_CXXFLAGS@' LDFLAGS='@SAVE_LDFLAGS@' ASFLAGS='@SAVE_ASFLAGS@'" ++COMP_RUN_INFO="CC='@CC_VERSION@' CFLAGS='@CFLAGS@' CXX='@CXX_VERSION@' CXXFLAGS='@CXXFLAGS@' LDFLAGS='@LDFLAGS@' ASFLAGS='@ASFLAGS@'" + CONFIGURE_LINE="@CONF_COMMAND@" + + LIBC_INFO="" diff --git a/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb/configure.cmake-fix-valgrind.patch b/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb/configure.cmake-fix-valgrind.patch new file mode 100644 index 0000000000..e97def6021 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb/configure.cmake-fix-valgrind.patch @@ -0,0 +1,41 @@ +From 5effba0d7d47071a3f1bca56823190d5a95bb1a6 Mon Sep 17 00:00:00 2001 +From: Jackie Huang <jackie.huang@windriver.com> +Date: Wed, 12 Nov 2014 03:09:10 -0500 +Subject: [PATCH] configure.cmake: fix valgrind + +Check valgrind headers only if WITH_VALGRIND is set. + +mariadb uses two macros for valgrind compilations: +HAVE_valgrind - valgrind is installed and can be set by configure option -DWITH_VALGRIND +HAVE_VALGRIND - valgrind debug libraries is installed, set by auto check + +We would like to set them both by the configure option so that we can use +PACKAGECONFIG to decide if valgrind is needed or not. + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Jackie Huang <jackie.huang@windriver.com> +--- + configure.cmake | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/configure.cmake b/configure.cmake +index 0bd7bbe..51a098f 100644 +--- a/configure.cmake ++++ b/configure.cmake +@@ -1047,10 +1047,10 @@ MARK_AS_ADVANCED(WITH_ATOMIC_LOCKS MY_ATOMIC_MODE_RWLOCK MY_ATOMIC_MODE_DUMMY) + + IF(WITH_VALGRIND) + SET(HAVE_valgrind 1) ++ CHECK_INCLUDE_FILES("valgrind/memcheck.h;valgrind/valgrind.h" ++ HAVE_VALGRIND) + ENDIF() + +-CHECK_INCLUDE_FILES("valgrind/memcheck.h;valgrind/valgrind.h" +- HAVE_VALGRIND) + + #-------------------------------------------------------------------- + # Check for IPv6 support +-- +2.0.0 + diff --git a/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb/fix-a-building-failure.patch b/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb/fix-a-building-failure.patch new file mode 100644 index 0000000000..0c4e10237c --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb/fix-a-building-failure.patch @@ -0,0 +1,31 @@ +[PATCH] fix a building failure + +Upstream-Status: Inappropriate [configuration] + +building failed since native does not generate import_executables.cmake +In fact, our building system will export the needed commands + +Signed-off-by: Roy Li <rongqing.li@windriver.com> +--- + CMakeLists.txt | 5 ----- + 1 file changed, 5 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c1ce1c5..83b3a7e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -350,11 +350,6 @@ MYSQL_CHECK_READLINE() + + CHECK_JEMALLOC() + +-IF(CMAKE_CROSSCOMPILING) +- SET(IMPORT_EXECUTABLES "IMPORTFILE-NOTFOUND" CACHE FILEPATH "Path to import_executables.cmake from a native build") +- INCLUDE(${IMPORT_EXECUTABLES}) +-ENDIF() +- + # + # Setup maintainer mode options by the end. Platform checks are + # not run with the warning options as to not perturb fragile checks +-- +1.9.1 + diff --git a/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb/fix-cmake-module-path.patch b/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb/fix-cmake-module-path.patch new file mode 100644 index 0000000000..8d9f558d05 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb/fix-cmake-module-path.patch @@ -0,0 +1,29 @@ +Avoid CMAKE_MODULE_PATH being overwritten + +OE-Core's setting of CMAKE_MODULE_PATH stomps on MariaDB's value unless +we set it after setting the project name. + +Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> + +Upstream-Status: Inappropriate [working around OE-Core bug] + +--- mariadb/CMakeLists.txt 2014-07-17 11:01:07.676353047 +0100 ++++ mariadb/CMakeLists.txt 2014-07-17 11:01:31.299353107 +0100 +@@ -28,8 +28,6 @@ + + MESSAGE(STATUS "Running cmake version ${CMAKE_VERSION}") + +-SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake) +- + # Distinguish between community and non-community builds, with the + # default being a community build. This does not impact the feature + # set that will be compiled in; it's merely provided as a hint to +@@ -77,6 +75,8 @@ + ENDIF() + PROJECT(${MYSQL_PROJECT_NAME}) + ++SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake) ++ + IF(BUILD_CONFIG) + INCLUDE( + ${CMAKE_SOURCE_DIR}/cmake/build_configurations/${BUILD_CONFIG}.cmake) diff --git a/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb/fix-mysqlclient-r-version.patch b/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb/fix-mysqlclient-r-version.patch new file mode 100644 index 0000000000..a519e42921 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb/fix-mysqlclient-r-version.patch @@ -0,0 +1,160 @@ +From 6db2a606196fb38a6d106dc409eee1cb9a40a440 Mon Sep 17 00:00:00 2001 +From: Tor Didriksen <tor.didriksen@oracle.com> +Date: Mon, 24 Jun 2013 17:15:35 +0200 +Subject: [PATCH] Bug#16809055 MYSQL 5.6 AND 5.7 STILL USE LIBMYSQLCLIENT.SO.18 + +With this patch, the libmysql/ directory contains: +libmysqlclient.a +libmysqlclient_r.a -> libmysqlclient.a +libmysqlclient_r.so -> libmysqlclient.so* +libmysqlclient_r.so.18 -> libmysqlclient.so.18* +libmysqlclient_r.so.18.1.0 -> libmysqlclient.so.18.1.0* +libmysqlclient.so -> libmysqlclient.so.18* +libmysqlclient.so.18 -> libmysqlclient.so.18.1.0* +libmysqlclient.so.18.1.0* + +This fixes libmysqlclient_r symlinks pointing to the unversioned +libmysqlclient.so symlink (leading to package QA errors since the +libmysqlclient-r package ends up depending on libmysqlclient-dev). + +Borrowed from MySQL 5.6 tree at https://github.com/percona/mysql/ + +Upstream-Status: Pending + +Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> + +--- + cmake/install_macros.cmake | 25 +++++++++++++++---------- + libmysql/CMakeLists.txt | 34 +++++++++++++++++++++++++++------- + 2 files changed, 42 insertions(+), 17 deletions(-) + +diff --git a/cmake/install_macros.cmake b/cmake/install_macros.cmake +index b8efdf8..a0d0e68 100644 +--- a/cmake/install_macros.cmake ++++ b/cmake/install_macros.cmake +@@ -1,4 +1,4 @@ +-# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved. ++# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. + # + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by +@@ -167,28 +167,33 @@ ENDFUNCTION() + + + # Install symbolic link to CMake target. +-# the link is created in the same directory as target +-# and extension will be the same as for target file. +-MACRO(INSTALL_SYMLINK linkname target destination component) ++# We do 'cd path; ln -s target_name link_name' ++# We also add an INSTALL target for "${path}/${link_name}" ++MACRO(INSTALL_SYMLINK target target_name link_name destination component) + IF(UNIX) + GET_TARGET_PROPERTY(location ${target} LOCATION) + GET_FILENAME_COMPONENT(path ${location} PATH) +- GET_FILENAME_COMPONENT(name ${location} NAME) +- SET(output ${path}/${linkname}) ++ MESSAGE(STATUS "target ${target}") ++ MESSAGE(STATUS "link_name ${link_name}") ++ MESSAGE(STATUS "target_name ${target_name}") ++ MESSAGE(STATUS "path ${path}") ++ MESSAGE(STATUS "") ++ ++ SET(output ${path}/${link_name}) + ADD_CUSTOM_COMMAND( + OUTPUT ${output} + COMMAND ${CMAKE_COMMAND} ARGS -E remove -f ${output} + COMMAND ${CMAKE_COMMAND} ARGS -E create_symlink +- ${name} +- ${linkname} ++ ${target_name} ++ ${link_name} + WORKING_DIRECTORY ${path} + DEPENDS ${target} + ) + +- ADD_CUSTOM_TARGET(symlink_${linkname} ++ ADD_CUSTOM_TARGET(symlink_${link_name} + ALL + DEPENDS ${output}) +- SET_TARGET_PROPERTIES(symlink_${linkname} PROPERTIES CLEAN_DIRECT_OUTPUT 1) ++ SET_TARGET_PROPERTIES(symlink_${link_name} PROPERTIES CLEAN_DIRECT_OUTPUT 1) + IF(CMAKE_GENERATOR MATCHES "Xcode") + # For Xcode, replace project config with install config + STRING(REPLACE "${CMAKE_CFG_INTDIR}" +diff --git a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt +index be5760f..96286ff 100644 +--- a/libmysql/CMakeLists.txt ++++ b/libmysql/CMakeLists.txt +@@ -433,6 +433,12 @@ IF(MSVC) + INSTALL_DEBUG_TARGET(clientlib DESTINATION ${INSTALL_LIBDIR}/debug) + ENDIF() + ++MACRO(GET_TARGET_NAME target out_name) ++ GET_TARGET_PROPERTY(location ${target} LOCATION) ++ GET_FILENAME_COMPONENT(name ${location} NAME) ++ SET(${out_name} ${name}) ++ENDMACRO() ++ + IF(UNIX) + MACRO(GET_VERSIONED_LIBNAME LIBNAME EXTENSION VERSION OUTNAME) + SET(DOT_VERSION ".${VERSION}") +@@ -445,7 +451,13 @@ IF(UNIX) + SET(${OUTNAME} ${LIBNAME}${EXTENSION}${DOT_VERSION}) + ENDIF() + ENDMACRO() +- INSTALL_SYMLINK(${CMAKE_STATIC_LIBRARY_PREFIX}mysqlclient_r.a mysqlclient ${INSTALL_LIBDIR} Development) ++ENDIF() ++ ++IF(UNIX) ++ GET_TARGET_NAME(mysqlclient lib_name) ++ INSTALL_SYMLINK(mysqlclient ++ ${lib_name} ${CMAKE_STATIC_LIBRARY_PREFIX}mysqlclient_r.a ++ ${INSTALL_LIBDIR} Development) + ENDIF() + + IF(NOT DISABLE_SHARED) +@@ -456,10 +468,9 @@ IF(NOT DISABLE_SHARED) + # libtool compatability + IF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR APPLE) + SET(OS_SHARED_LIB_VERSION "${SHARED_LIB_MAJOR_VERSION}") +- ELSEIF(CMAKE_SYSTEM_NAME MATCHES "HP-UX") +- SET(OS_SHARED_LIB_VERSION "${SHARED_LIB_MAJOR_VERSION}.0") + ELSE() +- SET(OS_SHARED_LIB_VERSION "${SHARED_LIB_MAJOR_VERSION}.0.0") ++ SET(OS_SHARED_LIB_VERSION ++ "${SHARED_LIB_MAJOR_VERSION}.${SHARED_LIB_MINOR_VERSION}.0") + ENDIF() + # Name of shared library is mysqlclient on Unix + SET_TARGET_PROPERTIES(libmysql PROPERTIES +@@ -482,8 +493,13 @@ IF(NOT DISABLE_SHARED) + "${CMAKE_SHARED_LIBRARY_SUFFIX}" + "" + linkname) +- INSTALL_SYMLINK(${linkname} libmysql ${INSTALL_LIBDIR} SharedLibraries) +- SET(OS_SHARED_LIB_SYMLINKS "${SHARED_LIB_MAJOR_VERSION}" "${OS_SHARED_LIB_VERSION}") ++ GET_TARGET_NAME(libmysql lib_name) ++ GET_FILENAME_COMPONENT(lib_name_we ${lib_name} NAME_WE) ++ INSTALL_SYMLINK(libmysql ++ ${lib_name} ${linkname} ++ ${INSTALL_LIBDIR} SharedLibraries) ++ SET(OS_SHARED_LIB_SYMLINKS ++ "${SHARED_LIB_MAJOR_VERSION}" "${OS_SHARED_LIB_VERSION}") + LIST(REMOVE_DUPLICATES OS_SHARED_LIB_SYMLINKS) + FOREACH(ver ${OS_SHARED_LIB_SYMLINKS}) + GET_VERSIONED_LIBNAME( +@@ -491,7 +507,11 @@ IF(NOT DISABLE_SHARED) + "${CMAKE_SHARED_LIBRARY_SUFFIX}" + "${ver}" + linkname) +- INSTALL_SYMLINK(${linkname} libmysql ${INSTALL_LIBDIR} SharedLibraries) ++ GET_VERSIONED_LIBNAME( ++ ${lib_name_we} "${CMAKE_SHARED_LIBRARY_SUFFIX}" "${ver}" lib_name_ver) ++ INSTALL_SYMLINK(libmysql ++ ${lib_name_ver} ${linkname} ++ ${INSTALL_LIBDIR} SharedLibraries) + ENDFOREACH() + ENDIF() + ENDIF() +-- +2.0.3 + diff --git a/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb/install_db b/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb/install_db new file mode 100755 index 0000000000..512a7da7ee --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb/install_db @@ -0,0 +1,13 @@ +#! /bin/sh +case "$1" in + start) + echo "Starting to install database for mariadb" + /usr/bin/mysql-systemd-start pre + echo "done." + ;; + *) + echo "Usage: /etc/init.d/install_db start" + exit 1 +esac + +exit 0 diff --git a/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb/install_db.service b/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb/install_db.service new file mode 100644 index 0000000000..c8369f569b --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb/install_db.service @@ -0,0 +1,17 @@ +# +# Simple install MySQL database service file +# It shoulb be done before mysqld.service + +[Unit] +Description=Install MySQL Community Server Database +After=network.target +After=syslog.target +Before=mysqld.service + +[Install] +WantedBy=multi-user.target + +[Service] +Type=oneshot +ExecStart=@BINDIR@/mysql-systemd-start pre + diff --git a/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb/my.cnf b/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb/my.cnf new file mode 100644 index 0000000000..dc4c172e54 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb/my.cnf @@ -0,0 +1,25 @@ +[client] +#password = password +port = 3306 +socket = /var/lib/mysql/mysql.sock + +[mysqld_safe] + +[mysqld] +user = mysql +port = 3306 +socket = /var/lib/mysql/mysql.sock +pid-file = /var/lib/mysql/mysqld.pid +log-error = /var/log/mysqld.err +basedir = /usr +datadir = /var/lib/mysql +skip-external-locking +skip-networking +ignore-builtin-innodb +default-storage-engine = myisam +bind-address = localhost + +# +# include all files from the config directory +# +!includedir /etc/my.cnf.d diff --git a/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb/mysql-systemd-start b/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb/mysql-systemd-start new file mode 100644 index 0000000000..189c02021d --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb/mysql-systemd-start @@ -0,0 +1,66 @@ +#! /bin/sh +# +# Needed argument: pre | post +# +# pre mode : try to run mysql_install_db and fix perms and SELinux contexts +# post mode : ping server until answer is received +# + +get_option () { + local section=$1 + local option=$2 + local default=$3 + ret=$(/usr/bin/my_print_defaults $section | grep '^--'${option}'=' | cut -d= -f2-) + [ -z $ret ] && ret=$default + echo $ret +} + +install_db () { + # Note: something different than datadir=/var/lib/mysql requires SELinux policy changes (in enforcing mode) + datadir=$(get_option mysqld datadir "/var/lib/mysql") + + # Restore log, dir, perms and SELinux contexts + [ -d "$datadir" ] || install -d -m 0755 -omysql -gmysql "$datadir" || exit 1 + log=/var/log/mysqld.log + [ -e $log ] || touch $log + chmod 0640 $log + chown mysql:mysql $log || exit 1 + if [ -x /usr/sbin/restorecon ]; then + /usr/sbin/restorecon "$datadir" + /usr/sbin/restorecon $log + fi + + # If special mysql dir is in place, skip db install + [ -d "$datadir/mysql" ] && exit 0 + + # Create initial db + /usr/bin/mysql_install_db --rpm --datadir="$datadir" --user=mysql + exit 0 +} + +pinger () { + # Wait for ping to answer to signal startup completed, + # might take a while in case of e.g. crash recovery + # MySQL systemd service will timeout script if no answer + datadir=$(get_option mysqld datadir "/var/lib/mysql") + socket=$(get_option mysqld socket "$datadir/mysql.sock") + case $socket in + /*) adminsocket="$socket" ;; + *) adminsocket="$datadir/$socket" ;; + esac + + while /bin/true ; do + sleep 1 + mysqladmin --no-defaults --socket="$adminsocket" --user=UNKNOWN_MYSQL_USER ping >/dev/null 2>&1 && break + done + exit 0 +} + +# main +case $1 in + "pre") install_db ;; + "post") pinger ;; +esac + +exit 0 + diff --git a/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb/mysqld.service b/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb/mysqld.service new file mode 100644 index 0000000000..d88361703d --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb/mysqld.service @@ -0,0 +1,25 @@ +[Unit] +Description=MariaDB database server +After=syslog.target +After=network.target + +[Service] +PIDFile=/var/lib/mysql/mysqld.pid +Type=simple +User=mysql +Group=mysql + +# Execute post scripts as root +PermissionsStartOnly=true + +# Start main service +ExecStart=@BINDIR@/mysqld_safe --basedir=@PREFIX@ + +# Don't signal startup success before a ping works +ExecStartPost=@BINDIR@/mysql-systemd-start post + +TimeoutSec=300 +PrivateTmp=true + +[Install] +WantedBy=multi-user.target diff --git a/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb/remove-bad-path.patch b/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb/remove-bad-path.patch new file mode 100644 index 0000000000..ff26b0b86c --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb/remove-bad-path.patch @@ -0,0 +1,18 @@ +Remove host path from include directories + +Naturally this breaks cross-compilation if present. + +Upstream-Status: Pending + +Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> + +--- mariadb-5.5.38/storage/tokudb/ft-index/CMakeLists.txt 2014-07-17 14:37:04.529327998 +0100 ++++ mariadb-5.5.38/storage/tokudb/ft-index/CMakeLists.txt 2014-07-17 14:43:56.991337895 +0100 +@@ -39,7 +39,6 @@ + + ## default includes and libraries + include_directories(SYSTEM +- /usr/local/include + ${ZLIB_INCLUDE_DIRS} + ) + diff --git a/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb_5.5.59.bb b/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb_5.5.59.bb new file mode 100644 index 0000000000..d7895732a6 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/mysql/mariadb_5.5.59.bb @@ -0,0 +1,27 @@ +require mariadb.inc + +EXTRA_OECMAKE += "-DSTACK_DIRECTION=-1" + +DEPENDS += "mariadb-native ncurses zlib readline libaio libevent" + +PROVIDES += "mysql5 libmysqlclient" + +RPROVIDES_${PN} += "mysql5" +RREPLACES_${PN} += "mysql5" +RCONFLICTS_${PN} += "mysql5" + +RPROVIDES_${PN}-dbg += "mysql5-dbg" +RREPLACES_${PN}-dbg += "mysql5-dbg" +RCONFLICTS_${PN}-dbg += "mysql5-dbg" + +RPROVIDES_${PN}-leftovers += "mysql5-leftovers" +RREPLACES_${PN}-leftovers += "mysql5-leftovers" +RCONFLICTS_${PN}-leftovers += "mysql5-leftovers" + +RPROVIDES_${PN}-client += "mysql5-client" +RREPLACES_${PN}-client += "mysql5-client" +RCONFLICTS_${PN}-client += "mysql5-client" + +RPROVIDES_${PN}-server += "mysql5-server" +RREPLACES_${PN}-server += "mysql5-server" +RCONFLICTS_${PN}-server += "mysql5-server" diff --git a/meta-openembedded/meta-oe/recipes-dbs/mysql/mysql-python_1.2.5.bb b/meta-openembedded/meta-oe/recipes-dbs/mysql/mysql-python_1.2.5.bb new file mode 100644 index 0000000000..ac0df4f066 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/mysql/mysql-python_1.2.5.bb @@ -0,0 +1,17 @@ +SUMMARY = "Python interface to MySQL" +HOMEPAGE = "https://github.com/farcepest/MySQLdb1" +SECTION = "devel/python" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://GPL-2.0;md5=b234ee4d69f5fce4486a80fdaf4a4263" + +DEPENDS = "mysql5" + +SRCNAME = "MySQL-python" + +SRC_URI = "https://pypi.python.org/packages/source/M/${SRCNAME}/${SRCNAME}-${PV}.zip" +SRC_URI[md5sum] = "654f75b302db6ed8dc5a898c625e030c" +SRC_URI[sha256sum] = "811040b647e5d5686f84db415efd697e6250008b112b6909ba77ac059e140c74" + +S = "${WORKDIR}/${SRCNAME}-${PV}" + +inherit setuptools diff --git a/meta-openembedded/meta-oe/recipes-dbs/postgresql/files/0001-Use-pkg-config-for-libxml2-detection.patch b/meta-openembedded/meta-oe/recipes-dbs/postgresql/files/0001-Use-pkg-config-for-libxml2-detection.patch new file mode 100644 index 0000000000..ce2a60cabf --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/postgresql/files/0001-Use-pkg-config-for-libxml2-detection.patch @@ -0,0 +1,40 @@ +From d52e330be895bb8c5f0fb3e2884766acbd942a85 Mon Sep 17 00:00:00 2001 +From: Philip Balister <philip@balister.org> +Date: Tue, 1 Jul 2014 09:40:44 -0400 +Subject: [PATCH] Use pkg-config for libxml2 detection. + +Upstream-Status: Inappropriate [configuration] + +xml2-config does not work. Use pkgconfig to set CPPFLAGS and LIBS. + +Signed-off-by: Philip Balister <philip@balister.org> +--- + configure.in | 15 ++------------- + 1 file changed, 2 insertions(+), 13 deletions(-) + +Index: postgresql-9.4.15/configure.in +=================================================================== +--- postgresql-9.4.15.orig/configure.in ++++ postgresql-9.4.15/configure.in +@@ -759,19 +759,8 @@ PGAC_ARG_BOOL(with, libxml, no, [build w + [AC_DEFINE([USE_LIBXML], 1, [Define to 1 to build with XML support. (--with-libxml)])]) + + if test "$with_libxml" = yes ; then +- AC_CHECK_PROGS(XML2_CONFIG, xml2-config) +- if test -n "$XML2_CONFIG"; then +- for pgac_option in `$XML2_CONFIG --cflags`; do +- case $pgac_option in +- -I*|-D*) CPPFLAGS="$CPPFLAGS $pgac_option";; +- esac +- done +- for pgac_option in `$XML2_CONFIG --libs`; do +- case $pgac_option in +- -L*) LDFLAGS="$LDFLAGS $pgac_option";; +- esac +- done +- fi ++ CPPFLAGS="$CPPFLAGS `pkg-config --short-errors --print-errors --cflags "libxml-2.0" 2>&1`" ++ LIBS="`pkg-config --short-errors --print-errors --libs "libxml-2.0" 2>&1` $LIBS" + fi + + AC_SUBST(with_libxml) diff --git a/meta-openembedded/meta-oe/recipes-dbs/postgresql/files/not-check-libperl.patch b/meta-openembedded/meta-oe/recipes-dbs/postgresql/files/not-check-libperl.patch new file mode 100644 index 0000000000..971510943d --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/postgresql/files/not-check-libperl.patch @@ -0,0 +1,28 @@ +[PATCH] not check libperl under cross compiling + +Upstream-Status: Inappropriate [configuration] + +libperl ldflags returned by PGAC_CHECK_PERL_EMBED_LDFLAGS are native, +can not be used to check target library. + +postpresql has the dependency on perl, so not need to check libperl +again, like in postgresql-9.2.4 + +Signed-off-by: Roy Li <rongqing.li@windriver.com> +--- + configure.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: postgresql-9.4.15/configure.in +=================================================================== +--- postgresql-9.4.15.orig/configure.in ++++ postgresql-9.4.15/configure.in +@@ -1879,7 +1879,7 @@ if test "$with_tcl" = yes; then + fi + + # check for <perl.h> +-if test "$with_perl" = yes; then ++if test "$with_perl" = yes && test "$cross_compiling" = no; then + ac_save_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS -I$perl_archlibexp/CORE" + AC_CHECK_HEADER(perl.h, [], [AC_MSG_ERROR([header file <perl.h> is required for Perl])], diff --git a/meta-openembedded/meta-oe/recipes-dbs/postgresql/files/postgresql-bashprofile b/meta-openembedded/meta-oe/recipes-dbs/postgresql/files/postgresql-bashprofile new file mode 100644 index 0000000000..1c931f37fd --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/postgresql/files/postgresql-bashprofile @@ -0,0 +1,4 @@ +[ -f /etc/profile ] && source /etc/profile + +PGDATA=/var/lib/postgresql/data +export PGDATA diff --git a/meta-openembedded/meta-oe/recipes-dbs/postgresql/files/postgresql-setup b/meta-openembedded/meta-oe/recipes-dbs/postgresql/files/postgresql-setup new file mode 100644 index 0000000000..75bb01e05f --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/postgresql/files/postgresql-setup @@ -0,0 +1,73 @@ +#!/bin/sh +# +# postgresql-setup Initialization operation for PostgreSQL + +# For SELinux we need to use 'runuser' not 'su' +if [ -x /sbin/runuser ] +then + SU=runuser +else + SU=su +fi + +PGENGINE=/usr/bin +PGDATA=/var/lib/postgresql/data +PGLOG=/var/lib/postgresql/pgstartup.log +script_result=0 + +initdb(){ + if [ -f "$PGDATA/PG_VERSION" ] + then + echo -n "Data directory is not empty!" + echo -n " [FAILED] " + echo + script_result=1 + else + echo -n "Initializing database: " + if [ ! -e "$PGDATA" -a ! -h "$PGDATA" ] + then + mkdir -p "$PGDATA" || exit 1 + chown postgres:postgres "$PGDATA" + chmod go-rwx "$PGDATA" + fi + # Clean up SELinux tagging for PGDATA + [ -x /sbin/restorecon ] && /sbin/restorecon "$PGDATA" + + # Make sure the startup-time log file is OK, too + if [ ! -e "$PGLOG" -a ! -h "$PGLOG" ] + then + touch "$PGLOG" || exit 1 + chown postgres:postgres "$PGLOG" + chmod go-rwx "$PGLOG" + [ -x /sbin/restorecon ] && /sbin/restorecon "$PGLOG" + fi + + # Initialize the database + $SU -l postgres -c "$PGENGINE/initdb --pgdata='$PGDATA' --auth='ident'" >> "$PGLOG" 2>&1 < /dev/null + + # Create directory for postmaster log + mkdir "$PGDATA/pg_log" + chown postgres:postgres "$PGDATA/pg_log" + chmod go-rwx "$PGDATA/pg_log" + + if [ -f "$PGDATA/PG_VERSION" ] + then + echo -n " [ OK ] " + else + echo -n " [FAILED] " + script_result=1 + fi + echo + fi +} + +case "$1" in + initdb) + initdb + ;; + *) + echo "Usage: $0 initdb" + exit 2 +esac + +exit $script_result diff --git a/meta-openembedded/meta-oe/recipes-dbs/postgresql/files/postgresql.init b/meta-openembedded/meta-oe/recipes-dbs/postgresql/files/postgresql.init new file mode 100644 index 0000000000..4a4f0cd168 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/postgresql/files/postgresql.init @@ -0,0 +1,193 @@ +#!/bin/sh +# +# postgresql This is the init script for starting up the PostgreSQL +# server. +# +# chkconfig: - 64 36 +# description: PostgreSQL database server. +# processname: postmaster +# pidfile: /var/run/postmaster.PORT.pid + +# This script is slightly unusual in that the name of the daemon (postmaster) +# is not the same as the name of the subsystem (postgresql) + +# PGVERSION is the full package version, e.g., 8.4.0 +# Note: the specfile inserts the correct value during package build +PGVERSION=9.2.4 +# PGMAJORVERSION is major version, e.g., 8.4 (this should match PG_VERSION) +PGMAJORVERSION=`echo "$PGVERSION" | sed 's/^\([0-9]*\.[0-9]*\).*$/\1/'` + +# Source function library. +. /etc/init.d/functions + +# Find the name of the script +NAME=`basename $0` +if [ ${NAME:0:1} = "S" -o ${NAME:0:1} = "K" ] +then + NAME=${NAME:3} +fi + +# For SELinux we need to use 'runuser' not 'su' +if [ -x /sbin/runuser ] +then + SU=runuser +else + SU=su +fi + + +# Set defaults for configuration variables +PGENGINE=/usr/bin +PGPORT=5432 +PGDATA=/var/lib/postgresql/data +PGLOG=/var/lib/postgresql/pgstartup.log +# Value to set as postmaster process's oom_adj +PG_OOM_ADJ=-17 + +# Override defaults from /etc/sysconfig/postgresql if file is present +[ -f /etc/default/postgresql/${NAME} ] && . /etc/default/postgresql/${NAME} + +export PGDATA +export PGPORT + +lockfile="/var/lock/subsys/${NAME}" +pidfile="/var/run/postmaster.${PGPORT}.pid" + +script_result=0 + +start(){ + [ -x "$PGENGINE/postmaster" ] || exit 5 + + PSQL_START=$"Starting ${NAME} service: " + + # Make sure startup-time log file is valid + if [ ! -e "$PGLOG" -a ! -h "$PGLOG" ] + then + touch "$PGLOG" || exit 4 + chown postgres:postgres "$PGLOG" + chmod go-rwx "$PGLOG" + [ -x /sbin/restorecon ] && /sbin/restorecon "$PGLOG" + fi + + # Check for the PGDATA structure + if [ -f "$PGDATA/PG_VERSION" ] && [ -d "$PGDATA/base" ] + then + # Check version of existing PGDATA + if [ x`cat "$PGDATA/PG_VERSION"` != x"$PGMAJORVERSION" ] + then + SYSDOCDIR="(Your System's documentation directory)" + if [ -d "/usr/doc/postgresql-$PGVERSION" ] + then + SYSDOCDIR=/usr/doc + fi + if [ -d "/usr/share/doc/postgresql-$PGVERSION" ] + then + SYSDOCDIR=/usr/share/doc + fi + if [ -d "/usr/doc/packages/postgresql-$PGVERSION" ] + then + SYSDOCDIR=/usr/doc/packages + fi + if [ -d "/usr/share/doc/packages/postgresql-$PGVERSION" ] + then + SYSDOCDIR=/usr/share/doc/packages + fi + echo + echo $"An old version of the database format was found." + echo $"You need to upgrade the data format before using PostgreSQL." + echo $"See $SYSDOCDIR/postgresql-$PGVERSION/README.rpm-dist for more information." + exit 1 + fi + else + # No existing PGDATA! Warn the user to initdb it. + echo + echo "$PGDATA is missing. Use \"postgresql-setup initdb\" to initialize the cluster first." + echo -n " [FAILED] " + echo + exit 1 + fi + + echo -n "$PSQL_START" + test x"$PG_OOM_ADJ" != x && echo "$PG_OOM_ADJ" > /proc/self/oom_score_adj + $SU -l postgres -c "$PGENGINE/postmaster -p '$PGPORT' -D '$PGDATA' ${PGOPTS} &" >> "$PGLOG" 2>&1 < /dev/null + sleep 2 + pid=`head -n 1 "$PGDATA/postmaster.pid" 2>/dev/null` + if [ "x$pid" != x ] + then + echo -n " [ OK ]" + touch "$lockfile" + echo $pid > "$pidfile" + echo + else + echo -n " [FAILED]" + echo + script_result=1 + fi +} + +stop(){ + echo -n $"Stopping ${NAME} service: " + if [ -e "$lockfile" ] + then + $SU -l postgres -c "$PGENGINE/pg_ctl stop -D '$PGDATA' -s -m fast" > /dev/null 2>&1 < /dev/null + ret=$? + if [ $ret -eq 0 ] + then + echo -n " [ OK ] " + rm -f "$pidfile" + rm -f "$lockfile" + else + echo -n " [FAILED] " + script_result=1 + fi + else + # not running; per LSB standards this is "ok" + echo -n " [ OK ] " + fi + echo +} + +restart(){ + stop + start +} + +condrestart(){ + [ -e "$lockfile" ] && restart || : +} + +reload(){ + $SU -l postgres -c "$PGENGINE/pg_ctl reload -D '$PGDATA' -s" > /dev/null 2>&1 < /dev/null +} + + +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + status) + status postmaster + script_result=$? + ;; + restart) + restart + ;; + condrestart|try-restart) + condrestart + ;; + reload) + reload + ;; + force-reload) + restart + ;; + *) + echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" + exit 2 +esac + +exit $script_result diff --git a/meta-openembedded/meta-oe/recipes-dbs/postgresql/files/postgresql.pam b/meta-openembedded/meta-oe/recipes-dbs/postgresql/files/postgresql.pam new file mode 100644 index 0000000000..0b6fdc5f26 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/postgresql/files/postgresql.pam @@ -0,0 +1,4 @@ +#%PAM-1.0 +auth include common-auth +account include common-account +password include common-password diff --git a/meta-openembedded/meta-oe/recipes-dbs/postgresql/files/postgresql.service b/meta-openembedded/meta-oe/recipes-dbs/postgresql/files/postgresql.service new file mode 100644 index 0000000000..4ec959e842 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/postgresql/files/postgresql.service @@ -0,0 +1,27 @@ +[Unit] +Description=PostgreSQL database server +After=network.target + +[Service] +Type=forking +User=postgres +Group=postgres + +# Port number for server to listen on +Environment=PGPORT=5432 + +# Location of database directory +Environment=PGDATA=/var/lib/postgresql/data + +# Disable OOM kill on the postmaster +OOMScoreAdjust=-17 + +ExecStart=@BINDIR@/pg_ctl start -D ${PGDATA} -s -o "-p ${PGPORT}" -w -t 300 +ExecStop=@BINDIR@/pg_ctl stop -D ${PGDATA} -s -m fast +ExecReload=@BINDIR@/pg_ctl reload -D ${PGDATA} -s + +# Give a reasonable amount of time for the server to start up/shut down +TimeoutSec=300 + +[Install] +WantedBy=multi-user.target diff --git a/meta-openembedded/meta-oe/recipes-dbs/postgresql/postgresql.inc b/meta-openembedded/meta-oe/recipes-dbs/postgresql/postgresql.inc new file mode 100644 index 0000000000..812c2aed48 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/postgresql/postgresql.inc @@ -0,0 +1,383 @@ +SUMMARY = "PostgreSQL is a powerful, open source relational database system." +DESCRIPTION = "\ + PostgreSQL is an advanced Object-Relational database management system \ + (DBMS) that supports almost all SQL constructs (including \ + transactions, subselects and user-defined types and functions). The \ + postgresql package includes the client programs and libraries that \ + you'll need to access a PostgreSQL DBMS server. These PostgreSQL \ + client programs are programs that directly manipulate the internal \ + structure of PostgreSQL databases on a PostgreSQL server. These client \ + programs can be located on the same machine with the PostgreSQL \ + server, or may be on a remote machine which accesses a PostgreSQL \ + server over a network connection. This package contains the docs \ + in HTML for the whole package, as well as command-line utilities for \ + managing PostgreSQL databases on a PostgreSQL server. \ + \ + If you want to manipulate a PostgreSQL database on a local or remote \ + PostgreSQL server, you need this package. You also need to install \ + this package if you're installing the postgresql-server package. \ +" +HOMEPAGE = "http://www.postgresql.com" +LICENSE = "BSD" +DEPENDS = "zlib readline tzcode-native" + +ARM_INSTRUCTION_SET = "arm" + +SRC_URI = "http://ftp.postgresql.org/pub/source/v${PV}/${BP}.tar.bz2 \ + file://postgresql.init \ + file://postgresql-bashprofile \ + file://postgresql.pam \ + file://postgresql-setup \ + file://postgresql.service \ + file://0001-Use-pkg-config-for-libxml2-detection.patch \ +" + +LEAD_SONAME = "libpq.so" + +# LDFLAGS for shared libraries +export LDFLAGS_SL = "${LDFLAGS}" + +inherit autotools pkgconfig perlnative pythonnative useradd update-rc.d systemd gettext + +CFLAGS += "-I${STAGING_INCDIR}/${PYTHON_DIR} -I${STAGING_INCDIR}/tcl8.6" + +SYSTEMD_SERVICE_${PN} = "postgresql.service" +SYSTEMD_AUTO_ENABLE_${PN} = "disable" + +DEPENDS_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd-systemctl-native', '', d)}" +pkg_postinst_${PN} () { + if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd sysvinit', 'true', 'false', d)}; then + if [ -n "$D" ]; then + OPTS="--root=$D" + fi + systemctl $OPTS mask postgresql-server.service + fi +} + +enable_pam = "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" +PACKAGECONFIG ??= "${enable_pam} openssl python uuid libxml tcl nls libxml perl" +PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam," +PACKAGECONFIG[openssl] = "--with-openssl,--without-openssl,openssl," +PACKAGECONFIG[python] = "--with-python,--without-python,python,python" +PACKAGECONFIG[uuid] = "--with-ossp-uuid,--without-ossp-uuid,ossp-uuid," +PACKAGECONFIG[tcl] = "--with-tcl --with-tclconfig=${STAGING_BINDIR_CROSS},--without-tcl,tcl tcl-native," +PACKAGECONFIG[nls] = "--enable-nls,--disable-nls,," +PACKAGECONFIG[libxml] = "--with-libxml,--without-libxml,libxml2,libxml2" +PACKAGECONFIG[perl] = "--with-perl,--without-perl,perl,perl" + +EXTRA_OECONF += "--enable-thread-safety --disable-rpath \ + --datadir=${datadir}/${BPN} \ + --sysconfdir=${sysconfdir}/${BPN} \ +" +EXTRA_OECONF_sh4 += "--disable-spinlocks" +EXTRA_OECONF_aarch64 += "--disable-spinlocks" + +PACKAGES_DYNAMIC += "^${PN}-plperl ^${PN}-plperl-dbg \ + ^${PN}-pltcl ^${PN}-pltcl-dbg \ + ^${PN}-plpython ^${PN}-plpython-dbg \ +" + +python populate_packages_prepend() { + + def fill_more(name, dbg=True): + if name is None or name.strip() == "": + return + + fpack=d.getVar('PACKAGES', False) or "" + fpack="${PN}-" + name + " " + fpack + if dbg: + fpack="${PN}-" + name + "-dbg" + " " + fpack + d.setVar('PACKAGES', fpack) + + conf=(d.getVar('PACKAGECONFIG') or "").split() + pack=d.getVar('PACKAGES', False) or "" + bb.debug(1, "PACKAGECONFIG=%s" % conf) + bb.debug(1, "PACKAGES1=%s" % pack ) + + if "perl" in conf : + fill_more("plperl") + + if "tcl" in conf: + fill_more("pltcl") + + if "python" in conf: + fill_more("plpython") + + pack=d.getVar('PACKAGES') or "" + bb.debug(1, "PACKAGES2=%s" % pack) + +} + +do_configure() { + # do_configure + autotools_do_configure + + # do_configure_append + # workaround perl package related bugs + sed -i -e "s:-L/usr/local/lib:-L=/usr/local/lib:g" \ + ${B}/src/Makefile.global + LIBPNA="\${STAGING_LIBDIR_NATIVE}/perl-native" + LIBNA="\${STAGING_LIBDIR_NATIVE}" + BLIBNA="\${STAGING_BASE_LIBDIR_NATIVE}" + sed -i -e "/^perl_archlibexp/s:${LIBPNA}:${STAGING_LIBDIR}:g" \ + ${B}/src/Makefile.global + sed -i -e "/^perl_privlibexp/s:${LIBPNA}:${STAGING_LIBDIR}:g" \ + ${B}/src/Makefile.global + # remove the rpath, replace with correct lib path + sed -i \ + -e "/^perl_embed_ldflags/s:-Wl,-rpath,${LIBNA}::g" \ + -e "/^perl_embed_ldflags/s:-Wl,-rpath,${BLIBNA}::g" \ + -e "/^perl_embed_ldflags/s:-Wl,-rpath-link,${LIBNA}::g" \ + -e "/^perl_embed_ldflags/s:-Wl,-rpath-link,${BLIBNA}::g" \ + -e "/^perl_embed_ldflags/s:${LIBPNA}:${STAGING_LIBDIR}:g" \ + -e "/^perl_embed_ldflags/s:${LIBNA}:${STAGING_LIBDIR}:g" \ + -e "/^perl_embed_ldflags/s:${BLIBNA}:${STAGING_BASELIBDIR}:g" \ + -e "/^TCLSH/s:=.*:= ${bindir}/tclsh:g" \ + ${B}/src/Makefile.global + + if ${@bb.utils.contains('PACKAGECONFIG', 'perl', 'true', 'false', d)}; then + # workaround perl package's libperl.so problem + # we are using perlnative so this perl should have same version + perl_version=`perl -v 2>/dev/null | \ + sed -n 's/This is perl.*v[a-z ]*\([0-9]\.[0-9][0-9.]*\).*$/\1/p'` + if [ ! -h "${STAGING_LIBDIR}/perl/$perl_version/CORE/libperl.so" -a \ + ! -h "${STAGING_LIBDIR}/libperl.so" ]; then + ln -sf ../../../libperl.so.5 \ + ${STAGING_LIBDIR}/perl/$perl_version/CORE/libperl.so + fi + fi +} + +do_compile_append() { + oe_runmake -C contrib all +} + +# server needs to configure user and group +usernum = "28" +groupnum = "28" +USERADD_PACKAGES = "${PN}" +USERADD_PARAM_${PN} = "-M -g postgres -o -r -d ${localstatedir}/lib/${BPN} \ + -s /bin/bash -c 'PostgreSQL Server' -u ${usernum} postgres" +GROUPADD_PARAM_${PN} = "-g ${groupnum} -o -r postgres" + +INITSCRIPT_PACKAGES = "${PN}" +INITSCRIPT_NAME = "${BPN}-server" +INITSCRIPT_PARAMS = "start 64 . stop 36 0 1 2 3 4 5 6 ." + +do_install_append() { + # install contrib + oe_runmake DESTDIR=${D} -C contrib install + # install tutorial + install -d -m 0755 ${D}${libdir}/${BPN}/tutorial + install ${B}/src/tutorial/* ${D}${libdir}/${BPN}/tutorial + + # install COPYRIGHT README HISTORY + install -d -m 0755 ${D}${docdir}/${BPN} + for i in ${B}/COPYRIGHT ${B}/README ${B}/HISTORY ${B}/doc/KNOWN_BUGS ${B}/doc/MISSING_FEATURES ${B}/doc/README* ${B}/doc/bug.template; do + [ -f $i ] && install $i ${D}${docdir}/${BPN} + done + + # install dirs and server init + install -d ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/${BPN}.init ${D}${sysconfdir}/init.d/${BPN}-server + sed -i -e "s/^PGVERSION=.*$/PGVERSION=${PV}/g" ${D}${sysconfdir}/init.d/${BPN}-server + install -m 0755 ${WORKDIR}/${BPN}-setup ${D}${bindir}/${BPN}-setup + install -d -m 700 ${D}${localstatedir}/lib/${BPN}/data + install -d -m 700 ${D}${localstatedir}/lib/${BPN}/backups + install -m 644 ${WORKDIR}/${BPN}-bashprofile ${D}${localstatedir}/lib/${BPN}/.bash_profile + chown -R postgres:postgres ${D}${localstatedir}/lib/${BPN} + # multiple server config directory + install -d -m 700 ${D}${sysconfdir}/default/${BPN} + + if [ "${@d.getVar('enable_pam')}" = "pam" ]; then + install -d ${D}${sysconfdir}/pam.d + install -m 644 ${WORKDIR}/postgresql.pam ${D}${sysconfdir}/pam.d/postgresql + fi + + # Install systemd unit files + install -d ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/postgresql.service ${D}${systemd_unitdir}/system + sed -i -e 's,@BINDIR@,${bindir},g' \ + ${D}${systemd_unitdir}/system/postgresql.service +} + +SSTATE_SCAN_FILES += "Makefile.global" + +PACKAGES =+ "${PN}-client ${PN}-server-dev ${PN}-timezone \ + libecpg-compat-dbg libecpg-compat libecpg-compat-dev \ + libecpg-dbg libecpg libecpg-dev libecpg-staticdev libecpg-doc \ + libpq-dbg libpq libpq-dev libpq-staticdev \ + libpgtypes-dbg libpgtypes libpgtypes-staticdev libpgtypes-dev \ + ${PN}-contrib ${PN}-contrib-dbg \ +" + +FILES_${PN} += "${sysconfdir}/init.d/${BPN}-server \ + ${localstatedir}/lib/${BPN}/data ${localstatedir}/lib/${BPN}/backups \ + ${localstatedir}/lib/${BPN}/.bash_profile ${sysconfdir}/default/${BPN} \ + ${libdir}/${BPN}/dict_snowball.so ${libdir}/${BPN}/plpgsql.so \ + ${libdir}/${BPN}/euc2004_sjis2004.so \ + ${libdir}/${BPN}/libpqwalreceiver.so \ + ${libdir}/${BPN}/*_and_*.so \ + ${@'${sysconfdir}/pam.d/postgresql' \ + if 'pam' == d.getVar('enable_pam') \ + else ''} \ +" + +FILES_${PN}-dbg += " ${libdir}/${BPN}/.debug/dict_snowball.so \ + ${libdir}/${BPN}/.debug/plpgsql.so \ + ${libdir}/${BPN}/.debug/euc2004_sjis2004.so \ + ${libdir}/${BPN}/.debug/libpqwalreceiver.so \ + ${libdir}/${BPN}/.debug/*_and_*.so \ +" + +FILES_${PN}-client = "${bindir}/clusterdb \ + ${bindir}/createdb \ + ${bindir}/createlang \ + ${bindir}/createuser \ + ${bindir}/dropdb \ + ${bindir}/droplang \ + ${bindir}/dropuser \ + ${bindir}/pg_dump \ + ${bindir}/pg_dumpall \ + ${bindir}/pg_restore \ + ${bindir}/psql \ + ${bindir}/reindexdb \ + ${bindir}/vacuumdb \ + ${bindir}/vacuumlo \ + ${datadir}/${BPN}/psqlrc.sample \ +" +FILES_${PN}-client-doc = "${mandir}/man1/clusterdb.* \ + ${mandir}/man1/createdb.* ${mandir}/man1/createlang.* \ + ${mandir}/man1/createuser.* ${mandir}/man1/dropdb.* \ + ${mandir}/man1/droplang.* ${mandir}/man1/dropuser.* \ + ${mandir}/man1/pg_dump.* ${mandir}/man1/pg_dumpall.* \ + ${mandir}/man1/pg_restore.* ${mandir}/man1/psql.* \ + ${mandir}/man1/reindexdb.* ${mandir}/man1/vacuumdb.* \ + ${mandir}/man7/* \ +" +FILES_${PN}-doc += "${docdir}/${BPN}/html ${libdir}/${BPN}/tutorial/ \ + ${mandir}/man1/initdb.* ${mandir}/man1/pg_controldata.* \ + ${mandir}/man1/pg_ctl.* ${mandir}/man1/pg_resetxlog.* \ + ${mandir}/man1/postgres.* ${mandir}/man1/postmaster.* \ +" +FILES_${PN}-timezone = "${datadir}/${BPN}/timezone \ + ${datadir}/${BPN}/timezonesets \ +" +RDEPENDS_${PN} += "${PN}-timezone" +FILES_${PN}-server-dev = "${includedir}/${BPN}/server" + +FILES_libecpg = "${libdir}/libecpg*${SOLIBS}" +FILES_libecpg-dbg = "${libdir}/.debug/libecpg*" +FILES_libecpg-dev = "${libdir}/libecpg*${SOLIBSDEV} \ + ${libdir}/libpgtypes*${SOLIBSDEV} \ + ${includedir}/ecpg*.h ${includedir}/${BPN}/ecpg*.h \ + ${includedir}/pgtypes*.h ${includedir}/${BPN}/informix \ + ${includedir}/sql3types.h ${includedir}/sqlca.h \ +" +FILES_libecpg-doc = "${mandir}/man1/ecpg.*" +FILES_libecpg-staticdev = "${libdir}/libecpg*.a" +SECTION_libecpg-staticdev = "devel" +RDEPENDS_libecpg-staticdev = "libecpg-dev (= ${EXTENDPKGV})" + +FILES_libpq = "${libdir}/libpq*${SOLIBS}" +FILES_libpq-dbg = "${libdir}/.debug/libpq* ${libdir}/${BPN}/pgxs/src/test/regress/.debug/*" +FILES_libpq-dev = "${libdir}/libpq*${SOLIBSDEV} \ + ${includedir} \ +" +FILES_libpq-staticdev = "${libdir}/libpq*.a ${libdir}/libpgport.a" +SECTION_libpq-staticdev = "devel" +RDEPENDS_libpq-staticdev = "libpq-dev (= ${EXTENDPKGV})" + +FILES_libecpg-compat = "${libdir}/libecpg_compat*${SOLIBS}" +FILES_libecpg-compat-dbg = "${libdir}/.debug/libecpg_compat*" +FILES_libecpg-compat-dev = "${libdir}/libecpg_compat*${SOLIBS}" +FILES_libpgtypes = "${libdir}/libpgtypes*${SOLIBS}" +FILES_libpgtypes-dbg = "${libdir}/.debug/libpgtypes*" +FILES_libpgtypes-staticdev = "${libdir}/libpgtypes*.a" +FILES_libpgtypes-dev = "${libdir}/libpgtypes*${SOLIBS} ${includedir}/pgtypes*.h" + +FILES_${PN}-contrib = " ${bindir}/oid2name ${bindir}/pg_standby \ + ${bindir}/pgbench ${bindir}/vacuumlo \ + ${S}/contrib/spi/*.example \ + ${libdir}/${BPN}/_int.so ${libdir}/${BPN}/adminpack.so \ + ${libdir}/${BPN}/autoinc.so ${libdir}/${BPN}/auto_explain.so \ + ${libdir}/${BPN}/auth_delay.so ${libdir}/${BPN}/btree_gin.so \ + ${libdir}/${BPN}/btree_gist.so ${libdir}/${BPN}/.so \ + ${libdir}/${BPN}/chkpass.so ${libdir}/${BPN}/citext.so \ + ${libdir}/${BPN}/cube.so ${libdir}/${BPN}/dblink.so \ + ${libdir}/${BPN}/dict_int.so ${libdir}/${BPN}/dict_xsyn.so \ + ${libdir}/${BPN}/dummy_seclabel.so ${libdir}/${BPN}/earthdistance.so \ + ${libdir}/${BPN}/file_fdw.so ${libdir}/${BPN}/fuzzystrmatch.so \ + ${libdir}/${BPN}/hstore.so ${libdir}/${BPN}/insert_username.so \ + ${libdir}/${BPN}/isn.so ${libdir}/${BPN}/lo.so \ + ${libdir}/${BPN}/ltree.so ${libdir}/${BPN}/moddatetime.so \ + ${libdir}/${BPN}/pageinspect.so ${libdir}/${BPN}/pg_buffercache.so \ + ${libdir}/${BPN}/pg_freespacemap.so ${libdir}/${BPN}/pg_trgm.so \ + ${libdir}/${BPN}/pgcrypto.so ${libdir}/${BPN}/pgrowlocks.so \ + ${libdir}/${BPN}/pgstattuple.so ${libdir}/${BPN}/pg_stat_statements.so \ + ${libdir}/${BPN}/refint.so ${libdir}/${BPN}/seg.so \ + ${libdir}/${BPN}/sslinfo.so \ + ${libdir}/${BPN}/tablefunc.so \ + ${libdir}/${BPN}/test_parser.so ${libdir}/${BPN}/timetravel.so \ + ${libdir}/${BPN}/tsearch2.so ${libdir}/${BPN}/uuid-ossp.so \ + ${libdir}/${BPN}/pgxml.so ${libdir}/${BPN}/passwordcheck.so \ + ${libdir}/${BPN}/pg_upgrade_support.so ${libdir}/${BPN}/.so \ + ${libdir}/${BPN}/unaccent.so \ +" +FILES_${PN}-contrib-dbg = " \ + ${libdir}/${BPN}/.debug/_int.so ${libdir}/${BPN}/.debug/adminpack.so \ + ${libdir}/${BPN}/.debug/autoinc.so ${libdir}/${BPN}/.debug/auto_explain.so \ + ${libdir}/${BPN}/.debug/auth_delay.so ${libdir}/${BPN}/.debug/btree_gin.so \ + ${libdir}/${BPN}/.debug/btree_gist.so ${libdir}/${BPN}/.debug/.so \ + ${libdir}/${BPN}/.debug/chkpass.so ${libdir}/${BPN}/.debug/citext.so \ + ${libdir}/${BPN}/.debug/cube.so ${libdir}/${BPN}/.debug/dblink.so \ + ${libdir}/${BPN}/.debug/dict_int.so ${libdir}/${BPN}/.debug/dict_xsyn.so \ + ${libdir}/${BPN}/.debug/dummy_seclabel.so \ + ${libdir}/${BPN}/.debug/earthdistance.so \ + ${libdir}/${BPN}/.debug/file_fdw.so ${libdir}/${BPN}/.debug/fuzzystrmatch.so \ + ${libdir}/${BPN}/.debug/hstore.so ${libdir}/${BPN}/.debug/insert_username.so \ + ${libdir}/${BPN}/.debug/isn.so ${libdir}/${BPN}/.debug/lo.so \ + ${libdir}/${BPN}/.debug/ltree.so ${libdir}/${BPN}/.debug/moddatetime.so \ + ${libdir}/${BPN}/.debug/pageinspect.so \ + ${libdir}/${BPN}/.debug/pg_buffercache.so \ + ${libdir}/${BPN}/.debug/pg_freespacemap.so \ + ${libdir}/${BPN}/.debug/pg_trgm.so \ + ${libdir}/${BPN}/.debug/pgcrypto.so ${libdir}/${BPN}/.debug/pgrowlocks.so \ + ${libdir}/${BPN}/.debug/pgstattuple.so \ + ${libdir}/${BPN}/.debug/pg_stat_statements.so \ + ${libdir}/${BPN}/.debug/refint.so ${libdir}/${BPN}/.debug/seg.so \ + ${libdir}/${BPN}/.debug/sslinfo.so \ + ${libdir}/${BPN}/.debug/tablefunc.so \ + ${libdir}/${BPN}/.debug/test_parser.so ${libdir}/${BPN}/.debug/timetravel.so \ + ${libdir}/${BPN}/.debug/tsearch2.so ${libdir}/${BPN}/.debug/uuid-ossp.so \ + ${libdir}/${BPN}/.debug/pgxml.so ${libdir}/${BPN}/.debug/passwordcheck.so \ + ${libdir}/${BPN}/.debug/pg_upgrade_support.so \ + ${libdir}/${BPN}/.debug/unaccent.so \ +" +DESCRIPTION_${PN}-contrib = "The postgresql-contrib package contains \ + contributed packages that are included in the PostgreSQL distribution." + +FILES_${PN}-pltcl = "${libdir}/${BPN}/pltcl.so ${bindir}/pltcl_delmod \ + ${binddir}/pltcl_listmod ${bindir}/pltcl_loadmod \ + ${datadir}/${BPN}/unknown.pltcl" +FILES_${PN}-pltcl-dbg = "${libdir}/${BPN}/.debug/pltcl.so" +SUMMARY_${PN}-pltcl = "The Tcl procedural language for PostgreSQL" +DESCRIPTION_${PN}-pltcl = "PostgreSQL is an advanced Object-Relational \ + database management system. The postgresql-pltcl package contains the PL/Tcl \ + procedural language for the backend." + +FILES_${PN}-plperl = "${libdir}/${BPN}/plperl.so" +FILES_${PN}-plperl-dbg = "${libdir}/${BPN}/.debug/plperl.so" +SUMMARY_${PN}-plperl = "The Perl procedural language for PostgreSQL" +DESCRIPTION_${PN}-plperl = "PostgreSQL is an advanced Object-Relational \ + database management system. The postgresql-plperl package contains the \ + PL/Perl procedural language for the backend." + +# In version 8, it will be plpython.so +# In version 9, it might be plpython{2,3}.so depending on python2 or 3 +FILES_${PN}-plpython = "${libdir}/${BPN}/plpython*.so" +FILES_${PN}-plpython-dbg = "${libdir}/${BPN}/.debug/plpython*.so" +SUMMARY_${PN}-plpython = "The Python procedural language for PostgreSQL" +DESCRIPTION_${PN}-plpython = "PostgreSQL is an advanced Object-Relational \ + database management system. The postgresql-plpython package contains \ + the PL/Python procedural language for the backend." diff --git a/meta-openembedded/meta-oe/recipes-dbs/postgresql/postgresql_9.4.17.bb b/meta-openembedded/meta-oe/recipes-dbs/postgresql/postgresql_9.4.17.bb new file mode 100644 index 0000000000..061184a6fa --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/postgresql/postgresql_9.4.17.bb @@ -0,0 +1,14 @@ +require postgresql.inc + +LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=6dc95e63aa4d72502ff8193dfe2ddd38" + +SRC_URI += "\ + file://not-check-libperl.patch \ +" + +do_compile_prepend_libc-musl() { + sed -i -e 's/\-lnsl//g' ${B}/src/Makefile.global +} + +SRC_URI[md5sum] = "0a08f4078f5e4a54e764f63ad38a6de3" +SRC_URI[sha256sum] = "7a320cd335052b840d209dc9688f09965763351c590e3cc7bf577591179fd7c6" diff --git a/meta-openembedded/meta-oe/recipes-dbs/psqlodbc/files/psqlodbc-donot-use-the-hardcode-libdir.patch b/meta-openembedded/meta-oe/recipes-dbs/psqlodbc/files/psqlodbc-donot-use-the-hardcode-libdir.patch new file mode 100644 index 0000000000..7eda038756 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/psqlodbc/files/psqlodbc-donot-use-the-hardcode-libdir.patch @@ -0,0 +1,26 @@ +[PATCH] do not use the hardcode libdir + +Upstream-status: Pending + +Signed-off-by: Roy.Li <rongqing.li@windriver.com> +Signed-off-by: Jackie Huang <jackie.huang@windriver.com> +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 9b88d4c..df5ad7a 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -140,7 +140,7 @@ if test "$with_libpq" != yes; then + if test -d "$with_libpq"; then + PATH="$PATH:$with_libpq/bin" + CPPFLAGS="$CPPFLAGS -I$with_libpq/include" +- LDFLAGS="$LDFLAGS -L$with_libpq/lib" ++ LDFLAGS="$LDFLAGS -L$with_libpq/${base_libdir}" + else + if test -x "$with_libpq"; then + PG_CONFIG=$with_libpq +-- +2.8.1 + diff --git a/meta-openembedded/meta-oe/recipes-dbs/psqlodbc/files/psqlodbc-fix-for-ptest-support.patch b/meta-openembedded/meta-oe/recipes-dbs/psqlodbc/files/psqlodbc-fix-for-ptest-support.patch new file mode 100644 index 0000000000..a8f14e7689 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/psqlodbc/files/psqlodbc-fix-for-ptest-support.patch @@ -0,0 +1,148 @@ +Subject: [PATCH] psqlodbc: fixes for ptest support + +* Fix the LIBODBC since we don't use ODBC_CONFIG. +* Fix the path for driver. +* Add the default info of postgresql server. +* Fix the output format for ptest. +* Fix the results and exe dir. + +Upstream-Status: Inappropriate [OE ptest specific] + +Signed-off-by: Jackie Huang <jackie.huang@windriver.com> +--- + test/Makefile.in | 2 +- + test/odbcini-gen.sh | 8 ++++---- + test/runsuite.c | 26 +++++++++++++------------- + 3 files changed, 18 insertions(+), 18 deletions(-) + +diff --git a/test/Makefile.in b/test/Makefile.in +index 8710616..fcb470e 100644 +--- a/test/Makefile.in ++++ b/test/Makefile.in +@@ -18,7 +18,7 @@ CFLAGS = @CFLAGS@ + ODBC_CONFIG = @ODBC_CONFIG@ + PROVE = @PROVE@ + +-LIBODBC := $(shell $(ODBC_CONFIG) --libs) ++LIBODBC = -lodbc + + all: $(TESTBINS) runsuite reset-db + +diff --git a/test/odbcini-gen.sh b/test/odbcini-gen.sh +index d2c2c87..6068d9d 100755 +--- a/test/odbcini-gen.sh ++++ b/test/odbcini-gen.sh +@@ -6,7 +6,7 @@ + outini=odbc.ini + outinstini=odbcinst.ini + +-drvr=../.libs/psqlodbcw ++drvr=@LIBDIR@/psqlodbca + driver=${drvr}.so + if test ! -e $driver ; then + driver=${drvr}.dll +@@ -33,10 +33,10 @@ Driver = psqlodbc test driver + Trace = No + TraceFile = + Database = contrib_regression +-Servername = +-Username = ++Servername = localhost ++Username = postgres + Password = +-Port = ++Port = 5432 + ReadOnly = No + RowVersioning = No + ShowSystemTables = No +diff --git a/test/runsuite.c b/test/runsuite.c +index 583cf35..fd2a90e 100644 +--- a/test/runsuite.c ++++ b/test/runsuite.c +@@ -51,7 +51,7 @@ bailout(const char *fmt, ...) + + /* Given a test program's name, get the test name */ + void +-parse_argument(const char *in, char *testname, char *binname) ++parse_argument(const char *in, char *testname, char *binname, const char *inputdir) + { + const char *basename; + #ifdef WIN32 +@@ -65,7 +65,7 @@ parse_argument(const char *in, char *testname, char *binname) + if (strchr(in, DIR_SEP) == NULL) + { + strcpy(testname, in); +- sprintf(binname, "exe%c%s-test", DIR_SEP, in); ++ sprintf(binname, "%s%cexe%c%s-test", inputdir, DIR_SEP, DIR_SEP, in); + return; + } + +@@ -127,7 +127,7 @@ int main(int argc, char **argv) + failures = 0; + for (i = 1, j = 1; i <= numtests; i++, j++) + { +- parse_argument(argv[j], testname, binname); ++ parse_argument(argv[j], testname, binname, inputdir); + if (runtest(binname, testname, i, inputdir) != 0) + failures++; + } +@@ -157,29 +157,29 @@ runtest(const char *binname, const char *testname, int testno, const char *input + #ifndef WIN32 + snprintf(cmdline, sizeof(cmdline), + "ODBCSYSINI=. ODBCINSTINI=./odbcinst.ini ODBCINI=./odbc.ini " +- "%s > results/%s.out", +- binname, testname); ++ "%s > %s/results/%s.out", ++ binname, inputdir, testname); + #else + snprintf(cmdline, sizeof(cmdline), +- "%s > results\\%s.out", +- binname, testname); ++ "%s > %s/results\\%s.out", ++ binname, inputdir, testname); + #endif + rc = system(cmdline); + + diff = rundiff(testname, inputdir); + if (rc != 0) + { +- printf("not ok %d - %s test returned %d\n", testno, testname, rc); ++ printf("FAIL: %d - %s\n\ttest returned %d\n", testno, testname, rc); + ret = 1; + } + else if (diff != 0) + { +- printf("not ok %d - %s test output differs\n", testno, testname); ++ printf("FAIL: %d - %s\n\ttest output differs\n", testno, testname); + ret = 1; + } + else + { +- printf("ok %d - %s\n", testno, testname); ++ printf("PASS: %d - %s\n", testno, testname); + ret = 0; + } + fflush(stdout); +@@ -196,7 +196,7 @@ rundiff(const char *testname, const char *inputdir) + char *result; + size_t result_len; + +- snprintf(filename, sizeof(filename), "results/%s.out", testname); ++ snprintf(filename, sizeof(filename), "%s/results/%s.out", inputdir, testname); + result = slurpfile(filename, &result_len); + + outputno = 0; +@@ -244,8 +244,8 @@ rundiff(const char *testname, const char *inputdir) + * files and print the smallest diff? + */ + snprintf(cmdline, sizeof(cmdline), +- "diff -c %s/expected/%s.out results/%s.out >> regression.diffs", +- inputdir, testname, testname); ++ "diff -c %s/expected/%s.out %s/results/%s.out >> regression.diffs", ++ inputdir, testname, inputdir, testname); + if (system(cmdline) == -1) + printf("# diff failed\n"); + +-- +2.8.2 + diff --git a/meta-openembedded/meta-oe/recipes-dbs/psqlodbc/files/psqlodbc-remove-some-checks-for-cross-compiling.patch b/meta-openembedded/meta-oe/recipes-dbs/psqlodbc/files/psqlodbc-remove-some-checks-for-cross-compiling.patch new file mode 100644 index 0000000000..1d988182e7 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/psqlodbc/files/psqlodbc-remove-some-checks-for-cross-compiling.patch @@ -0,0 +1,118 @@ +Subject: [PATCH] remove some checks for cross-compiling + +some lib check is not suitable for +cross-compiling, so remove them. + +Upstream-Status: Inappropriate [not a real bug,just for cross-compiling] + +Signed-off-by: Song.Li <Song.Li@windriver.com> +Signed-off-by: Kai Kang <kai.kang@windriver.com> +Signed-off-by: Jackie Huang <jackie.huang@windriver.com> +--- + configure.ac | 66 +++++++----------------------------------------------------- + 1 file changed, 7 insertions(+), 59 deletions(-) + +diff --git a/configure.ac b/configure.ac +index df5ad7a..b72bd4c 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -46,57 +46,19 @@ AC_ARG_WITH(iodbc, [ --with-iodbc[[=DIR]] [[default=no]] DIR is the iODBC bas + if test "$with_iodbc" != no; then + with_unixodbc=no + AC_DEFINE(WITH_IODBC, 1, [Define to 1 to build with iODBC support]) +- if test "$with_iodbc" = yes; then +- AC_PATH_PROGS(ODBC_CONFIG, iodbc-config) +- else +- ODBC_CONFIG=$with_iodbc +- fi +- if test ! -x "${ODBC_CONFIG}/bin/iodbc-config"; then +- if test ! -x "${ODBC_CONFIG}"; then +- AC_MSG_ERROR([iodbc-config not found (required for iODBC build)]) +- fi +- else +- ODBC_CONFIG=${ODBC_CONFIG}/bin/iodbc-config +- fi + fi + + if test "$with_unixodbc" != no; then + AC_DEFINE(WITH_UNIXODBC, 1, + [Define to 1 to build with unixODBC support]) +- if test "$with_unixodbc" = yes; then +- AC_PATH_PROGS(ODBC_CONFIG, odbc_config) +- else +- ODBC_CONFIG=$with_unixodbc +- fi +- if test ! -x "${ODBC_CONFIG}/bin/odbc_config"; then +- if test ! -x "${ODBC_CONFIG}"; then +- AC_MSG_ERROR([odbc_config not found (required for unixODBC build)]) +- fi +- else +- ODBC_CONFIG=${ODBC_CONFIG}/bin/odbc_config +- fi + fi + + # + # ODBC include and library + # +- +-if test "$ODBC_CONFIG" != ""; then +- if test "$with_iodbc" != no; then +- ODBC_INCLUDE=`${ODBC_CONFIG} --cflags` +- CPPFLAGS="$CPPFLAGS ${ODBC_INCLUDE}" +- # Linking libiodoc is rather problematic +- [ODBC_LIBDIR=`${ODBC_CONFIG} --libs | sed -e "s/^\(-L\|.*[ \t]-L\)\([^ \n\r\f\t]*\).*$/-L\2/"`] +- LDFLAGS="$LDFLAGS ${ODBC_LIBDIR}" +- else +- ODBC_INCLUDE=`${ODBC_CONFIG} --include-prefix` +- CPPFLAGS="$CPPFLAGS -I${ODBC_INCLUDE}" +- # Linking libodoc is rather problematic +- ODBC_LIBDIR=`${ODBC_CONFIG} --lib-prefix` +- LDFLAGS="$LDFLAGS -L${ODBC_LIBDIR}" +- fi +- AC_MSG_NOTICE([using $ODBC_INCLUDE $ODBC_LIBDIR]) +-fi ++ODBC_LIBS="-lodbcinst" ++LIBS="$LIBS ${ODBC_LIBS}" ++AC_MSG_NOTICE([using $ODBC_INCLUDE $ODBC_LIBS]) + + # + # SQLCOLATTRIBUTE_SQLLEN check +@@ -176,18 +138,10 @@ PGAC_ARG_BOOL(enable, pthreads, yes, + # Find libpq headers and libraries + # + +-if test -z "$PG_CONFIG"; then +- AC_PATH_PROGS(PG_CONFIG, pg_config) +-fi +- +-if test -n "$PG_CONFIG"; then +- pg_includedir=`"$PG_CONFIG" --includedir` +- pg_libdir=`"$PG_CONFIG" --libdir` +- CPPFLAGS="$CPPFLAGS -I$pg_includedir" +- LDFLAGS="$LDFLAGS -L$pg_libdir" +-fi +- +- ++pg_includedir="" ++pg_libdir="" ++CPPFLAGS="$CPPFLAGS" ++LDFLAGS="$LDFLAGS" + + # 1. Programs + +@@ -211,12 +165,6 @@ if test "$with_iodbc" != no; then + [AC_MSG_ERROR([iODBC library "iodbcinst" not found])]) + fi + +-if test "$enable_pthreads" = yes; then +- AC_CHECK_LIB(pthreads, pthread_create, +- [], +- [AC_CHECK_LIB(pthread, pthread_create)]) +-fi +- + AC_CHECK_LIB(pq, PQsetSingleRowMode, [], + [AC_MSG_ERROR([libpq library version >= 9.2 is required])]) + +-- +2.8.1 + diff --git a/meta-openembedded/meta-oe/recipes-dbs/psqlodbc/files/run-ptest b/meta-openembedded/meta-oe/recipes-dbs/psqlodbc/files/run-ptest new file mode 100644 index 0000000000..6b41c63693 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/psqlodbc/files/run-ptest @@ -0,0 +1,46 @@ +#!/bin/sh + +BASEDIR="$(dirname $(readlink -f $0))" + +# init and start postgresql server for testing +PGDATA="/var/lib/postgresql/data" +if [ -f "${PGDATA}/PG_VERSION" ]; then + echo "Data directory is not empty! Skip initdb." +else + echo "Initializing database: " + chown -R postgres:postgres ${PGDATA} + su -l postgres -c "/usr/bin/initdb --pgdata='$PGDATA'" +fi + +SYSV_INIT="/etc/init.d/postgresql-server" +if [ -e ${SYSV_INIT} ]; then + RESTART_POSTGRESQL="${SYSV_INIT} restart" + STOP_POSTGRESQL="${SYSV_INIT} stop" +else + RESTART_POSTGRESQL="systemctl restart postgresql" + STOP_POSTGRESQL="systemctl stop postgresql" +fi + +${RESTART_POSTGRESQL} || echo "Failed to restart postgresql, skip the tests." + +if [ ! -d ${BASEDIR}/results ]; then + mkdir ${BASEDIR}/results +fi + +# Generate odbc config files and reset db +${BASEDIR}/odbcini-gen.sh || echo "FAIL: Generate odbc config files" +ODBCSYSINI=. ODBCINSTINI=./odbcinst.ini ODBCINI=./odbc.ini \ + ${BASEDIR}/reset-db < ${BASEDIR}/sampletables.sql \ + || echo "FAIL: reset db with sample tables" + +# Run the actual tests +TESTS= +for i in `ls ${BASEDIR}/exe/*-test`; do + TESTS="$TESTS $(basename ${i%-test})" +done + +${BASEDIR}/runsuite ${TESTS} --inputdir=${BASEDIR} + +# Cleanup +${STOP_POSTGRESQL} +rm -f regression.diffs odbcinst.ini odbc.ini diff --git a/meta-openembedded/meta-oe/recipes-dbs/psqlodbc/psqlodbc.inc b/meta-openembedded/meta-oe/recipes-dbs/psqlodbc/psqlodbc.inc new file mode 100644 index 0000000000..5337b45695 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/psqlodbc/psqlodbc.inc @@ -0,0 +1,50 @@ +SUMMARY = "ODBC driver for PostgreSQL" +DESCRIPTION = "\ + This package provides a driver that allows ODBC-enabled applications to \ + access PostgreSQL databases. ODBC is an abstraction layer that allows \ + applications written for that layer to access databases in a manner \ + that is relatively independent of the particular database management \ + system. \ + . \ + You need to install this package if you want to use an application that \ + provides database access through ODBC and you want that application to \ + access a PostgreSQL database. This package would need to be installed \ + on the same machine as that client application; the PostgreSQL database \ + server can be on a different machine and does not need any additional \ + software to accept ODBC clients. \ +" +SECTION = "libs" +HOMEPAGE = "http://psqlodbc.projects.postgresql.org/" + +DEPENDS += "postgresql unixodbc" + +EXTRA_OECONF = "\ + ac_cv_lib_ltdl_lt_dlopen=no \ + ac_cv_lib_pq_PQconnectdb=yes \ + --with-unixodbc=yes \ + --with-libpq=${STAGING_LIBDIR}/.. \ + --enable-pthreads \ + --disable-unicode \ + LIBS="-lpthread" \ +" + +inherit autotools pkgconfig ptest + +do_compile_ptest() { + oe_runmake -C ${B}/test +} + +do_install_ptest() { + install -d ${D}${PTEST_PATH} + cp -a --no-preserve=ownership ${B}/test/exe ${S}/test/expected ${D}${PTEST_PATH} + install -m 0755 ${B}/test/reset-db ${D}${PTEST_PATH} + install -m 0755 ${B}/test/runsuite ${D}${PTEST_PATH} + install -m 0755 ${S}/test/odbcini-gen.sh ${D}${PTEST_PATH} + install -m 0755 ${S}/test/sampletables.sql ${D}${PTEST_PATH} + sed -i -e 's|@LIBDIR@|${libdir}|' ${D}${PTEST_PATH}/odbcini-gen.sh +} + +FILES_${PN} += "${libdir}" + +# The tests need a local PostgreSQL server running +RDEPENDS_${PN}-ptest = "postgresql" diff --git a/meta-openembedded/meta-oe/recipes-dbs/psqlodbc/psqlodbc_09.05.0300.bb b/meta-openembedded/meta-oe/recipes-dbs/psqlodbc/psqlodbc_09.05.0300.bb new file mode 100644 index 0000000000..6e1c8ab4a0 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/psqlodbc/psqlodbc_09.05.0300.bb @@ -0,0 +1,14 @@ +require ${PN}.inc + +LICENSE = "LGPLv2" +LIC_FILES_CHKSUM = "file://license.txt;md5=6db3822fc7512e83087ba798da013692" + +SRC_URI = "http://ftp.postgresql.org/pub/odbc/versions/src/${BPN}-${PV}.tar.gz \ + file://psqlodbc-remove-some-checks-for-cross-compiling.patch \ + file://psqlodbc-donot-use-the-hardcode-libdir.patch \ + file://psqlodbc-fix-for-ptest-support.patch \ + file://run-ptest \ +" + +SRC_URI[md5sum] = "4c6e0b22187d7bb1c998ffac89e50f6b" +SRC_URI[sha256sum] = "9521f328bf28aaaf5c8488dc89792b614f9d6271742c0baf9bb41c97537764a8" diff --git a/meta-openembedded/meta-oe/recipes-dbs/rocksdb/rocksdb_git.bb b/meta-openembedded/meta-oe/recipes-dbs/rocksdb/rocksdb_git.bb new file mode 100644 index 0000000000..1e6cbae389 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/rocksdb/rocksdb_git.bb @@ -0,0 +1,32 @@ +SUMMARY = "RocksDB an embeddable, persistent key-value store" +DESCRIPTION = "RocksDB is library that provides an embeddable, persistent key-value store for fast storage." +HOMEPAGE = "http://rocksdb.org/" +LICENSE = "(Apache-2.0 | GPL-2.0) & BSD-3-Clause" +LIC_FILES_CHKSUM = "file://LICENSE.Apache;md5=3b83ef96387f14655fc854ddc3c6bd57 \ + file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://LICENSE.leveldb;md5=fb04ff57a14f308f2eed4a9b87d45837" + +SRCREV = "8969445642039566214d650cc6614849e7dd5e17" +SRCBRANCH = "5.12.fb" +PV = "5.12.2" + +SRC_URI = "git://github.com/facebook/${BPN}.git;branch=${SRCBRANCH}" + +S = "${WORKDIR}/git" + +inherit cmake + +PACKAGECONFIG ??= "bzip2 zlib lz4" +PACKAGECONFIG[bzip2] = "-DWITH_BZ2=ON,-DWITH_BZ2=OFF,bzip2" +PACKAGECONFIG[lz4] = "-DWITH_LZ4=ON,-DWITH_LZ4=OFF,lz4" +PACKAGECONFIG[zlib] = "-DWITH_ZLIB=ON,-DWITH_ZLIB=OFF,zlib" +PACKAGECONFIG[lite] = "-DROCKSDB_LITE=ON,-DROCKSDB_LITE=OFF" + +# Tools and tests currently don't compile on armv5 so we disable them +EXTRA_OECMAKE = "\ + -DPORTABLE=ON \ + -DWITH_TESTS=OFF \ + -DWITH_TOOLS=OFF \ +" + +FILES_${PN}-dev += "${libdir}/cmake" diff --git a/meta-openembedded/meta-oe/recipes-dbs/soci/soci/soci_libdir.patch b/meta-openembedded/meta-oe/recipes-dbs/soci/soci/soci_libdir.patch new file mode 100644 index 0000000000..00a1a5c862 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/soci/soci/soci_libdir.patch @@ -0,0 +1,28 @@ +Define SOCI_LIBDIR only if its not passed via environemnt. In OE we +want to set it per our choice since we use 'lib' for 64bit unless we +are using multilib + +-Khem + +Index: soci-3.2.2/CMakeLists.txt +=================================================================== +--- soci-3.2.2.orig/CMakeLists.txt ++++ soci-3.2.2/CMakeLists.txt +@@ -69,11 +69,12 @@ include(SociDependencies) + ############################################################################### + # Installation + ############################################################################### +- +-if(APPLE OR CMAKE_SIZEOF_VOID_P EQUAL 4) +- set(SOCI_LIBDIR "lib") +-else() +- set(SOCI_LIBDIR "lib64") ++if(NOT DEFINED SOCI_LIBDIR) ++ if(APPLE OR CMAKE_SIZEOF_VOID_P EQUAL 4) ++ set(SOCI_LIBDIR "lib") ++ else() ++ set(SOCI_LIBDIR "lib") ++ endif() + endif() + + set(BINDIR "bin" CACHE PATH "The directory to install binaries into.") diff --git a/meta-openembedded/meta-oe/recipes-dbs/soci/soci_3.2.3.bb b/meta-openembedded/meta-oe/recipes-dbs/soci/soci_3.2.3.bb new file mode 100644 index 0000000000..3f22d38181 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/soci/soci_3.2.3.bb @@ -0,0 +1,49 @@ +# Copyright (C) 2015 Khem Raj <raj.khem@gmail.com> +# Released under the MIT license (see COPYING.MIT for the terms) + +DESCRIPTION = "The C++ Database Access Library" +HOMEPAGE = "http://soci.sourceforge.net" +LICENSE = "BSL-1.0" +LIC_FILES_CHKSUM = "file://LICENSE_1_0.txt;md5=e4224ccaecb14d942c71d31bef20d78c" +SECTION = "libs" +DEPENDS = "boost" + + +SRC_URI = "${SOURCEFORGE_MIRROR}/project/${BPN}/${BPN}/${BP}/${BP}.tar.gz \ + file://soci_libdir.patch \ + " +SRC_URI[md5sum] = "acfbccf176cd20e06833a8037a2d3699" +SRC_URI[sha256sum] = "2c659db0f4f7b424bbcffe195c03c293a1dbf676189a27b077fb2aab4d53a610" + +TESTCONFIG = '-DSOCI_TEST_EMPTY_CONNSTR="dummy" -DSOCI_TEST_SQLITE3_CONNSTR="test.db" \ + -DSOCI_TEST_POSTGRESQL_CONNSTR:STRING="dbname=soci_test" \ + -DSOCI_TEST_MYSQL_CONNSTR:STRING="db=soci_test user=oe password=oe"' + +OBASEDIR ?= "/opt/oracle" +OINCDIR = "rdbms/public" +OLIBDIR = "lib" + +PACKAGECONFIG[sqlite3] = "-DSOCI_SQLITE3=ON,-DSOCI_SQLITE3=OFF,sqlite3," +PACKAGECONFIG[mysql] = "-DSOCI_MYSQL=ON,-DSOCI_MYSQL=OFF,mariadb," +PACKAGECONFIG[postgresql] = "-DSOCI_POSTGRESQL=ON,-DSOCI_POSTGRESQL=OFF,postgresql," +PACKAGECONFIG[odbc] = "-DSOCI_ODBC=ON,-DSOCI_ODBC=OFF,," +PACKAGECONFIG[empty] = "-DSOCI_EMPTY=ON,-DSOCI_EMPTY=OFF,," +PACKAGECONFIG[oracle] = "-DWITH_ORACLE=ON --with-oracle-include=${OINCDIR} --with-oracle-lib=${OLIBDIR},-DWITH_ORACLE=OFF,," +PACKAGECONFIG[ptest] = "${TESTCONFIG},,," + +# enable your backend by default we enable 'empty' +PACKAGECONFIG ??= "empty" + +# Take the flags added by PACKAGECONFIG and pass them to cmake. +EXTRA_OECMAKE = "${EXTRA_OECONF} -DSOCI_LIBDIR=${libdir}" +DISABLE_STATIC = "" + +inherit dos2unix cmake + +PACKAGES += "${PN}-sqlite3 ${PN}-mysql ${PN}-postgresql ${PN}-odbc ${PN}-oracle" + +FILES_${PN}-sqlite3 = "${libdir}/lib${BPN}_sqlite3.so.*" +FILES_${PN}-mysql = "${libdir}/lib${BPN}_mysql.so.*" +FILES_${PN}-postgresql = "${libdir}/lib${BPN}_postgresql.so.*" +FILES_${PN}-odbc = "${libdir}/lib${BPN}_odbc.so.*" +FILES_${PN}-oracle = "${libdir}/lib${BPN}_oracle.so.*" diff --git a/meta-openembedded/meta-oe/recipes-dbs/sqlite/sqlite-2.8.17/0001-shell.c-Fix-format-not-a-string-literal-warning.patch b/meta-openembedded/meta-oe/recipes-dbs/sqlite/sqlite-2.8.17/0001-shell.c-Fix-format-not-a-string-literal-warning.patch new file mode 100644 index 0000000000..c5d7c0c81a --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/sqlite/sqlite-2.8.17/0001-shell.c-Fix-format-not-a-string-literal-warning.patch @@ -0,0 +1,32 @@ +From 443980ddc82fb40e2e1f9544f2be169bd23dd246 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sat, 17 Jun 2017 16:49:24 -0700 +Subject: [PATCH] shell.c: Fix format not a string literal warning + +src/shell.c:695:20: error: format not a string literal and no format arguments [-Werror=format-security] +| fprintf(stderr,zHelp); +| ^~~~~ + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + src/shell.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/shell.c b/src/shell.c +index bb46c49..3c6fe0f 100644 +--- a/src/shell.c ++++ b/src/shell.c +@@ -692,7 +692,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){ + }else + + if( c=='h' && strncmp(azArg[0], "help", n)==0 ){ +- fprintf(stderr,zHelp); ++ fprintf(stderr, "%s", zHelp); + }else + + if( c=='i' && strncmp(azArg[0], "indices", n)==0 && nArg>1 ){ +-- +2.13.1 + diff --git a/meta-openembedded/meta-oe/recipes-dbs/sqlite/sqlite-2.8.17/mainmk_build_dynamic.patch b/meta-openembedded/meta-oe/recipes-dbs/sqlite/sqlite-2.8.17/mainmk_build_dynamic.patch new file mode 100644 index 0000000000..914422f1df --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/sqlite/sqlite-2.8.17/mainmk_build_dynamic.patch @@ -0,0 +1,32 @@ +diff -urN sqlite-2.8.17.orig/main.mk sqlite-2.8.17/main.mk +--- sqlite-2.8.17.orig/main.mk 2005-04-23 22:43:23.000000000 +0000 ++++ sqlite-2.8.17/main.mk 2009-04-02 20:10:36.000000000 +0000 +@@ -139,7 +139,7 @@ + # This is the default Makefile target. The objects listed here + # are what get build when you type just "make" with no arguments. + # +-all: sqlite.h config.h libsqlite.a sqlite$(EXE) ++all: sqlite.h config.h libsqlite.so sqlite$(EXE) + + # Generate the file "last_change" which contains the date of change + # of the most recently modified source code file +@@ -148,13 +148,12 @@ + cat $(SRC) | grep '$$Id: ' | sort +4 | tail -1 \ + | awk '{print $$5,$$6}' >last_change + +-libsqlite.a: $(LIBOBJ) +- $(AR) libsqlite.a $(LIBOBJ) +- $(RANLIB) libsqlite.a +- +-sqlite$(EXE): $(TOP)/src/shell.c libsqlite.a sqlite.h +- $(TCCX) $(READLINE_FLAGS) -o sqlite$(EXE) $(TOP)/src/shell.c \ +- libsqlite.a $(LIBREADLINE) $(THREADLIB) ++libsqlite.so: $(LIBOBJ) ++ $(CC) $(LDFLAGS) -shared -o libsqlite.so -Wl,-soname,libsqlite.so.0 $(LIBOBJ) ++ ++sqlite$(EXE): $(TOP)/src/shell.c libsqlite.so sqlite.h ++ $(TCCX) $(LDFLAGS) $(READLINE_FLAGS) -o sqlite$(EXE) $(TOP)/src/shell.c \ ++ -lsqlite $(LIBREADLINE) $(THREADLIB) + + sqlite_analyzer$(EXE): $(TOP)/src/tclsqlite.c libsqlite.a $(TESTSRC) \ + $(TOP)/tool/spaceanal.tcl diff --git a/meta-openembedded/meta-oe/recipes-dbs/sqlite/sqlite-2.8.17/mainmk_no_tcl.patch b/meta-openembedded/meta-oe/recipes-dbs/sqlite/sqlite-2.8.17/mainmk_no_tcl.patch new file mode 100644 index 0000000000..b84b6486ef --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/sqlite/sqlite-2.8.17/mainmk_no_tcl.patch @@ -0,0 +1,20 @@ +diff -bur sqlite-2.8.17~orig/main.mk sqlite-2.8.17/main.mk +--- sqlite-2.8.17~orig/main.mk 2006-02-13 04:09:33.000000000 -0600 ++++ sqlite-2.8.17/main.mk 2006-02-13 04:15:42.000000000 -0600 +@@ -58,7 +58,7 @@ + expr.o func.o hash.o insert.o \ + main.o opcodes.o os.o pager.o parse.o pragma.o printf.o random.o \ + select.o table.o tokenize.o trigger.o update.o util.o \ +- vacuum.o vdbe.o vdbeaux.o where.o tclsqlite.o ++ vacuum.o vdbe.o vdbeaux.o where.o + + # All of the source code files. + # +@@ -91,7 +91,6 @@ + $(TOP)/src/sqlite.h.in \ + $(TOP)/src/sqliteInt.h \ + $(TOP)/src/table.c \ +- $(TOP)/src/tclsqlite.c \ + $(TOP)/src/tokenize.c \ + $(TOP)/src/trigger.c \ + $(TOP)/src/update.c \ diff --git a/meta-openembedded/meta-oe/recipes-dbs/sqlite/sqlite-2.8.17/sqlite.pc b/meta-openembedded/meta-oe/recipes-dbs/sqlite/sqlite-2.8.17/sqlite.pc new file mode 100644 index 0000000000..6bc742eecb --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/sqlite/sqlite-2.8.17/sqlite.pc @@ -0,0 +1,12 @@ +# Package Information for pkg-config + +prefix=/usr +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: SQLite +Description: SQL database engine +Version: 2.8.17 +Libs: -L${libdir} -lsqlite +Cflags: -I${includedir} diff --git a/meta-openembedded/meta-oe/recipes-dbs/sqlite/sqlite_2.8.17.bb b/meta-openembedded/meta-oe/recipes-dbs/sqlite/sqlite_2.8.17.bb new file mode 100644 index 0000000000..501c0e3e77 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-dbs/sqlite/sqlite_2.8.17.bb @@ -0,0 +1,61 @@ +SUMMARY = "An Embeddable SQL Database Engine" +HOMEPAGE = "http://www.sqlite.org/" +SECTION = "libs" +DEPENDS = "readline ncurses" +LICENSE = "PD" +LIC_FILES_CHKSUM = "file://src/main.c;beginline=1;endline=10;md5=e98469a8efa024a38ad5b2e4b92f4a96" + +PR = "r7" + +SRC_URI = "http://www.hwaci.com/sw/sqlite/sqlite-${PV}.tar.gz \ + file://mainmk_build_dynamic.patch \ + file://mainmk_no_tcl.patch \ + file://sqlite.pc \ + file://0001-shell.c-Fix-format-not-a-string-literal-warning.patch \ + " + +SOURCES = "attach.o auth.o btree.o btree_rb.o build.o copy.o date.o delete.o \ + expr.o func.o hash.o insert.o main.o opcodes.o os.o pager.o \ + parse.o pragma.o printf.o random.o select.o table.o tokenize.o \ + trigger.o update.o util.o vacuum.o vdbe.o vdbeaux.o where.o" + +inherit autotools pkgconfig + +do_configure() { + echo "main.mk is patched, no need to configure" + # make pkgconfig.bbclass pick this up + cp ${WORKDIR}/sqlite.pc ${S} +} + +do_compile() { + oe_runmake -f ${S}/Makefile.linux-gcc \ + TOP="${S}" \ + BCC="${BUILD_CC}" \ + TCC="${CC}" \ + OPTS="-fPIC -D'INTPTR_TYPE=int'" \ + TCL_FLAGS= LIBTCL= \ + READLINE_FLAGS="-DHAVE_READLINE=1 -I${STAGING_INCDIR}" \ + LIBREADLINE="-L. -L${STAGING_LIBDIR} -lreadline -lncurses" +} + +do_install() { + install -d ${D}${libdir} ${D}${bindir} + install sqlite ${D}${bindir} + install -m 0755 libsqlite.so ${D}${libdir}/libsqlite.so.0.8.6 + ln -sf libsqlite.so.0.8.6 ${D}${libdir}/libsqlite.so + ln -sf libsqlite.so.0.8.6 ${D}${libdir}/libsqlite.so.0 + ln -sf libsqlite.so.0.8.6 ${D}${libdir}/libsqlite.so.0.8 + install -d ${D}${includedir} + install -m 0644 sqlite.h ${D}${includedir}/sqlite.h + install -d ${D}${libdir}/pkgconfig + install -m 0644 ${S}/sqlite.pc ${D}${libdir}/pkgconfig/sqlite.pc +} + +PACKAGES += "${PN}-bin" +FILES_${PN}-bin = "${bindir}/*" +FILES_${PN} = "${libdir}/*.so.*" + +SRC_URI[md5sum] = "838dbac20b56d2c4292e98848505a05b" +SRC_URI[sha256sum] = "3f35ebfb67867fb5b583a03e480f900206af637efe7179b32294a6a0cf806f37" + +BBCLASSEXTEND = "native" |