Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions dep/build.sh
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions dep/rocketmq_amd64/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -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.
1 change: 1 addition & 0 deletions dep/rocketmq_amd64/DEBIAN/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ldconfig
18 changes: 18 additions & 0 deletions rpm/build.sh
Original file line number Diff line number Diff line change
@@ -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
54 changes: 54 additions & 0 deletions rpm/rocketmq_x64/CENTOS/rocketmq-client-cpp.spec
Original file line number Diff line number Diff line change
@@ -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}