build: (opensuse) Revert build remove opensuse build infra

Added missing deps
Removed Thumbleweed support
Changed python2 to python3
Added Dockerfile for suse-leap build

Type: make
Change-Id: Ie73d2382a73ebc9d4475ace1a8f818fe38cf40c0
Signed-off-by: Laszlo Kiraly <laszlo.kiraly@est.tech>
This commit is contained in:
Laszlo Kiraly
2021-11-02 11:07:19 +01:00
committed by Beno�t Ganne
parent 6fdcc3daa4
commit e56008519b
6 changed files with 472 additions and 3 deletions

View File

@@ -795,6 +795,11 @@ M: Ole Troan <ot@cisco.com>
M: Paul Atkins <patkins@graphiant.com>
F: src/vnet/ipfix-export/
RPM packaging on openSUSE
I: rpm-packaging
M: Laszlo Kiraly <laszlo.kiraly@est.tech>
F: src/extras/rpm/opensuse
THE REST
I: misc
M: vpp-dev Mailing List <vpp-dev@fd.io>

View File

@@ -56,7 +56,7 @@ endif
ifeq ($(filter ubuntu debian,$(OS_ID)),$(OS_ID))
PKG=deb
else ifeq ($(filter rhel centos fedora,$(OS_ID)),$(OS_ID))
else ifeq ($(filter rhel centos fedora opensuse-leap,$(OS_ID)),$(OS_ID))
PKG=rpm
endif
@@ -154,6 +154,32 @@ RPM_DEPENDS_DEBUG += krb5-debuginfo openssl-debuginfo
RPM_DEPENDS_DEBUG += zlib-debuginfo nss-softokn-debuginfo
RPM_DEPENDS_DEBUG += yum-plugin-auto-update-debug-info
RPM_SUSE_BUILDTOOLS_DEPS = autoconf automake ccache check-devel chrpath
RPM_SUSE_BUILDTOOLS_DEPS += clang cmake indent libtool make ninja python3-ply
RPM_SUSE_DEVEL_DEPS = glibc-devel-static libnuma-devel libelf-devel
RPM_SUSE_DEVEL_DEPS += libopenssl-devel openssl-devel mbedtls-devel libuuid-devel
RPM_SUSE_PYTHON_DEPS = python-devel python3-devel python-pip python3-pip
RPM_SUSE_PYTHON_DEPS += python-rpm-macros python3-rpm-macros
RPM_SUSE_PLATFORM_DEPS = distribution-release shadow rpm-build
ifeq ($(OS_ID),opensuse-leap)
ifeq ($(OS_VERSION_ID),15.3)
RPM_SUSE_DEVEL_DEPS += curl libstdc++-devel bison gcc-c++ zlib-devel xmlto
RPM_SUSE_DEVEL_DEPS += libboost_headers-devel libboost_thread-devel lsb-release
RPM_SUSE_DEVEL_DEPS += asciidoc git
RPM_SUSE_PYTHON_DEPS += python3 python2-ply
endif
ifeq ($(OS_VERSION_ID),15.0)
RPM_SUSE_DEVEL_DEPS += libboost_headers-devel libboost_thread-devel gcc git curl
RPM_SUSE_PYTHON_DEPS += python3-ply python2-virtualenv
endif
endif
RPM_SUSE_DEPENDS += $(RPM_SUSE_BUILDTOOLS_DEPS) $(RPM_SUSE_DEVEL_DEPS) $(RPM_SUSE_PYTHON_DEPS) $(RPM_SUSE_PLATFORM_DEPS)
ifneq ($(wildcard $(STARTUP_DIR)/startup.conf),)
STARTUP_CONF ?= $(STARTUP_DIR)/startup.conf
endif
@@ -307,8 +333,11 @@ else ifeq ($(OS_ID),fedora)
@sudo -E dnf install $(CONFIRM) $(RPM_DEPENDS)
@sudo -E debuginfo-install $(CONFIRM) glibc openssl-libs mbedtls-devel zlib
endif
else ifeq ($(filter opensuse-leap,$(OS_ID)),$(OS_ID))
@sudo -E zypper refresh
@sudo -E zypper install -y $(RPM_SUSE_DEPENDS)
else
$(error "This option currently works only on Ubuntu, Debian, RHEL, or CentOS systems")
$(error "This option currently works only on Ubuntu, Debian, RHEL, CentOS or openSUSE-leap systems")
endif
git config commit.template .git_commit_template.txt

View File

@@ -26,6 +26,13 @@ PC=%
all: RPM
# SUSE osleap15
ifeq ($(filter opensuse-leap,$(OS_ID)),$(OS_ID))
SRC_SPEC_DIR="opensuse"
else
SRC_SPEC_DIR="."
endif
SPEC_FILE='vpp.spec'
spec:
@@ -33,7 +40,7 @@ spec:
mkdir -p $(RPMBUILD)/RPMS $(RPMBUILD)/SRPMS $(RPMBUILD)/BUILD \
$(RPMBUILD)/SOURCES $(RPMBUILD)/SPECS
cp $(TARBALL) $(RPMBUILD)/SOURCES/vpp-$(VERSION)-$(RELEASE).tar.xz
cp $(SPEC_FILE) $(RPMBUILD)/SPECS
cp $(SRC_SPEC_DIR)/$(SPEC_FILE) $(RPMBUILD)/SPECS
srpm: spec
rpmbuild -bs \

View File

@@ -0,0 +1,15 @@
# Run from top of vpp repo with command:
# docker build -f extras/rpm/opensuse/Dockerfile .
ARG SUSE_VERSION=15.3
FROM opensuse/leap:${SUSE_VERSION} as vppbuild
COPY . /vpp
WORKDIR /vpp
RUN zypper install -y make sudo
COPY . .
RUN UNATTENDED=y make install-dep
RUN ln -s /usr/bin/cmake /usr/bin/cmake3
RUN UNATTENDED=y make install-ext-deps
RUN make pkg-rpm
CMD ["/bin/bash"]

View File

@@ -0,0 +1,89 @@
# Build RPM for openSUSE
## Introduction
This is to describe how to compile and create installable RPM packages for openSUSE leap.
In general you should visit [Pulling, Building,
Running, Hacking, Pushing](https://wiki.fd.io/view/VPP/Pulling,_Building,_Run
ning,_Hacking_and_Pushing_VPP_Code) which provides full description for other type of system (Ubuntu,Centos or Redhat).
## Get the VPP Sources
To get the VPP sources that are used to create the build, run the following commands:
```bash
# git clone https://gerrit.fd.io/r/vpp
# cd vpp
```
There are two ways to continue:
* Build by docker
* Build on your own openSUSE system
## Build by Docker
Run the following docker command:
```bash
docker build -f extras/rpm/opensuse/Dockerfile .
```
The packages now can be copied from the docker image and can be installed on openSUSE.
An example how to extend the Dockerfile to install vpp:
'''dockerfile
FROM opensuse/leap:${SUSE_VERSION} as vppinstall
COPY --from=vppbuild /vpp/build-root/*rpm /rpms/
RUN VPP_INSTALL_SKIP_SYSCTL=false zypper install --allow-unsigned-rpm -y --no-recommends /rpms/*.rpm;\
...
'''
## Build on openSUSE
### Build VPP Dependencies
Before building a VPP image, make sure there are no FD.io VPP or DPDK packages installed, by entering the following commands:
```bash
# rpm -ql vpp
package vpp is not installed
# rpm -ql dpdk
package dpdk is not installed
```
Run the following make command to install the dependencies for FD.io VPP.
```bash
make install-dep
```
Run the following make command to install the external dependencies for FD.io VPP.
```bash
ln -s /usr/bin/cmake /usr/bin/cmake3 # some thirdparty checking for cmake3 binary
make install-ext-dep
```
### Build RPM Packages
Create packages for openSUSE by running:
```bash
make pkg-rpm
```
Once the packages are built they can be found in the build-root directory.
```bash
# ls *.rpm
```
If the packages are built correctly, then this should be the corresponding output:
```bash
build-root/libvpp0-21.10-rc0~200_gb89ae9670.x86_64.rpm build-root/vpp-api-python-21.10-rc0~200_gb89ae9670.x86_64.rpm
build-root/vpp-21.10-rc0~200_gb89ae9670.x86_64.rpm build-root/vpp-devel-21.10-rc0~200_gb89ae9670.x86_64.rpm
build-root/vpp-api-lua-21.10-rc0~200_gb89ae9670.x86_64.rpm build-root/vpp-plugins-21.10-rc0~200_gb89ae9670.x86_64.rpm
```

View File

File diff suppressed because it is too large Load Diff