diff options
author | 2018-07-19 20:13:23 +0800 | |
---|---|---|
committer | 2018-07-26 11:29:42 +0000 | |
commit | 9d051a84fff2b23151b4addbcf204c21b22ed740 (patch) | |
tree | 78ac8e0fe5796dfede72cb2cf0db90fd051d2044 /scripts | |
parent | bc4785071529bcfe5bac2aea852c283f4f47f8f8 (diff) |
Feat: Deb package for ubuntu
Change-Id: Ic64808af9bb3b7af8f66f1c0a8d681d88b3724a3
Signed-off-by: rainbow_0206 <jiangwenjiang@huawei.com>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/build.sh | 2 | ||||
-rw-r--r-- | scripts/dmm.spec | 45 | ||||
-rwxr-xr-x | scripts/generate_dmm_deb.sh | 42 | ||||
-rwxr-xr-x | scripts/generate_dmm_rpm.sh | 2 |
4 files changed, 45 insertions, 46 deletions
diff --git a/scripts/build.sh b/scripts/build.sh index 5fc558f..0a5daf4 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -138,6 +138,8 @@ fi if [ "$OS_ID" == "centos" ]; then make pkg-rpm +elif [ "$OS_ID" == "ubuntu" ]; then + make pkg-deb fi #===========check running env ================= diff --git a/scripts/dmm.spec b/scripts/dmm.spec deleted file mode 100644 index 4869140..0000000 --- a/scripts/dmm.spec +++ /dev/null @@ -1,45 +0,0 @@ -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_deb.sh b/scripts/generate_dmm_deb.sh new file mode 100755 index 0000000..5168d07 --- /dev/null +++ b/scripts/generate_dmm_deb.sh @@ -0,0 +1,42 @@ +######################################################################### +# +# 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} + +mkdir -p /tmp/mkdeb +mkdir -p /tmp/mkdeb/DEBIAN +mkdir -p /tmp/mkdeb/usr/bin +mkdir -p /tmp/mkdeb/usr/lib + +cd ../ +git archive --format=tar.gz -o /tmp/dmm.tar.gz --prefix=dmm/ HEAD + +cd /tmp/ +tar xzvf dmm.tar.gz +cd dmm/build +cmake .. +make -j 8 + +cd ../ +cp -f release/bin/* /tmp/mkdeb/usr/bin +cp -f release/lib64/* /tmp/mkdeb/usr/lib +cp -f pkg/deb/control /tmp/mkdeb/DEBIAN/ + +cd /tmp/ +dpkg-deb -b mkdeb/ ${cur_directory}/../release/deb/dmm.deb + +cd ${cur_directory} diff --git a/scripts/generate_dmm_rpm.sh b/scripts/generate_dmm_rpm.sh index 711f475..792c2a3 100755 --- a/scripts/generate_dmm_rpm.sh +++ b/scripts/generate_dmm_rpm.sh @@ -27,7 +27,7 @@ git archive --format=tar.gz -o ~/rpmbuild/SOURCES/${name}-${version}.tar.gz --pr cd ~/rpmbuild/SOURCES tar xzvf ${name}-${version}.tar.gz -cp ${name}-${version}/scripts/dmm.spec ~/rpmbuild/SOURCES +cp ${name}-${version}/pkg/rpm/dmm.spec ~/rpmbuild/SOURCES echo "generate the rpm package" #QA_RPATHS=$[ 0x0002 ] is to shield the warning about rpath when generating the rpm package |