-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(package): add rpm build and dpkg build script (#238)
* feat(package): add dpkg package script
- Loading branch information
1 parent
8a6b3bd
commit 0648508
Showing
5 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" <[email protected]> | ||
Description: This package is C++ client of Apache RocketMQ for debian and its derivertives like Ubuntu. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ldconfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} |