diff options
-rw-r--r-- | CMakeLists.txt | 5 | ||||
-rw-r--r-- | pkg/deb/control | 13 | ||||
-rw-r--r-- | pkg/rpm/dmm.spec (renamed from scripts/dmm.spec) | 3 | ||||
-rwxr-xr-x | scripts/build.sh | 2 | ||||
-rwxr-xr-x | scripts/generate_dmm_deb.sh | 42 | ||||
-rwxr-xr-x | scripts/generate_dmm_rpm.sh | 2 |
6 files changed, 66 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index fbf5f4d..adb0670 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,6 +30,9 @@ SET(DMM_REL_INC_DIR ${CMAKE_CURRENT_LIST_DIR}/release/include) SET(GENERATE_RPM_PATH ${CMAKE_CURRENT_LIST_DIR}/release/rpm) file(MAKE_DIRECTORY ${GENERATE_RPM_PATH}) +SET(GENERATE_DEB_PATH ${CMAKE_CURRENT_LIST_DIR}/release/deb) +file(MAKE_DIRECTORY ${GENERATE_DEB_PATH}) + MESSAGE(STATUS "Top dir is: " ${CMAKE_CURRENT_LIST_DIR}) MESSAGE(STATUS "Static library dir: " ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}) MESSAGE(STATUS "Executable binary dir: " ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) @@ -108,6 +111,8 @@ ADD_DEPENDENCIES(DPDK dmm_api) ADD_CUSTOM_TARGET(pkg-rpm COMMAND sh ../scripts/generate_dmm_rpm.sh) +ADD_CUSTOM_TARGET(pkg-deb COMMAND sh ../scripts/generate_dmm_deb.sh) + ADD_CUSTOM_TARGET(clean-all COMMAND ${CMAKE_BUILD_TOOL} clean COMMAND sh clean_compile.sh) diff --git a/pkg/deb/control b/pkg/deb/control new file mode 100644 index 0000000..c220c72 --- /dev/null +++ b/pkg/deb/control @@ -0,0 +1,13 @@ +Package: dmm +Version: 18.04 +Section: tuils +Priority: optional +Depends: libc6, libstdc++6, libgcc1 +Suggests: +Architecture: amd64 +Installed-Size: +Maintainer: jorth +Original-Maintainer: +Provides: +Description: DMM is a framework for protocol stack. +Homepage: https://gerrit.fd.io/r/dmm diff --git a/scripts/dmm.spec b/pkg/rpm/dmm.spec index 4869140..1022523 100644 --- a/scripts/dmm.spec +++ b/pkg/rpm/dmm.spec @@ -7,6 +7,9 @@ License: GPL URL: https://gerrit.fd.io/r/dmm Source: %{name}-%{version}.tar.gz +BuildRequires: glibc, libstdc++, libgcc, numactl-libs +BuildRequires: dpdk >= 18.02, dpdk-devel >= 18.02 + %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 diff --git a/scripts/build.sh b/scripts/build.sh index db355fd..0fa8af2 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -143,6 +143,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/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 |