File tree Expand file tree Collapse file tree 5 files changed +96
-0
lines changed Expand file tree Collapse file tree 5 files changed +96
-0
lines changed Original file line number Diff line number Diff line change
1
+ BASEDIR=$( dirname " $0 " )
2
+ if [[ ! -d ${BASEDIR} /rocketmq_amd64/usr/local/include/ ]]; then
3
+ mkdir -p ${BASEDIR} /rocketmq_amd64/usr/local/include/
4
+ fi
5
+
6
+ if [[ ! -d ${BASEDIR} /rocketmq_amd64/usr/local/lib ]]; then
7
+ mkdir -p ${BASEDIR} /rocketmq_amd64/usr/local/lib
8
+ fi
9
+
10
+ cp -R ${BASEDIR} /../include/* ${BASEDIR} /rocketmq_amd64/usr/local/include/
11
+ cp ${BASEDIR} /../bin/librocketmq.so ${BASEDIR} /rocketmq_amd64/usr/local/lib/
12
+ cp ${BASEDIR} /../bin/librocketmq.a ${BASEDIR} /rocketmq_amd64/usr/local/lib/
13
+
14
+ VERSION=` cat ${BASEDIR} /rocketmq_amd64/DEBIAN/control | grep Version | awk -F ' :' ' {print $2}' | sed ' s/^ *//' `
15
+ dpkg-deb --build ${BASEDIR} /rocketmq_amd64 rocketmq_${VERSION} _amd64.deb
Original file line number Diff line number Diff line change
1
+ Package: RocketMQ
2
+ Version: 1.2.5
3
+ Architecture: amd64
4
+ Essential: no
5
+ Priority: optional
6
+ Depends:
7
+ Maintainer: "Apache RocketMQ" <dev@rocketmq.apache.org>
8
+ Description: This package is C++ client of Apache RocketMQ for debian and its derivertives like Ubuntu.
Original file line number Diff line number Diff line change
1
+ ldconfig
Original file line number Diff line number Diff line change
1
+ BASEDIR=$( dirname " $0 " )
2
+ if [[ ! -d ${BASEDIR} /rocketmq_x64/CENTOS/ ]]; then
3
+ echo " Can not find SPEC FILE"
4
+ exit 1
5
+ fi
6
+ if [[ ! -d /root/rpmbuild/SOURCES/rocketmq/include ]]; then
7
+ mkdir -p /root/rpmbuild/SOURCES/rocketmq
8
+ mkdir -p /root/rpmbuild/SOURCES/rocketmq/include
9
+ mkdir -p /root/rpmbuild/SOURCES/rocketmq/bin
10
+ fi
11
+ cp -R ${BASEDIR} /../include/* /root/rpmbuild/SOURCES/rocketmq/include
12
+ cp ${BASEDIR} /../bin/librocketmq.so /root/rpmbuild/SOURCES/rocketmq/bin
13
+ cp ${BASEDIR} /../bin/librocketmq.a /root/rpmbuild/SOURCES/rocketmq/bin
14
+ cp ${BASEDIR} /rocketmq_x64/CENTOS/rocketmq-client-cpp.spec /root/rpmbuild/SPECS
15
+
16
+ rpmbuild -bb /root/rpmbuild/SPECS/rocketmq-client-cpp.spec
17
+
18
+ cp /root/rpmbuild/RPMS/* .rpm ${BASEDIR} /rocketmq_x64
Original file line number Diff line number Diff line change
1
+
2
+ Summary: A C++ Client of Apache RocketMQ
3
+
4
+ Name: rocketmq-client-cpp
5
+ Version: 1.2.5
6
+ Release: centos
7
+ Group: Apache
8
+ License: APLv2
9
+ Source: https://github.com/apache/rocketmq-client-cpp
10
+ URL: http://rocketmq.apache.org/
11
+ Distribution: Linux
12
+
13
+ %define _prefix /usr/local
14
+
15
+ AutoReqProv: no
16
+
17
+ %description
18
+ A C++ Client of Apache RocketMQ
19
+
20
+ %prep
21
+
22
+ pwd
23
+
24
+ cat /etc/redhat-release|sed -r 's/.* ([0-9]+)\..*/\1/'
25
+
26
+ OS_VERSION= `cat /etc/redhat-release|sed -r 's/.* ([0-9]+)\..*/\1/'`
27
+
28
+ echo "OS_VERSION= ${OS_VERSION}"
29
+
30
+
31
+ %build
32
+
33
+ %install
34
+ # create dirs
35
+ mkdir -p $RPM_BUILD_ROOT %{_prefix }
36
+
37
+ # create dirs
38
+ mkdir -p $RPM_BUILD_ROOT%{_prefix }/lib
39
+ mkdir -p $RPM_BUILD_ROOT%{_prefix }/include/rocketmq
40
+
41
+ # copy files
42
+ cp -f ${RPM_SOURCE_DIR}/rocketmq/bin/librocketmq.so $RPM_BUILD_ROOT%{_prefix }/lib
43
+ cp -f ${RPM_SOURCE_DIR}/rocketmq/bin/librocketmq.a $RPM_BUILD_ROOT%{_prefix }/lib
44
+ cp -rf ${RPM_SOURCE_DIR}/rocketmq/include/* $RPM_BUILD_ROOT%{_prefix }/include/rocketmq
45
+
46
+ # package information
47
+ %files
48
+ # set file attribute here
49
+ %defattr(-, root, root, 0755)
50
+ %{_prefix }/lib
51
+ %{_prefix }/include
52
+
53
+ %define debug_package %{nil }
54
+ %define __os_install_post %{nil }
You can’t perform that action at this time.
0 commit comments