Soft Patch Panel
 help / color / mirror / Atom feed
From: x-fn-spp@sl.ntt-tx.co.jp
To: ferruh.yigit@intel.com, yasufum.o@gmail.com
Cc: spp@dpdk.org
Subject: [spp] [PATCH 2/2] docs: introduce RPM package support
Date: Mon, 16 Dec 2019 18:17:18 +0900	[thread overview]
Message-ID: <201912160917.xBG9HHFK022915@imss04.silk.ntt-tx.co.jp> (raw)
In-Reply-To: <20191216091718.27178-1-x-fn-spp@sl.ntt-tx.co.jp>

From: Hideyuki Yamashita <yamashita.hideyuki@po.ntt-tx.co.jp>

This update is to add RPM SPEC files for CentOS distro. RPM packages of
DPDK and SPP are built from the spec files in `spp/rpmbuild/SPECS`
directory. Because of dependencies, DPDK should be installed with
this package before SPP.

RPM file is built after installing required packages as following.

  $ rpmbuild -ba --define="_topdir /path/to/spp" SPECS/dpdk.spec

Signed-off-by: Hideyuki Yamashita <yamashita.hideyuki@po.ntt-tx.co.jp>
Signed-off-by: Naoki Takada <ntakada14@gmail.com>
---
 rpmbuild/SPECS/spp.spec | 222 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 222 insertions(+)
 create mode 100644 rpmbuild/SPECS/spp.spec

diff --git a/rpmbuild/SPECS/spp.spec b/rpmbuild/SPECS/spp.spec
new file mode 100644
index 0000000..05570dc
--- /dev/null
+++ b/rpmbuild/SPECS/spp.spec
@@ -0,0 +1,222 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2019 Nippon Telegraph and Telephone Corporation
+
+##################################################
+# Basic information
+##################################################
+Summary: Soft Patch Panel (SPP) is a DPDK app for Service Function Chaining in NFV
+Name: spp
+Version: 18.08.4
+Release: 1
+License: BSD-3-Clause
+URL: http://git.dpdk.org/apps/spp/
+Source: http://git.dpdk.org/apps/spp/snapshot/%{name}-%{version}.tar.gz
+Group: Applications/File
+Prefix: %{_prefix}
+
+##################################################
+# Requires
+##################################################
+BuildRequires: python36 python36-pip python-devel python-six libpcap-devel lz4-devel wireshark-devel
+BuildRequires: inkscape texlive-latex latexmk
+BuildRequires: dpdk-devel
+
+Requires: lz4 libpcap wireshark python36 python36-pip
+Requires: lz4-devel libpcap-devel wireshark-devel libX11-devel
+Requires: dpdk
+
+##################################################
+# Description
+##################################################
+%description
+Soft Patch Panel (SPP) is a DPDK application for providing
+switching functionality for Service Function Chaining in NFV
+(Network Function Virtualization).
+
+##################################################
+# Define
+##################################################
+# Points to the DPDK installation and target env directory
+%define RTE_SDK                 /usr/share/dpdk
+%define RTE_TARGET              x86_64-native-linuxapp-gcc
+
+# Installation path
+%define INS                     /opt/spp
+%define INS_DOC                 /usr/share/doc/spp
+%define INS_LINK                /usr/bin
+
+# Source directory
+%define SRC                     src
+
+# SPP tools directory
+%define TOOLS                   tools
+%define HELPS                   %{TOOLS}/helpers
+
+# Document path
+%define DOC_TREE                docs/guides/_build/doctrees
+%define DOC_HTML                docs/guides/_build/html
+%define DOC_LATEX               docs/guides/_build/latex
+
+# SPP's licence directory
+%define LICENSE                 license
+
+# `%{buildroot}` is expanded into `rpmbuild/BUILDROOT` as default.
+
+# Binary path
+%define CLI                     cli
+%define CTL                     spp-ctl
+%define PRI                     primary/%{RTE_TARGET}
+%define VF_PATH                 vf/%{RTE_TARGET}
+%define NFV                     nfv/%{RTE_TARGET}
+%define MIR                     mirror/%{RTE_TARGET}
+%define PCAP                    pcap/%{RTE_TARGET}
+
+# Python path
+%define PYTHON /usr/lib64/python3.6:/usr/lib64/python3.6/lib-dynload:/usr/local/lib64/python3.6/site-packages:/usr/local/lib/python3.6/site-packages:/usr/lib64/python3.6/site-packages:/usr/lib/python3.6/site-packages
+
+##################################################
+# prep section
+##################################################
+%prep
+%setup -q
+
+##################################################
+# build section
+##################################################
+%build
+export RTE_SDK=%{RTE_SDK}
+export RTE_RTE_TARGET=%{RTE_TARGET}
+export PYTHONPATH=%{PYTHON}
+make
+make doc-all
+
+##################################################
+# install section
+##################################################
+%install
+# Clearn up
+rm -rf %{buildroot}
+
+# Make install directory
+mkdir -p %{buildroot}%{INS}
+mkdir -p %{buildroot}%{INS}/%{LICENSE}
+mkdir -p %{buildroot}%{INS}/%{HELPS}
+mkdir -p %{buildroot}%{INS}/bin
+mkdir -p %{buildroot}%{INS}/bin/%{PRI}
+mkdir -p %{buildroot}%{INS}/bin/%{VF_PATH}
+mkdir -p %{buildroot}%{INS}/bin/%{NFV}
+mkdir -p %{buildroot}%{INS}/bin/%{MIR}
+mkdir -p %{buildroot}%{INS}/bin/%{PCAP}
+mkdir -p %{buildroot}%{INS_DOC}
+mkdir -p %{buildroot}%{INS_LINK}
+
+# File copy
+cp README.md                                %{buildroot}%{INS}
+cp requirements.txt                         %{buildroot}%{INS}
+cp CONTRIBUTING.txt                         %{buildroot}%{INS}
+
+# License copy
+cp %{LICENSE}/*                             %{buildroot}%{INS}/%{LICENSE}/
+
+# Execute file copy
+cp -r %{SRC}/%{CLI}                         %{buildroot}%{INS}/bin
+cp -r %{SRC}/%{CTL}                         %{buildroot}%{INS}/bin
+cp %{SRC}/spp.py                            %{buildroot}%{INS}/bin
+cp %{SRC}/%{PRI}/app/spp_primary            %{buildroot}%{INS}/bin/%{PRI}
+cp %{SRC}/%{VF_PATH}/app/spp_vf             %{buildroot}%{INS}/bin/%{VF_PATH}
+cp %{SRC}/%{NFV}/app/spp_nfv                %{buildroot}%{INS}/bin/%{NFV}
+cp %{SRC}/%{MIR}/app/spp_mirror             %{buildroot}%{INS}/bin/%{MIR}
+cp %{SRC}/%{PCAP}/app/spp_pcap              %{buildroot}%{INS}/bin/%{PCAP}
+cp %{HELPS}/sec_launcher.py                 %{buildroot}%{INS}/%{HELPS}
+
+# Document file copy
+cp -r %{DOC_TREE}                           %{buildroot}%{INS_DOC}
+cp -r %{DOC_HTML}                           %{buildroot}%{INS_DOC}
+cp -r %{DOC_LATEX}                          %{buildroot}%{INS_DOC}
+
+# Create symbolic link
+ln -sf %{INS}/bin/spp.py                    %{buildroot}%{INS_LINK}/spp
+ln -sf %{INS}/bin/%{CTL}/spp-ctl            %{buildroot}%{INS_LINK}/spp-ctl
+ln -sf %{INS}/bin/%{PRI}/spp_primary        %{buildroot}%{INS_LINK}/spp_primary
+ln -sf %{INS}/bin/%{VF_PATH}/spp_vf         %{buildroot}%{INS_LINK}/spp_vf
+ln -sf %{INS}/bin/%{NFV}/spp_nfv            %{buildroot}%{INS_LINK}/spp_nfv
+ln -sf %{INS}/bin/%{MIR}/spp_mirror         %{buildroot}%{INS_LINK}/spp_mirror
+ln -sf %{INS}/bin/%{PCAP}/spp_pcap          %{buildroot}%{INS_LINK}/spp_pcap
+
+
+##################################################
+# post section
+##################################################
+%post
+# python package install
+pip3 install -r %{INS}/requirements.txt
+
+##################################################
+# clean section
+##################################################
+%clean
+rm -rf %{buildroot}
+
+##################################################
+# files section
+##################################################
+%files
+# Executable files
+%dir %{INS}
+%dir %{INS}/bin
+%dir %attr(777,root,root) %{INS}/bin/%{CLI}
+%dir %{INS}/bin/%{CTL}
+%dir %{INS}/bin/primary
+%dir %{INS}/bin/primary/%{RTE_TARGET}
+%dir %{INS}/bin/vf
+%dir %{INS}/bin/vf/%{RTE_TARGET}
+%dir %{INS}/bin/nfv
+%dir %{INS}/bin/nfv/%{RTE_TARGET}
+%dir %{INS}/bin/mirror
+%dir %{INS}/bin/mirror/%{RTE_TARGET}
+%dir %{INS}/bin/pcap
+%dir %{INS}/bin/pcap/%{RTE_TARGET}
+%attr(755,root,root) %{INS}/bin/spp.py
+%attr(755,root,root) %{INS}/bin/%{CTL}/spp-ctl
+%attr(744,root,root) %{INS}/bin/%{PRI}/spp_primary
+%attr(744,root,root) %{INS}/bin/%{VF_PATH}/spp_vf
+%attr(744,root,root) %{INS}/bin/%{NFV}/spp_nfv
+%attr(744,root,root) %{INS}/bin/%{MIR}/spp_mirror
+%attr(744,root,root) %{INS}/bin/%{PCAP}/spp_pcap
+%{INS}/bin/%{CLI}/*
+%{INS}/bin/%{CTL}/*.py
+%{INS}/%{TOOLS}
+%{INS}/%{HELPS}
+%{INS}/%{LICENSE}
+
+#Symbolic link files
+%{INS_LINK}/spp
+%{INS_LINK}/spp-ctl
+%{INS_LINK}/spp_primary
+%{INS_LINK}/spp_vf
+%{INS_LINK}/spp_nfv
+%{INS_LINK}/spp_mirror
+%{INS_LINK}/spp_pcap
+
+# Doc files
+%doc %{INS}/README.md
+%doc %{INS}/requirements.txt
+%doc %{INS}/CONTRIBUTING.txt
+%doc %{INS_DOC}
+
+##################################################
+# preun section
+##################################################
+%preun
+if [ -e %{INS} ]; then
+    # delete log file
+    find %{INS} -name "*.log" | xargs --no-run-if-empty rm
+
+    if [ -d %{INS}/bin/%{CLI}/log/ ]; then
+        rmdir %{INS}/bin/%{CLI}/log/
+    fi
+
+    # delete python cache
+    find %{INS} -name "*.pyc" | xargs --no-run-if-empty rm
+    find %{INS} -name "__pycache__" | xargs --no-run-if-empty rmdir
+fi
-- 
2.17.1


      parent reply	other threads:[~2019-12-16  9:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20191216091718.27178-1-x-fn-spp@sl.ntt-tx.co.jp>
2019-12-16  9:17 ` [spp] [PATCH 1/2] docs: add RPM installation for DPDK and SPP x-fn-spp
2019-12-16  9:17 ` x-fn-spp [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201912160917.xBG9HHFK022915@imss04.silk.ntt-tx.co.jp \
    --to=x-fn-spp@sl.ntt-tx.co.jp \
    --cc=ferruh.yigit@intel.com \
    --cc=spp@dpdk.org \
    --cc=yasufum.o@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).