rocketmq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ding...@apache.org
Subject [rocketmq-client-cpp] branch master updated: feat(package): add rpm build and dpkg build script (#238)
Date Wed, 12 Feb 2020 12:02:41 GMT
This is an automated email from the ASF dual-hosted git repository.

dinglei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-client-cpp.git


The following commit(s) were added to refs/heads/master by this push:
     new 0648508  feat(package): add rpm build and dpkg build script (#238)
0648508 is described below

commit 0648508099f87194ae23ff8047850815d06d62df
Author: dinglei <libya_003@163.com>
AuthorDate: Wed Feb 12 20:02:30 2020 +0800

    feat(package): add rpm build and dpkg build script (#238)
    
    * feat(package): add dpkg package script
---
 dep/build.sh                                     | 15 +++++++
 dep/rocketmq_amd64/DEBIAN/control                |  8 ++++
 dep/rocketmq_amd64/DEBIAN/postinst               |  1 +
 rpm/build.sh                                     | 18 ++++++++
 rpm/rocketmq_x64/CENTOS/rocketmq-client-cpp.spec | 54 ++++++++++++++++++++++++
 5 files changed, 96 insertions(+)

diff --git a/dep/build.sh b/dep/build.sh
new file mode 100644
index 0000000..290c9b4
--- /dev/null
+++ b/dep/build.sh
@@ -0,0 +1,15 @@
+BASEDIR=$(dirname "$0")
+if [[ ! -d ${BASEDIR}/rocketmq_amd64/usr/local/include/ ]]; then
+    mkdir -p ${BASEDIR}/rocketmq_amd64/usr/local/include/
+fi
+
+if [[ ! -d ${BASEDIR}/rocketmq_amd64/usr/local/lib ]]; then
+    mkdir -p ${BASEDIR}/rocketmq_amd64/usr/local/lib
+fi
+
+cp -R ${BASEDIR}/../include/*              ${BASEDIR}/rocketmq_amd64/usr/local/include/
+cp ${BASEDIR}/../bin/librocketmq.so      ${BASEDIR}/rocketmq_amd64/usr/local/lib/
+cp ${BASEDIR}/../bin/librocketmq.a      ${BASEDIR}/rocketmq_amd64/usr/local/lib/
+
+VERSION=`cat ${BASEDIR}/rocketmq_amd64/DEBIAN/control | grep Version | awk -F ':' '{print
$2}'| sed 's/^ *//'`
+dpkg-deb --build ${BASEDIR}/rocketmq_amd64 rocketmq_${VERSION}_amd64.deb
diff --git a/dep/rocketmq_amd64/DEBIAN/control b/dep/rocketmq_amd64/DEBIAN/control
new file mode 100644
index 0000000..b1fe918
--- /dev/null
+++ b/dep/rocketmq_amd64/DEBIAN/control
@@ -0,0 +1,8 @@
+Package: RocketMQ
+Version: 1.2.5
+Architecture: amd64
+Essential: no
+Priority: optional
+Depends: 
+Maintainer: "Apache RocketMQ" <dev@rocketmq.apache.org>
+Description: This package is C++ client of Apache RocketMQ for debian and its derivertives
like Ubuntu.
diff --git a/dep/rocketmq_amd64/DEBIAN/postinst b/dep/rocketmq_amd64/DEBIAN/postinst
new file mode 100755
index 0000000..aea3041
--- /dev/null
+++ b/dep/rocketmq_amd64/DEBIAN/postinst
@@ -0,0 +1 @@
+ldconfig
\ No newline at end of file
diff --git a/rpm/build.sh b/rpm/build.sh
new file mode 100644
index 0000000..d87b584
--- /dev/null
+++ b/rpm/build.sh
@@ -0,0 +1,18 @@
+BASEDIR=$(dirname "$0")
+if [[ ! -d ${BASEDIR}/rocketmq_x64/CENTOS/ ]]; then
+    echo "Can not find SPEC FILE"
+    exit 1
+fi
+if [[ ! -d /root/rpmbuild/SOURCES/rocketmq/include ]]; then
+    mkdir -p /root/rpmbuild/SOURCES/rocketmq
+    mkdir -p /root/rpmbuild/SOURCES/rocketmq/include
+    mkdir -p /root/rpmbuild/SOURCES/rocketmq/bin
+fi
+cp -R ${BASEDIR}/../include/*              /root/rpmbuild/SOURCES/rocketmq/include
+cp ${BASEDIR}/../bin/librocketmq.so      /root/rpmbuild/SOURCES/rocketmq/bin
+cp ${BASEDIR}/../bin/librocketmq.a      /root/rpmbuild/SOURCES/rocketmq/bin
+cp ${BASEDIR}/rocketmq_x64/CENTOS/rocketmq-client-cpp.spec      /root/rpmbuild/SPECS
+
+rpmbuild -bb /root/rpmbuild/SPECS/rocketmq-client-cpp.spec
+
+cp /root/rpmbuild/RPMS/*.rpm ${BASEDIR}/rocketmq_x64
\ No newline at end of file
diff --git a/rpm/rocketmq_x64/CENTOS/rocketmq-client-cpp.spec b/rpm/rocketmq_x64/CENTOS/rocketmq-client-cpp.spec
new file mode 100644
index 0000000..9dab148
--- /dev/null
+++ b/rpm/rocketmq_x64/CENTOS/rocketmq-client-cpp.spec
@@ -0,0 +1,54 @@
+
+Summary: A C++ Client of Apache RocketMQ
+
+Name: rocketmq-client-cpp
+Version: 1.2.5
+Release: centos
+Group: Apache
+License: APLv2
+Source: https://github.com/apache/rocketmq-client-cpp
+URL: http://rocketmq.apache.org/
+Distribution: Linux
+
+%define _prefix /usr/local
+
+AutoReqProv: no
+
+%description
+A C++ Client of Apache RocketMQ
+
+%prep
+
+pwd
+
+cat /etc/redhat-release|sed -r 's/.* ([0-9]+)\..*/\1/'
+
+OS_VERSION=`cat /etc/redhat-release|sed -r 's/.* ([0-9]+)\..*/\1/'`
+
+echo "OS_VERSION=${OS_VERSION}"
+
+
+%build
+
+%install
+# create dirs
+mkdir -p $RPM_BUILD_ROOT%{_prefix}
+
+# create dirs
+mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib
+mkdir -p $RPM_BUILD_ROOT%{_prefix}/include/rocketmq
+
+# copy files
+cp -f ${RPM_SOURCE_DIR}/rocketmq/bin/librocketmq.so     $RPM_BUILD_ROOT%{_prefix}/lib
+cp -f ${RPM_SOURCE_DIR}/rocketmq/bin/librocketmq.a     $RPM_BUILD_ROOT%{_prefix}/lib
+cp -rf ${RPM_SOURCE_DIR}/rocketmq/include/*             $RPM_BUILD_ROOT%{_prefix}/include/rocketmq
+
+# package information
+%files
+# set file attribute here
+%defattr(-, root, root, 0755)
+%{_prefix}/lib
+%{_prefix}/include
+
+%define debug_package %{nil}
+%define __os_install_post %{nil}


Mime
View raw message