54 Commits

Author SHA1 Message Date
Ian Wells
0325c021f4 papi: Revert vpp-api-python to py2, add py3 pkg
A previous commit, ca3d38ae18c21ce37212f0d5d5f4a1702429e70c, converts
the vpp-api-python package from a python2 library to a python3 one.
This changes the behaviour of the package and breaks anything that
uses it as a dependency.

This change reverts the package behaviour to a python2 package, and
additionally adds a *separate* python3 package for correct python3
behaviour.

Type: fix
Fixes: VPP-1738
Signed-Off-By: Ian Wells <iawells@cisco.com>
Change-Id: I54eb45156eb6e00fc4cd5b48e7a0aa17fd2f43f7
Signed-off-by: Dave Barach <dave@barachs.net>
(cherry picked from commit 13cef0cc2cba4cff22bb5a860a8709cb3cfd35b2)
2019-08-13 08:04:41 +00:00
Benoît Ganne
6d72c175ed docs: how to enable coredump with systemd
Type: docs

Change-Id: I1f657389fec716cc6cdc942803e65f861ffea5f5
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-07-12 01:51:59 +00:00
Benoît Ganne
f0917bd5a7 rpm: VPP-1674: exclude external headers from rpm
External libraries headers such as DPDK, libibverb, quicly, etc. should
not be packaged in vpp-dev RPM.
Only package headers from vpp/ and vom/ subdirs.

Change-Id: Ief1454bd1261c8cf4dcd3b105e28f6852439e896
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-05-23 16:31:27 +02:00
Thomas F Herbert
ca3d38ae18 Freshen RPM dependencies in vpp specfile.
VPP-1650

Also update specfile for fedora. Also update and
rationalize python3 and python2 dependencies
for CentOS.

Change-Id: Ia87abfe7b7080ecd07e485e6c32270fda56a496a
Signed-off-by: Thomas F Herbert <therbert@redhat.com>
2019-05-01 18:58:33 +00:00
Matthew Smith
4ed003958f rpm: set exec bits on plugins
Install plugin shared libraries with permissions set to 0755
instead of 0644 during RPM builds.

When building with rpmbuild, if a compiled file is not executable,
it's source files and symbols are not included in the vpp-debuginfo RPM.
This makes debugging problems with DPDK (and other plugins probably)
difficult unless you are running on the machine where the build
was generated.

Change-Id: I9cc92af855a66366ec3b81a87b82bfd9994bc180
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2019-03-06 11:36:34 +00:00
Michal Cmarada
4e633e1043 VPP-1504: Remove JVPP
As part of JVPP migration this removes JVPP completely from VPP.

Change-Id: I6b74e7961aa474ae471e63fe43a624cd9fc3659b
Signed-off-by: Michal Cmarada <mcmarada@cisco.com>
2019-02-19 15:14:02 +00:00
Thomas F Herbert
6eb61639de Build changes required for Fedora and CentOS
VPP-1511

cmake is the dep for Fedora but cmake3 is for CentOS 7.
Centos: explicitly install epel-release on Centos.
Epel requirement is now explicit for cmake3, and ninja-build.
Remove references to Fedora 25 which is EOL.

Change-Id: I1548ddf2e5421097ac0ddc2d99abce7582d0d593
Signed-off-by: Thomas F Herbert <therbert@redhat.com>
2018-12-18 12:43:33 +00:00
Onong Tayeng
9b0ce0215b Fix permission for vpp_papi
The permission for the top-level vpp_papi dir under
/usr/lib/python2.7/site-packages is set to 644 which means that
non-root users cannot import vpp_papi. As a result, devstack setup
with VPP/networking-vpp fails since it is run as non-root user.

Change-Id: Id85b468b2dcc92efb3a64c51ffb23ef6d596e4ad
Signed-off-by: Onong Tayeng <otayeng@cisco.com>
2018-11-23 11:43:46 +00:00
Mohsin Kazmi
7b2017ddf7 rpm: Fix the spec file to look into right directories
Change-Id: If526e9f17226d7c371a8a98b9ac932196dab547a
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2018-09-26 15:50:09 +00:00
Paul Vinciguerra
9ce6a21aaa Fix: vppapigen make build fails on fresh install
Steps to reproduce:
  vagrant@localhost:/vagrant$ build-root/vagrant/build.sh
  ...
  @@@@ Building vpp in /vagrant/build-root/build-vpp-native/vpp @@@@
  [51/1169] Generating API header /vagrant/build-root/build-vpp-native/vpp/vlibmemory/memclnt.api.json
  FAILED: cd /vagrant/build-root/build-vpp-native/vpp/vlibmemory && mkdir -p /vagrant/build-root/build-vpp-native/vpp/vlibmemory && /vagrant/src/tools/vppapigen/vppapigen --includedir /vagrant/src --input /vagrant/src/vlibmemory/memclnt.api JSON --output /vagrant/build-root/build-vpp-native/vpp/vlibmemory/memclnt.api.json
  AttributeError: 'module' object has no attribute 'dumps'

  This seems to be due to JSON.py namespace colliding with the standard lib json.py

Change-Id: If389e4e05ef0c166b0c2b3bef7ec0185298679a8
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-09-13 00:32:35 +00:00
Damjan Marion
79dcbc74cd Always use 'lib' instead of 'lib64'
It is packaging responsibility to put libs in the right place.
Use of lib64 resulted in huge amount of files with hardcoded lib64.
This patch simplifies things...

Change-Id: Iab0dea0583e480907732c5d2379eb951a00fa9e6
Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-09-12 16:38:59 +00:00
Matthew Smith
d790c7e1fa update regex used by rpm build to find lib files
The old expression was '*.so.*.*.*' to find shared library
files with 3 components in the version.

Building from master gives you files with 2 components in
the version (e.g. libvnet.so.18.10). So most libs were not
getting included in vpp-lib.

Change-Id: Ib89d2f5aeb2417eed1b6b851089b9d22f540a226
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2018-09-07 19:39:54 +00:00
Damjan Marion
855e26868f Switch to cmake
Change-Id: I982b69390c55b5ffbd744f355efc0aaf425b360c
Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-09-02 11:24:12 +02:00
Marco Varlese
70fee2df33 SUSE: fix spec to generate RPMs
Change-Id: I36ec5136d0f100c8277a19f89c8f6c9640e0614e
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-08-30 15:45:06 +00:00
Marco Varlese
aa839cab98 SUSE: rpm-packaging fixes
Change-Id: Ic7ddc34bbb2fe414d41a083efd8caf35a12488ab
Signed-off-by: Marco Varlese <marco.varlese@suse.de>
2018-08-21 14:46:28 +00:00
Ole Troan
1d20f4748c PAPI: Move unit tests to fix packaging issues.
Change-Id: I67a0f168254367c657eb11d4413f9dc0c5356b3c
Signed-off-by: Ole Troan <ot@cisco.com>
2018-08-07 11:47:35 +02:00
Ole Troan
b199e98fef PAPI: Union pad at the end of short fields instead of at head.
Hopefully that's going to be consistent across platforms, compilers and ABI.

Change-Id: I0b82565288d88fd046278d4d8288ec1488273ba5
Signed-off-by: Ole Troan <ot@cisco.com>
2018-08-03 15:44:46 +00:00
Damjan Marion
c76d6e2c4a Temporrary disable japi packaging for opensuse
To unbreak verify job, caused by following message:

19:06:58 RPM build errors:
19:06:58     File not found: /w/workspace/vpp-verify-master-osleap15/build-root/rpmbuild/BUILDROOT/vpp-18.10-rc0~105_g0578e3f9~b1992.x86_64/usr/share/java/*
19:06:58 make[2]: *** [Makefile:50: RPM] Error 1
19:06:58 make[2]: Leaving directory '/w/workspace/vpp-verify-master-osleap15/extras/rpm'
19:06:58 make[1]: *** [Makefile:476: pkg-rpm] Error 2
19:06:58 make[1]: Leaving directory '/w/workspace/vpp-verify-master-osleap15'
19:06:58 make: *** [Makefile:541: verify] Error 2
19:06:58 Build step 'Execute shell' marked build as failure

Change-Id: Ie1300cbf70bedb9dd861a3f31feeddf1eb810eaf
Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-08-02 23:39:18 +02:00
Damjan Marion
cc4a5e8089 Move java api to extras/
Change-Id: Ibd5cbbdfb22a235442cddaebc9eae9a3c4e35ec9
Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-08-01 20:28:53 +00:00
Marco Varlese
abec942075 openSUSE: spec file update to reflect latest deps
Change-Id: I3c04956400a2e88d331f43d1b4865ee2c75e7bc9
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-07-10 10:12:38 +00:00
Ole Troan
a7564e8004 Python API: Add enum and union support.
As well as a rewrite of the encoders/decoders to make it more readable and extensible.
(Re-commit after fix to verify build.)

Change-Id: Ic244d3cebe070bb2570491f8a24f4a1e203f889a
Signed-off-by: Ole Troan <ot@cisco.com>
2018-06-22 03:00:45 +00:00
Ole Trøan
61debaaaf2 Revert "Python API: Add enum and union support."
This reverts commit a5ee900fb75201bbfceaf13c8bc57a13ed094988.

Some of the unit tests breaks. Backing out until fixed.

Change-Id: I1846fb417db44a2a772f7b59cda8bcfe6d39f8c3
Signed-off-by: Ole Troan <ot@cisco.com>
2018-06-18 18:30:09 +00:00
Ole Troan
a5ee900fb7 Python API: Add enum and union support.
As well as a rewrite of the encoders/decoders to make it more readable and extensible.

Change-Id: I253369ac76303922bf9c11377622c8974fa92f19
Signed-off-by: Ole Troan <ot@cisco.com>
2018-06-17 15:21:00 +00:00
Igor Mikhailov (imichail)
3b854a5cb8 MLX DPDK glue: exclude dependency on OFED libraries
MLX DPDK mlx5_glue.so, compiled under RTE_LIBRTE_MLX5_DLOPEN_DEPS,
provides a run-time check for OFED libraries.
To do so, it links with -libverbs -lmlx5 so that the binding could
occur or fail at runtime (see DPDK 59b91be and VPP 59b91be).
However RPM install fails on systems without OFED installed since
RPM spec has an entry "Requires: libmlx5".
To overcome this, exclude such requirement from the spec.

Same applies to mlx4_glue.so, compiled under RTE_LIBRTE_MLX4_DLOPEN_DEPS

Change-Id: I0ff6efc49581104743cc7e5b1f7cdbc1665ce9ba
Signed-off-by: Igor Mikhailov (imichail) <imichail@cisco.com>
2018-05-19 11:25:09 +00:00
Thomas F Herbert
6168623290 Add python lex and yacc to spec file build requirements.
Change-Id: Icf1a30c9df4d3298407c00383020debe99acdbff
Signed-off-by: Thomas F Herbert <therbert@redhat.com>
2018-05-04 21:53:09 +00:00
Thomas F Herbert
b42b77b31c Restore building of debuginfo RPMs
JIRA: VPP-1227

Remove rpm tmp dir build debuginfo rpms.
Reverses commits to fix a build problem with old versions of rpmbuild
that prevented builds in chrooted environments with short paths
and short project names.

Change-Id: I852696dccc984bf4882fd3ca9ec4c8da080bdb41
Signed-off-by: Thomas F Herbert <therbert@redhat.com>
2018-04-08 13:34:45 +00:00
Thomas F Herbert
6673178d48 Remove subunit from Centos requirements.
JIRA: VPP-1229

Subunit and Subunit-devel in Fedora and Epel but not Centos.
This patch moves the Fedora from the Centos specific requirements.

Change-Id: I093a4571cddf14af5ee2827ba8ee00c7bcbe6fc0
Signed-off-by: Thomas F Herbert <therbert@redhat.com>
2018-04-08 13:34:07 +00:00
Thomas F Herbert
5f56c091ce Remove mbedtls from build requirement for Centos
Although mbedtls is in Fedora and Epel, it is not
in Centos yet. It is not strictly necessary for TLS
which also can use openssl.

Change-Id: Id62d52000f9ecda2fc10d1938f02be1142fa5bdb
Signed-off-by: Thomas F Herbert <therbert@redhat.com>
2018-04-06 02:56:03 +00:00
Matthew Smith
30ec82161f Add RPM buildtime dependency on mbedtls-devel
Update RPM spec to know about it

Change-Id: I61c7c1ce96071e3b84d792c18ff8880217b14fce
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2018-03-02 16:48:25 +00:00
Matthew Smith
7c172cb245 Adjust vpp-selinux-policy postinstall
Only run semodule command on hosts where selinux
is enabled.

Change-Id: I7bcfc758e44bb0f41ec657ad395352ddb92766eb
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2018-02-28 21:47:43 +00:00
Jon Loeliger
190282cb0a RPMS: Also install C.py, JSON.py for vppapipgen.
When building plugins outside of the VPP tree, the vppapigen
tool requires the use of the C.py / JSON.py code.  To that end,
install it in /usr/share/vpp as referenced.

Change-Id: I457d58e7bde7140c7811fa0a93b4f44d1310784a
Signed-off-by: Jon Loeliger <jdl@netgate.com>
2018-01-31 19:14:17 +00:00
Billy McFall
28cf3b7da2 VPP-899: Run VPP under SELinux
Add an SELinux profile such that VPP can run under SELinux on RPM based
platforms. The SELinux Policy is currently only implemented for RPM
packages, specifically, Fedora, CentOS and RHEL. Doxygen User
Documentation has been included (selinux_doc.md). Once some discussion
on file locations has completed (see vpp-devlist), updates to the Debug
CLI documentation will also need to be updated.

Additional changes:
Patch Set 2:
- Rework selinux_doc.md such that each line is only 80 characters
  instead of each sentence on a line. Made additonal minor chnages
  to the text.
- Update vHost Debug CLI documentation to reflex new socket location.
  Cleaned up some text from when I originally wrote it, to better
  reflex proper use.
- Update exec Debug CLI documentation to be more inline with suggested
  helptext, added text regarding recommended script file location.
- For Debian builds, create the /var/log/vpp/ directory. I don't use
  Debian very much, so please pay extra attention to
  build-data/platforms.mk and build-root/deb/debian/.gitignore.
- Per discussion on VPP call, changed the default log location to
  /var/log/vpp/vpp.log.
- Changed the socket location for vHost in AutoConfig to
  /var/run/vpp/.
Patch Set 3:
- Update selinux_doc.md based on comments.

Change-Id: I400520dc33f1ca51012d09ef8fe5a7b7b96c631e
Signed-off-by: Billy McFall <bmcfall@redhat.com>
2018-01-30 13:26:20 +00:00
Ole Troan
9d42087149 VPPAPIGEN: vppapigen replacement in Python PLY.
This is a version of the VPP API generator in Python PLY. It supports
the existing language, and has a plugin architecture for generators.
Currently C and JSON are supported.

Changes:
 - vl_api_version to option version = "major.minor.patch"
 - enum support
 - Added error checking and reporting
 - import support (removed the C pre-processor)
 - services (tying request/reply together)

Version:
 option version = "1.0.0";

Enum:
 enum colours {
   RED,
   BLUE = 50,
 };
 define foo {
  vl_api_colours_t colours;
 };

Services:
 service {
  rpc foo returns foo_reply;
  rpc foo_dump returns stream foo_details;
  rpc want_stats returns want_stats_reply
      events ip4_counters, ip6_counters;
 };

Future planned features:
 - unions
 - bool, text
 - array support (including length)
 - proto3 output plugin
 - Refactor C/C++ generator as a plugin
 - Refactor Java generator as a plugin

Change-Id: Ifa289966c790e1b1a8e2938a91e69331e3a58bdf
Signed-off-by: Ole Troan <ot@cisco.com>
2018-01-23 13:03:53 +00:00
Gabriel Ganne
bf246dff1b dpdk plugin depends on numactl-libs
dpdk_plugin.so depends on libnuma.so.1

Change-Id: Ia1fd3b5cec043b294cc14cd947908675b451deac
Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>
2018-01-18 11:00:17 +01:00
Renato Botelho do Couto
e266ea3795 Optimize RPM build process
* Remove unused variable OS_VERSION_ID
* Do all RPM building in build-root/rpmbuild
* Add build-root/rpmbuild to .gitignore
* Move redundant code to a target called 'spec'
* Copy spec file to SPECS instead of SOURCES
* Only set %{_topdir} macro when it's undefined, and because of that
  remove sed call to delete definition on spec file
* Pass _version and _release using --define parameter instead of using
  sed to add them to .spec
* Move rpm files to build-root after build finishes
* Add dist tarball to .gitignore

Change-Id: I230d60b62914056b353f7f8701d14754b0bf7f8c
Signed-off-by: Renato Botelho do Couto <renato@netgate.com>
2017-12-04 11:36:28 +00:00
Marco Varlese
aba730fc0d Cleanup and simplify
This patch addresses two things:
1) It simplifies the Makefile to build RPMs by removing duplication and
use environment variables instead;
2) It aligns openSUSE with others with regards to invoke "pkg-rpm" by
the build.sh for Vagrant

Change-Id: I51557f54e4ddf49d83bb69fa0035c8fff122857e
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2017-11-30 08:48:49 +00:00
Marco Varlese
176fd570e6 Using $(CURDIR) to fix the absolute path issue
Change-Id: Ic26edd34a2980fc8cf34514433a7b7076660316e
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2017-11-29 10:10:53 +00:00
Gabriel Ganne
b8bbd6521f subunit is required on centos as well as fedora
Remove fedora dependency restriction on subunit and subunit-devel packages.
libsunit is only called in test/ext/Makefile on all platforms safe opensuse.

Change-Id: I483f42f20f6ba8bd112c18a9c51753a5d816d1c1
Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>
Signed-off-by: Romain Ly <romain.ly@enea.com>
2017-11-17 08:39:06 +00:00
Neale Ranns
2ea2e423a9 VOM rpm build fixes
Change-Id: I1f76aabecfd7d33b924a4856a4c3fc683b9b8802
Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
2017-11-08 10:19:30 +00:00
Sergio Gonzalez Monroy
6184db357d dpdk: build nasm from source
As not all distros have the minimum required nasm version (2.12.01)
available, build nasm from sources when building Intel IPsec MB library.

Change-Id: Iaa9da87f612c0f84da5704162c3bf430b3351076
Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
2017-11-05 11:35:12 +00:00
Thomas F Herbert
41988e58ba Fix bug with temporary directory when building rpms.
Fixes bug introduced in commit 5349f94d.

JIRA: VPP-1014

Change-Id: Ia18f4c6f5f1124306cce790a36f6de970d186687
Signed-off-by: Thomas F Herbert <therbert@redhat.com>
(cherry picked from commit 8c5bfbcc09f44f3ed2b87b0b5c257fbb7b735f97)
2017-10-14 09:12:32 +00:00
Thomas F Herbert
e41289115f Deps added to Makefile must also be in spec file.
Deps are required for Fedora too.

This patch is merged in version stable/17.10.
It should also be merged in master because it
fixes breaking rpm builds in some circumstances.

JIRA: VPP-1015

Cherry-picked from stable/1710

Change-Id: I10807069742cdd6b09a0f34d9d05e9cae4146ec3
Signed-off-by: Thomas F Herbert <therbert@redhat.com>
2017-10-14 09:12:12 +00:00
Marco Varlese
34acce2574 Add support for packaging SUSE RPMs.
This patch adds a new spec file for SUSE distribution and modifies the
Makefile to learn which platform is building the RPMs for.

Change-Id: Ic8ee0ddf978042cc1785ebc28bd1a6c9faf9bb74
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2017-10-12 02:41:26 +00:00
Thomas F Herbert
5349f94d99 Unpack into temporary directory with longer name.
JIRA VPP-498

This commit is a fix so downstream builds in Centos and
RHEL mock environment will work.  This is a workaround
for a bug in the debugedit code in rpm-build package 4.13
and earlier.

Change-Id: Ia6361f7487c5afe9948a2d2fe929942ba5b9c0f1
Signed-off-by: Thomas F Herbert <therbert@redhat.com>
2017-09-21 14:09:01 +00:00
Thomas F Herbert
440751b918 Use openssl 1.0 compat RPM for Fedora 26 and newer.
This is just a workaround until VPP is compatible with OpenSSL 1.1.

JIRA: VPP-569

Change-Id: I8d2a113dc9400fd7e8e6850de5d91f40380455ce
Signed-off-by: Thomas F Herbert <therbert@redhat.com>
2017-09-20 13:40:04 +00:00
Billy McFall
ce41a5c803 VPP-958: RPM Update wipes out local changes to 80-vpp.conf
Changed the %config to %config(noreplace) for the two files in the
vpp.spec file that use it, 80-vpp.conf and startup.conf. Any local
changes to these files will now remain. If a newer version of the file
is published, the new version will be copied over as {filename}.rpmnew,
and the changes will not be applied without manual intervention.

Change-Id: I00b2c7abca20bc33f82479374dd184fc57a9abc5
Signed-off-by: Billy McFall <bmcfall@redhat.com>
2017-09-15 13:57:51 +00:00
Thomas F Herbert
4b0ac82a73 Add option to build without multi-buffer crypto.
JIRA VPP-498

This patch also allows RPMs to be built without multi-
buffer crypto for some RPM based downstream distros that
don't have sufficiently new nasm or don't have an USA
export license for multi-buffer crypto.

The default is to build WITH multi-buffer crypto
for x86-64. This patch allows optional building without
multi-buffer crypto.

To build without multi-buffer crypto, set the AESNI
environment variable to n.
To build rpm packages without multi-buffer crypto,
build the rpms with the option turned off.

make build AESNI=n

or..

make pkg-rpm --without aesni

---How to test this patch on a Centos build.---

Build as above and verify that nasm isn't executed during
the build process.
vpp may be installed and the dpdk plugin may be inspected to
verify that the multi-buffer code isn't present.

Change-Id: I8c5cfd4cdd9eb2b96772a687eaa54560806e001b
Signed-off-by: Thomas F Herbert <therbert@redhat.com>
2017-09-12 18:42:32 +00:00
Thomas F Herbert
bd8e242024 Add Build Requirements from Makefile to spec file.
JIRA: VPP-498

Changes to build to help with downstream distro builds
for Fedora, Centos and RHEL distros.
Add nasm, automake, libtool, byacc, bison and flex.
Remove libconfuse and dependencies.
Remove epel-release rpm and dependencies.
Add conditionals to work around Python 2 packaging
inconsistency in Fed 25.
Add numactl to rpm requirements.

Change-Id: Ia39f8b931dc87e42df56414d38662eb33c7a4ca7
Signed-off-by: Thomas F Herbert <therbert@redhat.com>
2017-08-26 18:27:06 -04:00
Thomas F Herbert
b60f4965bf Create source rpm.
Use actual file name for tarball.
Includes required modifications in spec file for unpacking srpm.
Spec file source references actual dist tarball name
so it matches the revision and release while building from srpm.

JIRA: VPP-498

Change-Id: I8b55a69f060b7864527b94d8c5b0a2ebccc306b1
Signed-off-by: Thomas F Herbert <therbert@redhat.com>
2017-08-08 15:29:11 +00:00
Thomas F Herbert
5b75b6b73b Use relative path to vpp.service.
This change is necessary to avoid breaking builds from source rpm.

JIRA: VPP-498

Change-Id: I876572ff75f88e22bf8012cabb1bde7e6d3c925a
Signed-off-by: Thomas F Herbert <therbert@redhat.com>
2017-07-27 08:11:52 +00:00