diff options
author | Jiang Wenjiang <jiangwenjiang@huawei.com> | 2018-05-12 07:00:17 +0800 |
---|---|---|
committer | rainbow_0206 <jiangwenjiang@huawei.com> | 2018-05-22 14:47:52 +0800 |
commit | 48986193e80146241cba0a69577a9d831536300e (patch) | |
tree | cb8f9292c644c655c662775b51cd160a25c8fc55 /scripts | |
parent | 3a8b1b01c87ede23390657b906f14a49d89624f6 (diff) |
Generating dmm package by using rpm for centos
Add 'make pkg-rpm' in building script.
Change-Id: I09cd7019dbc8cfa2e4b9dd91597a11ac84de74b6
Signed-off-by: Jiang Wenjiang <jiangwenjiang@huawei.com>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/build.sh | 3 | ||||
-rw-r--r-- | scripts/dmm.spec | 45 | ||||
-rwxr-xr-x | scripts/generate_dmm_rpm.sh | 36 |
3 files changed, 84 insertions, 0 deletions
diff --git a/scripts/build.sh b/scripts/build.sh index d09df32..989d898 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -159,6 +159,9 @@ cd $BUILD_DIR rm -rf * cmake .. make -j 8 +if [ "$OS_ID" == "centos" ]; then + make pkg-rpm +fi ############### Preapre APP test directory echo -e "\e[41m Preapring APP test directory.....\e[0m" diff --git a/scripts/dmm.spec b/scripts/dmm.spec new file mode 100644 index 0000000..4869140 --- /dev/null +++ b/scripts/dmm.spec @@ -0,0 +1,45 @@ +Name: dmm +Version: 18.04 +Release: 1%{?dist} +Summary: DMM Project + +License: GPL +URL: https://gerrit.fd.io/r/dmm +Source: %{name}-%{version}.tar.gz + +%description +The DMM framework provides posix socket APIs to the application. A protocol +stack could be plugged into the DMM. DMM will choose the most suitable stack +for the application. + +%prep +%setup -q + + +%build +cd build/ +cmake .. +make -j 8 + +%install +cd ../../BUILDROOT +mkdir -p %{name}-%{version}-%{release}.x86_64/usr/bin +mkdir -p %{name}-%{version}-%{release}.x86_64/usr/lib64 + +install -c ../BUILD/%{name}-%{version}/release/bin/kc_common %{name}-%{version}-%{release}.x86_64/usr/bin +install -c ../BUILD/%{name}-%{version}/release/bin/ks_epoll %{name}-%{version}-%{release}.x86_64/usr/bin +install -c ../BUILD/%{name}-%{version}/release/bin/vc_common %{name}-%{version}-%{release}.x86_64/usr/bin +install -c ../BUILD/%{name}-%{version}/release/bin/vs_epoll %{name}-%{version}-%{release}.x86_64/usr/bin +install -c ../BUILD/%{name}-%{version}/release/bin/ks_select %{name}-%{version}-%{release}.x86_64/usr/bin +install -c ../BUILD/%{name}-%{version}/release/bin/vs_select %{name}-%{version}-%{release}.x86_64/usr/bin + +install -c ../BUILD/%{name}-%{version}/release/lib64/libdmm_api.a %{name}-%{version}-%{release}.x86_64/usr/lib64 +install -c ../BUILD/%{name}-%{version}/release/lib64/libnStackAPI.so %{name}-%{version}-%{release}.x86_64/usr/lib64 + +%files +/usr/bin/* +/usr/lib64/* +%doc + + +%changelog diff --git a/scripts/generate_dmm_rpm.sh b/scripts/generate_dmm_rpm.sh new file mode 100755 index 0000000..bce4580 --- /dev/null +++ b/scripts/generate_dmm_rpm.sh @@ -0,0 +1,36 @@ +######################################################################### +# +# Copyright (c) 2018 Huawei Technologies Co.,Ltd. +# 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: +# +# 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/sh + +cur_directory=${PWD} +name="dmm" +version="18.04" + +mkdir -p ~/rpmbuild/SOURCES + +cd ../ +git archive --format=tar.gz -o ~/rpmbuild/SOURCES/${name}-${version}.tar.gz --prefix=${name}-${version}/ master + +cd ~/rpmbuild/SOURCES +tar xzvf ${name}-${version}.tar.gz + +cp ${name}-${version}/scripts/dmm.spec ~/rpmbuild/SOURCES + +echo "generate the rpm package" +#QA_RPATHS=$[ 0x0002 ] is to shield the warning about rpath when generating the rpm package +QA_RPATHS=$[ 0x0002 ] rpmbuild -ba dmm.spec --define "_sourcedir ${PWD}" --define "%_rpmdir ${cur_directory}/../release/rpm" + +cd ${cur_directory} |