diff options
Diffstat (limited to 'packages')
-rw-r--r-- | packages/nginx-dl.mk | 20 | ||||
-rw-r--r-- | packages/nginx_ldp.mk | 69 | ||||
-rw-r--r-- | packages/nginx_vcl.mk | 74 | ||||
-rw-r--r-- | packages/openssl-dl.mk | 19 | ||||
-rw-r--r-- | packages/openssl.mk | 46 | ||||
-rw-r--r-- | packages/package.mk | 64 | ||||
-rw-r--r-- | packages/packages.mk | 173 | ||||
-rw-r--r-- | packages/pre-install | 9 | ||||
-rw-r--r-- | packages/vpp_ldp.mk | 105 | ||||
-rw-r--r-- | packages/vpp_vcl.mk | 96 |
10 files changed, 675 insertions, 0 deletions
diff --git a/packages/nginx-dl.mk b/packages/nginx-dl.mk new file mode 100644 index 0000000..7fc7bd3 --- /dev/null +++ b/packages/nginx-dl.mk @@ -0,0 +1,20 @@ +# Copyright (c) 2020 Intel and/or its affiliates. +# 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. + +nginx_version := 1.14.2 +nginx_tarball := nginx-$(nginx_version).tar.gz +nginx_tarball_md5sum := 239b829a13cea1d244c1044e830bd9c2 +nginx_url := http://nginx.org/download/$(nginx_tarball) + + +$(eval $(call download,nginx)) diff --git a/packages/nginx_ldp.mk b/packages/nginx_ldp.mk new file mode 100644 index 0000000..cde52a2 --- /dev/null +++ b/packages/nginx_ldp.mk @@ -0,0 +1,69 @@ +# Copyright (c) 2020 Intel and/or its affiliates. +# 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. + +nginx_ldp_version := 1.14.2 +nginx_ldp_src_dir := $(B)/nginx_ldp +nginx_ldp_install_dir := $(I)/local/nginx +nginx_ldp_deb_inst_dir := /usr/local/nginx +nginx_ldp_pkg_deb_name := nginx +nginx_ldp_pkg_deb_dir := $(I)/deb-ldp +nginx_ldp_tarball := nginx-$(nginx_ldp_version).tar.gz +nginx_ldp_tarball_strip_dirs := 1 +nginx_ldp_desc := "ldp nginx" + + +define nginx_ldp_patch_cmds + @true +endef + +define nginx_ldp_config_cmds + @cd $(nginx_ldp_src_dir); \ + ./configure --prefix=$(nginx_ldp_install_dir) \ + --with-http_stub_status_module \ + --with-http_ssl_module +endef + +define nginx_ldp_build_cmds + @$(MAKE) -C $(nginx_ldp_src_dir) +endef + +define nginx_ldp_install_cmds + @$(MAKE) -C $(nginx_ldp_src_dir) install + @cp configs/mime.types $(nginx_ldp_install_dir)/conf/. + @cp configs/nginx.conf $(nginx_ldp_install_dir)/conf/. + @cp configs/tls-* $(nginx_ldp_install_dir)/conf/. + @cp configs/vcl.conf $(nginx_ldp_install_dir)/conf/. +endef + +define nginx_ldp_pkg_deb_cmds + @fpm -f -s dir \ + -t deb \ + -n $(nginx_ldp_pkg_deb_name) \ + -v $(nginx_ldp_version) \ + -C $(nginx_ldp_install_dir) \ + -p $(nginx_ldp_pkg_deb_dir) \ + --prefix $(nginx_ldp_deb_inst_dir) \ + --license $(LICENSE) \ + --iteration $(LINUX_ITER) \ + --vendor Intel \ + --description $(nginx_ldp_desc) \ + --deb-no-default-config-files \ + --pre-install packages/pre-install +endef + +define nginx_ldp_pkg_deb_cp_cmds + @echo "--- copy deb to $(CURDIR)/deb-ldp ---" + @cp $(nginx_ldp_pkg_deb_dir)/*.deb deb-ldp/. +endef + +$(eval $(call package,nginx_ldp)) diff --git a/packages/nginx_vcl.mk b/packages/nginx_vcl.mk new file mode 100644 index 0000000..031ada9 --- /dev/null +++ b/packages/nginx_vcl.mk @@ -0,0 +1,74 @@ +# Copyright (c) 2020 Intel and/or its affiliates. +# 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. + +nginx_vcl_version := 1.14.2 +nginx_vcl_patch_dir := $(CURDIR)/nginx_patches +nginx_vcl_src_dir := $(B)/nginx_vcl +vpp_vcl_src_dir := $(CURDIR)/vpp +nginx_vcl_install_dir := $(I)/local/nginx +nginx_vcl_deb_inst_dir := /usr/local/nginx +nginx_vcl_pkg_deb_name := nginx +nginx_vcl_pkg_deb_dir := $(I)/deb-vcl +nginx_vcl_tarball := nginx-$(nginx_vcl_version).tar.gz +nginx_vcl_tarball_strip_dirs := 1 +nginx_vcl_desc := "vcl nginx" + + +define nginx_vcl_patch_cmds + @for f in $(nginx_vcl_patch_dir)/*.patch ; do \ + echo "Applying patch: $$(basename $$f)" ; \ + patch -p2 -d $(nginx_vcl_src_dir) < $$f ; \ + done +endef + +define nginx_vcl_config_cmds + @cd $(nginx_vcl_src_dir); \ + ./configure --prefix=$(nginx_vcl_install_dir) --with-vcl \ + --vpp-lib-path=$(vpp_vcl_src_dir)/build-root/install-vpp-native/vpp/lib \ + --vpp-src-path=$(vpp_vcl_src_dir)/src +endef + +define nginx_vcl_build_cmds + @$(MAKE) -C $(nginx_vcl_src_dir) +endef + +define nginx_vcl_install_cmds + @$(MAKE) -C $(nginx_vcl_src_dir) install + @cp configs/mime.types $(nginx_vcl_install_dir)/conf/. + @cp configs/nginx.conf $(nginx_vcl_install_dir)/conf/. + @cp configs/tls-* $(nginx_vcl_install_dir)/conf/. + @cp configs/vcl.conf $(nginx_vcl_install_dir)/conf/. +endef + +define nginx_vcl_pkg_deb_cmds + @fpm -f -s dir \ + -t deb \ + -n $(nginx_vcl_pkg_deb_name) \ + -v $(nginx_vcl_version) \ + -C $(nginx_vcl_install_dir) \ + -p $(nginx_vcl_pkg_deb_dir) \ + --prefix $(nginx_vcl_deb_inst_dir) \ + --license $(LICENSE) \ + --iteration $(LINUX_ITER) \ + --vendor Intel \ + --description $(nginx_vcl_desc) \ + --deb-no-default-config-files \ + --pre-install packages/pre-install +endef + +define nginx_vcl_pkg_deb_cp_cmds + @echo "--- copy deb to $(CURDIR)/deb-vcl ---" + @cp $(nginx_vcl_pkg_deb_dir)/*.deb deb-vcl/. +endef + +$(eval $(call package,nginx_vcl)) diff --git a/packages/openssl-dl.mk b/packages/openssl-dl.mk new file mode 100644 index 0000000..e7b8d5b --- /dev/null +++ b/packages/openssl-dl.mk @@ -0,0 +1,19 @@ +# Copyright (c) 2020 Intel and/or its affiliates. +# 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. + +openssl_version := 3.0.0-alpha1 +openssl_tarball := openssl-$(openssl_version).tar.gz +openssl_tarball_md5sum := d9326bd068a0382193ab0cb1c6e4685b +openssl_url := https://www.openssl.org/source/$(openssl_tarball) + +$(eval $(call download,openssl)) diff --git a/packages/openssl.mk b/packages/openssl.mk new file mode 100644 index 0000000..37f2c84 --- /dev/null +++ b/packages/openssl.mk @@ -0,0 +1,46 @@ +# Copyright (c) 2020 Intel and/or its affiliates. +# 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. + +openssl_version := 3.0.0-alpha1 +openssl_patch_dir := $(CURDIR)/openssl_patches +openssl_install_dir := $(I)/local/ssl +openssl_deb_inst_dir := /usr/local/ssl +openssl_pkg_deb_name := openssl3 +openssl_pkg_deb_dir := $(I)/openssl-deb +openssl_rpm_inst_dir := /usr/local/ssl +openssl_pkg_rpm_name := openssl3 +openssl_pkg_rpm_dir := $(I)/openssl-rpm +openssl_tarball := openssl-$(openssl_version).tar.gz +openssl_tarball_md5sum := d9326bd068a0382193ab0cb1c6e4685b +openssl_tarball_strip_dirs := 1 +openssl_url := https://www.openssl.org/source/$(openssl_tarball) +openssl_desc := "openssl3.0.0" + +define openssl_config_cmds + @cd $(openssl_build_dir) && \ + $(openssl_src_dir)/config \ + --prefix=$(openssl_install_dir) shared zlib +endef + +define openssl_build_cmds + @$(MAKE) -C $(openssl_build_dir) depend + @$(MAKE) -C $(openssl_build_dir) + @$(MAKE) -C $(openssl_build_dir) install +endef + +define openssl_install_cmds + @true +endef + + +$(eval $(call package,openssl)) diff --git a/packages/package.mk b/packages/package.mk new file mode 100644 index 0000000..95f5f34 --- /dev/null +++ b/packages/package.mk @@ -0,0 +1,64 @@ +# Copyright (c) 2020 Intel and/or its affiliates. +# 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. +define h1 + @echo "--- $(1)" +endef + +define download + +############################################################################## +# Download +############################################################################## +ifeq ($$(call $1_download_cmds),) +define $1_download_cmds + @if [ -e $(DL_CACHE_DIR)/$($1_tarball) ] ; \ + then cp $(DL_CACHE_DIR)/$($1_tarball) $$@ ; \ + else \ + echo "Downloading $($1_url)" ; \ + curl -o $$@ -LO $($1_url) ; \ + fi +endef +endif + +downloads/$($1_tarball): + mkdir -p downloads + $$(call h1,"download $($1_tarball) ") + $$(call $1_download_cmds) + @rm -f $(B)/.$1.download.ok + +ifeq ($$(call $1_checksum_cmds),) +define $1_checksum_cmds + $$(call h1,"validating $1 $($1_version) checksum") + @SUM=$$(shell openssl md5 $$< | cut -f 2 -d " " -) ; \ + ([ "$$$${SUM}" = "$($1_tarball_md5sum)" ] || \ + ( echo "========================================================" && \ + echo "Bad Checksum!" && \ + echo "Expected: $($1_tarball_md5sum)" && \ + echo "Calculated: $$$${SUM}" && \ + echo "Please remove $$< and retry" && \ + echo "========================================================" && \ + false )) +endef +endif + +$(B)/.$1.download.ok: downloads/$($1_tarball) + @mkdir -p $(B) + $$(call $1_checksum_cmds) + @touch $$@ + +.PHONY: $1-dl +$1-dl: $(B)/.$1.download.ok + + +ALL_TARGETS += $1-dl +endef diff --git a/packages/packages.mk b/packages/packages.mk new file mode 100644 index 0000000..79aed56 --- /dev/null +++ b/packages/packages.mk @@ -0,0 +1,173 @@ +# Copyright (c) 2020 Intel and/or its affiliates. +# 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. +define h1 + @echo "--- $(1)" +endef + +define package +$1_tarball_strip_dirs ?= 0 +$1_src_dir ?= $(B)/src-$1 +$1_patch_dir ?= $(CURDIR)/patches/$1_$($1_version) +$1_build_dir ?= $(B)/build-$1 +$1_install_dir ?= $(I) +$1_pkg_deb_name ?= $1 +$1_pkg_deb_dir ?= $(I)/deb-$1 +$1_deb_inst_dir ?= $(I) +$1_config_log ?= $(B)/$1.config.log +$1_build_log ?= $(B)/$1.build.log +$1_install_log ?= $(B)/$1.install.log +$1_pkg_deb_log ?= $(B)/$1.pkgdeb.log +$1_pkg_rpm_log ?= $(B)/$1.pkgrpm.log + + +############################################################################## +# Extract +############################################################################## +ifeq ($$(call $1_extract_cmds),) +define $1_extract_cmds + $$(call h1,"extracting $1 $($1_version)") + @mkdir -p $$($1_src_dir) + tar \ + --directory $$($1_src_dir) \ + --extract \ + --strip-components=$$($1_tarball_strip_dirs) \ + --file downloads/$($1_tarball) +endef +endif + +$(B)/.$1.extract.ok: + $$(call h1,"extracting $1 $($1_version)") + $$(call $1_extract_cmds) + @touch $$@ + +.PHONY: $1-extract +$1-extract: $(B)/.$1.extract.ok + +############################################################################## +# Patch +############################################################################## +ifeq ($$(call $1_patch_cmds),) +define $1_patch_cmds +#ifneq ($$(wildcard $$($1_patch_dir)/*.patch),) + @for f in $$($1_patch_dir)/*.patch ; do \ + echo "Applying patch: $$$$(basename $$$$f)" ; \ + patch -p1 -d $$($1_src_dir) < $$$$f ; \ + done +#endif + @true +endef +endif + +$(B)/.$1.patch.ok: $(B)/.$1.extract.ok + $$(call h1,"patching $1 $$($1_patch_dir)") + $$(call $1_patch_cmds) + @touch $$@ + +.PHONY: $1-patch +$1-patch: $(B)/.$1.patch.ok + +############################################################################## +# Config +############################################################################## + +ifeq ($$(call $1_config_cmds),) +define $1_config_cmds + @cd $$($1_build_dir) && \ + CFLAGS="$$($1_cflags)" \ + $$($1_src_dir)/configure \ + --prefix=$$($1_install_dir) \ + $$($1_configure_args) > $$($1_config_log) +endef +endif + +$(B)/.$1.config.ok: $(B)/.$1.patch.ok $(addsuffix -install,$($1_depends)) + $$(call h1,"configuring $1 - log: $$($1_config_log)") + @mkdir -p $$($1_build_dir) + $$(call $1_config_cmds) + @touch $$@ + +.PHONY: $1-config +$1-config: $(B)/.$1.config.ok + +############################################################################## +# Build +############################################################################## + +ifeq ($$(call $1_build_cmds),) +define $1_build_cmds + @$(MAKE) $(MAKE_ARGS) -C $$($1_build_dir) > $$($1_build_log) +endef +endif + +$(B)/.$1.build.ok: $(B)/.$1.config.ok + $$(call h1,"building $1 $($1_version) - log: $$($1_build_log)") + $$(call $1_build_cmds) + @touch $$@ + +.PHONY: $1-build +$1-build: $(B)/.$1.build.ok + +############################################################################## +# Install +############################################################################## + +ifeq ($$(call $1_install_cmds),) +define $1_install_cmds + @$(MAKE) $(MAKE_ARGS) -C $$($1_build_dir) install > $$($1_install_log) +endef +endif + +$(B)/.$1.install.ok: $(B)/.$1.build.ok + $$(call h1,"installing $1 $($1_version) - log: $$($1_install_log)") + $$(call $1_install_cmds) + @touch $$@ + +.PHONY: $1-install +$1-install: $(B)/.$1.install.ok + +ifeq ($$(call $1_pkg_deb_cmds),) +define $1_pkg_deb_cmds + @fpm -f -s dir \ + -t deb \ + -n $$($1_pkg_deb_name) \ + -v $$($1_version) \ + -C $$($1_install_dir) \ + -p $$($1_pkg_deb_dir) \ + --prefix $$($1_deb_inst_dir) \ + --license $(LICENSE) \ + --iteration $(LINUX_ITER) \ + --vendor Intel \ + --description $$($1_desc) \ + --deb-no-default-config-files + @true +endef +endif + +ifeq ($$(call $1_pkg_deb_cp_cmds),) +define $1_pkg_deb_cp_cmds + @true +endef +endif + +$(B)/.$1.pkg-deb.ok: $(B)/.$1.install.ok + $$(call h1,"package $1 $($1_version) - log: $$($1_pkg_deb_log)") + @mkdir -p $$($1_pkg_deb_dir) + $$(call $1_pkg_deb_cmds) + $$(call $1_pkg_deb_cp_cmds) + @touch $$@ + +.PHONY: $1-deb +$1-deb: $(B)/.$1.pkg-deb.ok + +ALL_TARGETS += $1-deb +endef diff --git a/packages/pre-install b/packages/pre-install new file mode 100644 index 0000000..a7f6471 --- /dev/null +++ b/packages/pre-install @@ -0,0 +1,9 @@ +#!/bin/bash +set -x + +# kill nginx. +retval=$(ps -A | grep nginx | grep -v grep | awk '{print $1}' | wc -l) +if [[ $retval -ne 0 ]]; then + ps -A | grep nginx | grep -v grep | awk '{print $1}' | xargs kill -9 +fi + diff --git a/packages/vpp_ldp.mk b/packages/vpp_ldp.mk new file mode 100644 index 0000000..cdf6307 --- /dev/null +++ b/packages/vpp_ldp.mk @@ -0,0 +1,105 @@ +# Copyright (c) 2020 Intel and/or its affiliates. +# 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. + +vpp_ldp_patch_dir := $(CURDIR)/vpp_patches +vpp_ldp_src_dir := $(CURDIR)/vpp +vpp_ldp_install_dir := $(I)/local +vpp_ldp_pkg_deb_name := vpp +vpp_ldp_pkg_deb_dir := $(CURDIR)/vpp/build-root +vpp_ldp_desc := "ldp vpp" + + +define vpp_ldp_extract_cmds + @true +endef + +define vpp_ldp_patch_cmds + @echo "--- ldp vpp patching ---" + @cd $(vpp_ldp_src_dir); \ + git reset --hard; git clean -f; git checkout master; \ + if [ ! -z $(_VPP_VER) ] ; then \ + echo "--- vpp version: $(_VPP_VER) ---"; \ + git checkout remotes/origin/stable/$(_VPP_VER); \ + git reset --hard; git clean -f; \ + fi + @for f in $(CURDIR)/vpp_patches/common/*.patch ; do \ + echo Applying patch: $$(basename $$f) ; \ + patch -p1 -d $(vpp_ldp_src_dir) < $$f ; \ + done + @if [ -z $(_VPP_VER) ]; then \ + echo "--- vpp master ---"; \ + for f in $(CURDIR)/vpp_patches/common/master/*.patch ; do \ + echo Applying patch: $$(basename $$f) ; \ + patch -p1 -d $(vpp_ldp_src_dir) < $$f ; \ + done; \ + elif [ $(_VPP_VER) = "2001" ]; then \ + echo "--- vpp 20.01 ---"; \ + for f in $(CURDIR)/vpp_patches/common/2001/*.patch ; do \ + echo Applying patch: $$(basename $$f) ; \ + patch -p1 -d $(vpp_ldp_src_dir) < $$f ; \ + done; \ + fi + @if [ -z $(_VPP_VER) ]; then \ + echo "--- patch master ---"; \ + for f in $(CURDIR)/vpp_patches/ldp/master/*.patch ; do \ + echo Applying patch: $$(basename $$f) ; \ + patch -p1 -d $(vpp_ldp_src_dir) < $$f ; \ + done; \ + elif [ $(_VPP_VER) = "2001" ]; then \ + echo "--- patch 2001 ---"; \ + for f in $(CURDIR)/vpp_patches/ldp/2001/*.patch ; do \ + echo Applying patch: $$(basename $$f) ; \ + patch -p1 -d $(vpp_ldp_src_dir) < $$f ; \ + done; \ + fi + @true +endef + + +define vpp_ldp_config_cmds + @true +endef + +define vpp_ldp_build_cmds + @cd $(vpp_ldp_src_dir); \ + echo "---build : $(vpp_ldp_src_dir)"; \ + export OPENSSL_ROOT_DIR=$(I)/local/ssl; \ + export LD_LIBRARY_PATH=$(I)/local/ssl/lib; \ + $(MAKE) wipe-release; \ + rm -f $(vpp_ldp_pkg_deb_dir)/*.deb; \ + $(MAKE) build-release; \ + $(MAKE) pkg-deb; \ + echo "--- Please wait for the final completion ..."; \ + cd ..; rm -rf $(vcl_vpp_install_dir)/vpp; \ + cp -rf vpp $(vcl_vpp_install_dir); \ + echo "--- Completed! ---" + +endef + +define vpp_ldp_install_cmds + @true +endef + +define vpp_ldp_pkg_deb_cmds + @true +endef + +define vpp_ldp_pkg_deb_cp_cmds + @echo "--- copy deb to $(CURDIR)/deb-ldp ---" + @mkdir -p deb-ldp + @ls deb-ldp/ ;rm -f deb-ldp/* + @cp $(I)/openssl-deb/*.deb deb-ldp/. + @cp $(vpp_ldp_pkg_deb_dir)/*.deb deb-ldp/. +endef + +$(eval $(call package,vpp_ldp)) diff --git a/packages/vpp_vcl.mk b/packages/vpp_vcl.mk new file mode 100644 index 0000000..9b83678 --- /dev/null +++ b/packages/vpp_vcl.mk @@ -0,0 +1,96 @@ +# Copyright (c) 2020 Intel and/or its affiliates. +# 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. + +vpp_vcl_patch_dir := $(CURDIR)/vpp_patches +vpp_vcl_src_dir := $(CURDIR)/vpp +vpp_vcl_install_dir := $(I)/local +vpp_vcl_pkg_deb_name := vpp +vpp_vcl_pkg_deb_dir := $(CURDIR)/vpp/build-root +vpp_vcl_desc := "vcl vpp" + + +define vpp_vcl_extract_cmds + @true +endef + +define vpp_vcl_patch_cmds + @echo "--- vpp patching ---" + @cd $(vpp_vcl_src_dir); \ + git reset --hard; git clean -f; git checkout master; \ + if [ ! -z $(_VPP_VER) ]; then \ + echo "--- vpp version: $(_VPP_VER) ---"; \ + git checkout origin/stable/$(_VPP_VER); \ + git reset --hard; git clean -f; \ + fi + @for f in $(CURDIR)/vpp_patches/common/*.patch ; do \ + echo Applying patch: $$(basename $$f) ; \ + patch -p1 -d $(vpp_vcl_src_dir) < $$f ; \ + done + @if [ -z $(_VPP_VER) ]; then \ + echo "--- vpp master ---"; \ + for f in $(CURDIR)/vpp_patches/common/master/*.patch ; do \ + echo Applying patch: $$(basename $$f) ; \ + patch -p1 -d $(vpp_vcl_src_dir) < $$f ; \ + done; \ + elif [ $(_VPP_VER) = "2001" ]; then \ + echo "--- vpp 20.01 ---"; \ + for f in $(CURDIR)/vpp_patches/common/2001/*.patch ; do \ + echo Applying patch: $$(basename $$f) ; \ + patch -p1 -d $(vpp_vcl_src_dir) < $$f ; \ + done; \ + fi + @for f in $(CURDIR)/vpp_patches/vcl/*.patch ; do \ + echo Applying patch: $$(basename $$f) ; \ + patch -p1 -d $(vpp_vcl_src_dir) < $$f ; \ + done + + @true +endef + + +define vpp_vcl_config_cmds + @true +endef + +define vpp_vcl_build_cmds + @cd $(vpp_vcl_src_dir); \ + echo "--- build : $(vpp_vcl_src_dir)"; \ + export OPENSSL_ROOT_DIR=$(I)/local/ssl; \ + export LD_LIBRARY_PATH=$(I)/local/ssl/lib; \ + $(MAKE) wipe-release; \ + rm -f $(vpp_vcl_pkg_deb_dir)/*.deb; \ + $(MAKE) build-release; \ + $(MAKE) pkg-deb; \ + echo "--- Please wait for the final completion ..."; \ + cd ..; rm -rf $(vpp_vcl_install_dir)/vpp; \ + cp -rf vpp $(vpp_vcl_install_dir); \ + echo "--- Completed! ---" +endef + +define vpp_vcl_install_cmds + @true +endef + +define vpp_vcl_pkg_deb_cmds + @true +endef + +define vpp_vcl_pkg_deb_cp_cmds + @echo "--- copy deb to $(CURDIR)/dev-vcl ---" + @mkdir -p deb-vcl + @rm -f deb-vcl/* + @cp $(I)/openssl-deb/*.deb deb-vcl/. + @cp $(vpp_vcl_pkg_deb_dir)/*.deb deb-vcl/. +endef + +$(eval $(call package,vpp_vcl)) |