You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tubemq.apache.org by go...@apache.org on 2020/10/14 03:25:00 UTC

[incubator-tubemq] branch master updated: [TUBEMQ-369]hope to add an option in the compilation script (like `make lib` etc...), to quick generation of dynamic / static libraries and header files (#285)

This is an automated email from the ASF dual-hosted git repository.

gosonzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tubemq.git


The following commit(s) were added to refs/heads/master by this push:
     new c208153  [TUBEMQ-369]hope to add an option in the compilation script (like `make lib` etc...), to quick generation of dynamic / static libraries and header files (#285)
c208153 is described below

commit c208153d07dbb153d6b1ae03445c11fb3ee4a29f
Author: gosonzhang <46...@qq.com>
AuthorDate: Wed Oct 14 11:15:28 2020 +0800

    [TUBEMQ-369]hope to add an option in the compilation script (like `make lib` etc...), to quick generation of dynamic / static libraries and header files (#285)
    
    Co-authored-by: gosonzhang <go...@tencent.com>
---
 tubemq-client-twins/tubemq-client-cpp/README.md    |  3 ++
 .../tubemq-client-cpp/conf/client.conf             | 27 ++++++++++
 .../tubemq-client-cpp/release/release_linux.sh     | 60 ++++++++++++++++++++++
 .../tubemq-client-cpp/third_party/CMakeLists.txt   |  4 +-
 4 files changed, 91 insertions(+), 3 deletions(-)

diff --git a/tubemq-client-twins/tubemq-client-cpp/README.md b/tubemq-client-twins/tubemq-client-cpp/README.md
index c2c1960..fe41050 100644
--- a/tubemq-client-twins/tubemq-client-cpp/README.md
+++ b/tubemq-client-twins/tubemq-client-cpp/README.md
@@ -33,5 +33,8 @@
 ## Step to build
   * install protobuf
   * ./build_linux.sh
+  * cd release/
+  * chmod +x release_linux.sh
+  * ./release_linux.sh
 
 
diff --git a/tubemq-client-twins/tubemq-client-cpp/conf/client.conf b/tubemq-client-twins/tubemq-client-cpp/conf/client.conf
new file mode 100644
index 0000000..018dd5e
--- /dev/null
+++ b/tubemq-client-twins/tubemq-client-cpp/conf/client.conf
@@ -0,0 +1,27 @@
+;
+; Tencent is pleased to support the open source community by making TubeMQ available.
+;
+; Copyright (C) 2012-2019 Tencent. All Rights Reserved.
+;
+; Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+; this file except in compliance with the License. You may obtain a copy of the
+; License at
+;
+; https://opensource.org/licenses/Apache-2.0
+;
+; Unless required by applicable law or agreed to in writing, software
+; distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+; WARRANTIES OF ANY KIND, either express or implied.  See the License for the
+; specific language governing permissions and limitations under the License.
+;
+
+[TubeMQ]
+//unit M
+log_size=100
+// 0:trace, 1:debug, 2:info, 3:warn, 4:error
+log_level=2
+// max log file count
+log_num=10
+// need include log filename
+log_path=../log/tubemq
+
diff --git a/tubemq-client-twins/tubemq-client-cpp/release/release_linux.sh b/tubemq-client-twins/tubemq-client-cpp/release/release_linux.sh
new file mode 100644
index 0000000..13a45e6
--- /dev/null
+++ b/tubemq-client-twins/tubemq-client-cpp/release/release_linux.sh
@@ -0,0 +1,60 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+
+#!/bin/bash
+
+rm tubemq -rf
+rm lib -rf
+rm *.tar.gz
+
+mkdir tubemq
+mkdir tubemq/lib
+mkdir tubemq/include
+mkdir tubemq/conf
+mkdir tubemq/demo
+mkdir lib
+
+cp ../build/src/libtubemq.a lib/
+cp ../build/third_party/lib/liblog4cplus.a lib/
+cp ../build/third_party/lib64/libsnappy.a lib/
+cp ../build/proto/libtubemq_proto.a lib/
+cp /usr/local/lib/libprotobuf.a lib/
+cp -rf ../include/*  tubemq/include/
+cp ../conf/* tubemq/conf/
+cp ../example/consumer/test_consumer.cc tubemq/demo/
+cd lib
+for file in *.a
+do
+    echo "ar x "$file
+    ar x $file
+done
+ar cru libtubemq_rel.a *.o
+ranlib libtubemq_rel.a
+rm *.o
+mv libtubemq_rel.a ../tubemq/lib/
+cd ..
+
+cd tubemq/demo
+g++ -g -std=c++11 -c test_consumer.cc -I../include/
+#g++ -g -std=c++11 -o test_consumer test_consumer.o -L../lib/  -ltubemq -ltubemq_proto -lssl -lcrypto -lpthread -lprotobuf -llog4cplus -lsnappy -lrt
+g++ -g -std=c++11 -o test_consumer test_consumer.o -L../lib/  -ltubemq_rel -lssl -lcrypto -lpthread -lrt
+rm *.o
+cd -
+tar -czvf tubemq.tar.gz tubemq/
diff --git a/tubemq-client-twins/tubemq-client-cpp/third_party/CMakeLists.txt b/tubemq-client-twins/tubemq-client-cpp/third_party/CMakeLists.txt
index c223f9b..8f689f5 100644
--- a/tubemq-client-twins/tubemq-client-cpp/third_party/CMakeLists.txt
+++ b/tubemq-client-twins/tubemq-client-cpp/third_party/CMakeLists.txt
@@ -9,9 +9,7 @@ include(ExternalProject)
 ExternalProject_Add(
     rapidjson
     PREFIX "rapidjson"
-    GIT_REPOSITORY "https://github.com/Tencent/rapidjson.git"
-    GIT_TAG f54b0e47a08782a6131cc3d60f94d038fa6e0a51
-    TIMEOUT 20
+    URL "https://github.com/Tencent/rapidjson/archive/v1.1.0.tar.gz"
     CMAKE_ARGS
     -DRAPIDJSON_BUILD_TESTS=OFF
     -DRAPIDJSON_BUILD_DOC=OFF