aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
Diffstat (limited to 'packages')
-rw-r--r--packages/nginx_ldp.mk13
-rw-r--r--packages/nginx_vcl.mk15
-rw-r--r--packages/openssl.mk6
-rwxr-xr-xpackages/verify.sh69
-rw-r--r--packages/vpp_ldp.mk58
-rw-r--r--packages/vpp_vcl.mk55
6 files changed, 121 insertions, 95 deletions
diff --git a/packages/nginx_ldp.mk b/packages/nginx_ldp.mk
index f7756de..db9386a 100644
--- a/packages/nginx_ldp.mk
+++ b/packages/nginx_ldp.mk
@@ -41,14 +41,15 @@ endef
define nginx_ldp_build_cmds
@$(MAKE) -C $(nginx_ldp_src_dir)
+ @$(MAKE) -C $(nginx_ldp_src_dir) DESTDIR=$(B) install
+ @cp configs/mime.types $(B)$(nginx_ldp_install_dir)/conf/.
+ @cp configs/nginx.conf $(B)$(nginx_ldp_install_dir)/conf/.
+ @cp configs/tls-* $(B)$(nginx_ldp_install_dir)/conf/.
+ @cp configs/vcl.conf $(B)$(nginx_ldp_install_dir)/conf/.
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/.
+ @true
endef
define nginx_ldp_pkg_deb_cmds
@@ -56,7 +57,7 @@ define nginx_ldp_pkg_deb_cmds
-t deb \
-n $(nginx_ldp_pkg_deb_name) \
-v $(nginx_ldp_version) \
- -C $(nginx_ldp_install_dir) \
+ -C $(B)$(nginx_ldp_install_dir) \
-p $(nginx_ldp_pkg_deb_dir) \
--prefix $(nginx_ldp_deb_inst_dir) \
--license $(LICENSE) \
diff --git a/packages/nginx_vcl.mk b/packages/nginx_vcl.mk
index 2b3425f..3f2f80d 100644
--- a/packages/nginx_vcl.mk
+++ b/packages/nginx_vcl.mk
@@ -16,6 +16,8 @@ nginx_vcl_patch_dir := $(CURDIR)/nginx_patches
nginx_vcl_src_dir := $(B)/nginx_vcl
vpp_vcl_src_dir := $(CURDIR)/vpp
nginx_vcl_install_dir := /usr/local/nginx
+nginx_vcl_tmp1_dir := $(B)/nginx_vcl_backup1
+nginx_vcl_tmp2_dir := $(B)/nginx_vcl_backup2
nginx_vcl_deb_inst_dir := /usr/local/nginx
nginx_vcl_pkg_deb_name := nginx
nginx_vcl_pkg_deb_dir := $(I)/deb-vcl
@@ -46,14 +48,15 @@ endef
define nginx_vcl_build_cmds
@$(MAKE) -C $(nginx_vcl_src_dir)
+ @$(MAKE) -C $(nginx_vcl_src_dir) DESTDIR=$(B) install
+ @cp configs/mime.types $(B)$(nginx_vcl_install_dir)/conf/.
+ @cp configs/nginx.conf $(B)$(nginx_vcl_install_dir)/conf/.
+ @cp configs/tls-* $(B)$(nginx_vcl_install_dir)/conf/.
+ @cp configs/vcl.conf $(B)$(nginx_vcl_install_dir)/conf/.
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/.
+ @true
endef
define nginx_vcl_pkg_deb_cmds
@@ -61,7 +64,7 @@ define nginx_vcl_pkg_deb_cmds
-t deb \
-n $(nginx_vcl_pkg_deb_name) \
-v $(nginx_vcl_version) \
- -C $(nginx_vcl_install_dir) \
+ -C $(B)$(nginx_vcl_install_dir) \
-p $(nginx_vcl_pkg_deb_dir) \
--prefix $(nginx_vcl_deb_inst_dir) \
--license $(LICENSE) \
diff --git a/packages/openssl.mk b/packages/openssl.mk
index b31257a..227dce8 100644
--- a/packages/openssl.mk
+++ b/packages/openssl.mk
@@ -33,9 +33,9 @@ define openssl_config_cmds
endef
define openssl_build_cmds
- @$(MAKE) -C $(openssl_build_dir) depend
- @$(MAKE) -C $(openssl_build_dir)
- @$(MAKE) -C $(openssl_build_dir) install
+ $(MAKE) -C $(openssl_build_dir) depend
+ $(MAKE) -C $(openssl_build_dir)
+ $(MAKE) -C $(openssl_build_dir) install
endef
define openssl_install_cmds
diff --git a/packages/verify.sh b/packages/verify.sh
index 6b3d7a3..b849d68 100755
--- a/packages/verify.sh
+++ b/packages/verify.sh
@@ -3,21 +3,17 @@
ngxvcl=${BR}/_build/nginx_vcl
ngxldp=${BR}/_build/nginx_ldp
+tls_tcp=tls
+
function test_vcl(){
echo ""
echo "===================================================================="
echo "Testing ..."
echo ""
export LD_LIBRARY_PATH=/usr/local/ssl/lib
- cp ${BR}/configs/startup.conf ${BR}/configs/startup-test.conf
-
- sed -i 's|/var/log/vpp/vpp.log|/tmp/vpp.log|' ${BR}/configs/startup-test.conf
- sed -i 's|cli-vpp1.sock|cli.sock|' ${BR}/configs/startup-test.conf
- sed -i 's|/path/to/configs/vppenvset|configs/vppset|' ${BR}/configs/startup-test.conf
- sed -i 's|socket-name /path/to/vpp-api.sock|default|' ${BR}/configs/startup-test.conf
- echo "set int state local0 up" > ${BR}/configs/vppset
- ${BR}/vpp/build-root/install-vpp-native/vpp/bin/vpp -c configs/startup-test.conf &
+ cp ${BR}/configs/vppset-test /tmp/.
+ ${BR}/vpp/build-root/install-vpp-native/vpp/bin/vpp -c ${BR}/configs/startup-test.conf &
vpp_pid=$!
sleep 5
@@ -32,9 +28,16 @@ function test_vcl(){
sudo killall -v -s 9 nginx || echo "continue execute"
- cp ${BR}/configs/nginx.conf ${BR}/configs/nginx-test.conf
- sed -i 's|#worker_processes 1|worker_processes 1|' ${BR}/configs/nginx-test.conf
-
+ mdir=0
+ if [ ! -d /usr/local/nginx/logs ]; then
+ mdir=2
+ if [ ! -d /usr/local/nginx ]; then
+ mdir=1
+ fi
+ fi
+ if [ ${mdir} -ne 0 ]; then
+ mkdir -p /usr/local/nginx/logs
+ fi
${ngxvcl}/objs/nginx -c ${BR}/configs/nginx-test.conf &
nginx_pid=$!
sleep 5
@@ -60,10 +63,13 @@ function test_vcl(){
sudo killall -v -s 9 nginx || echo ""
sudo kill -9 ${vpp_pid} || echo ""
- rm -f ${BR}/configs/nginx-test.conf
- rm -f ${BR}/configs/startup-test.conf
- rm -f ${BR}/configs/vppset
- rm -f /tmp/vpp.log
+
+ rm /tmp/vppset-test
+ if [ ${mdir} -eq 1 ]; then
+ rm -rf /usr/local/nginx
+ elif [ ${mdir} -eq 2 ]; then
+ rm -rf /usr/local/nginx/logs
+ fi
if [ ${ret} -eq 1 ]; then
exit 1;
@@ -77,21 +83,23 @@ function test_ldp(){
echo ""
export LD_LIBRARY_PATH=/usr/local/ssl/lib
- cp ${BR}/configs/startup.conf ${BR}/configs/startup-test.conf
-
- sed -i 's|/var/log/vpp/vpp.log|/tmp/vpp.log|' ${BR}/configs/startup-test.conf
- sed -i 's|cli-vpp1.sock|cli.sock|' ${BR}/configs/startup-test.conf
- sed -i 's|/path/to/configs/vppenvset|configs/vppset|' ${BR}/configs/startup-test.conf
- sed -i 's|socket-name /path/to/vpp-api.sock|default|' ${BR}/configs/startup-test.conf
- echo "set int state local0 up" > ${BR}/configs/vppset
- ${BR}/vpp/build-root/install-vpp-native/vpp/bin/vpp -c configs/startup-test.conf &
+ cp ${BR}/configs/vppset-test /tmp/.
+ ${BR}/vpp/build-root/install-vpp-native/vpp/bin/vpp -c ${BR}/configs/startup-test.conf &
vpp_pid=$!
sleep 5
- cp ${BR}/configs/nginx.conf ${BR}/configs/nginx-test.conf
- sed -i 's|#worker_processes 1|worker_processes 1|' ${BR}/configs/nginx-test.conf
+ mdir=0
+ if [ ! -d /usr/local/nginx/logs ]; then
+ mdir=2
+ if [ ! -d /usr/local/nginx ]; then
+ mdir=1
+ fi
+ fi
+ if [ ${mdir} -ne 0 ]; then
+ mkdir -p /usr/local/nginx/logs
+ fi
export VCL_CONFIG=${BR}/configs/vcl.conf
export LDP_TRANSPARENT_TLS=1
@@ -113,7 +121,6 @@ function test_ldp(){
ret=1
fi
-
v=`ps -A|grep "${nginx_pid}" | wc -l`
if [ ${v} -eq 1 ]; then
echo "LDP test: nginx OK"
@@ -126,10 +133,12 @@ function test_ldp(){
sudo killall -v -s 9 nginx || echo ""
sudo kill -9 ${vpp_pid} || echo ""
- rm -f ${BR}/configs/nginx-test.conf
- rm -f ${BR}/configs/startup-test.conf
- rm -f ${BR}/configs/vppset
- rm -rf /tmp/vpp.log
+ rm /tmp/vppset-test
+ if [ ${mdir} -eq 1 ]; then
+ rm -rf /usr/local/nginx
+ elif [ ${mdir} -eq 2 ]; then
+ rm -rf /usr/local/nginx/logs
+ fi
if [ ${ret} -eq 1 ]; then
exit 1
diff --git a/packages/vpp_ldp.mk b/packages/vpp_ldp.mk
index 8b1fd7a..05e8398 100644
--- a/packages/vpp_ldp.mk
+++ b/packages/vpp_ldp.mk
@@ -27,8 +27,8 @@ 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 [ $(_VPP_VER) != "master" ] ; then \
+ git reset --hard; git clean -f; git checkout $(MAIN_BRANCH); \
+ if [ $(_VPP_VER) != $(MAIN_BRANCH) ] ; then \
echo "--- vpp version: $(_VPP_VER) ---"; \
if [ $(_VPP_VER) = "2005" ]; then \
git checkout v20.05; \
@@ -41,14 +41,20 @@ define vpp_ldp_patch_cmds
echo Applying patch: $$(basename $$f) ; \
patch -p1 -d $(vpp_ldp_src_dir) < $$f ; \
done
- @if [ $(openssl3_enable) = 1 ]; then \
+ @if [ $(openssl3_enable) -eq 1 ]; then \
for f in $(CURDIR)/vpp_patches/other/*.patch ; do \
echo Applying patch: $$(basename $$f) ; \
patch -p1 -d $(vpp_vcl_src_dir) < $$f ; \
done; \
- if [ $(_VPP_VER) = "master" -o $(_VPP_VER) = "2005" ]; then \
- echo "--- vpp master ---"; \
- for f in $(CURDIR)/vpp_patches/other/master/*; do \
+ if [ $(_VPP_VER) = $(MAIN_BRANCH) ]; then \
+ echo "--- vpp $(MAIN_BRANCH) ---"; \
+ for f in $(CURDIR)/vpp_patches/other/$(MAIN_BRANCH)/*; do \
+ echo Applying patch: $$(basename $$f) ; \
+ patch -p1 -d $(vpp_ldp_src_dir) < $$f ; \
+ done; \
+ elif [ $(_VPP_VER) = "2005" ]; then \
+ echo "--- vpp 20.05 ---"; \
+ for f in $(CURDIR)/vpp_patches/other/2005/*; do \
echo Applying patch: $$(basename $$f) ; \
patch -p1 -d $(vpp_ldp_src_dir) < $$f ; \
done; \
@@ -60,25 +66,6 @@ define vpp_ldp_patch_cmds
done; \
fi; \
fi
- @if [ $(_VPP_VER) = "master" ]; 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) = "2005" ]; then \
- echo "--- patch v20.05 ---"; \
- for f in $(CURDIR)/vpp_patches/ldp/2005/*.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
@@ -90,16 +77,15 @@ endef
define vpp_ldp_build_cmds
@cd $(vpp_ldp_src_dir); \
echo "---build : $(vpp_ldp_src_dir)"; \
- if [ $(openssl3_enable) = 1 ]; then \
+ if [ $(openssl3_enable) -eq 1 ]; then \
export OPENSSL_ROOT_DIR=$(openssl_install_dir); \
export LD_LIBRARY_PATH=$(openssl_install_dir)/lib; \
fi; \
$(MAKE) wipe-release; $(MAKE) wipe; \
cd build-root; $(MAKE) distclean; cd ..; \
- if [ $(debug) = 1 ]; then $(MAKE) build; \
+ if [ $(debug) -eq 1 ]; then $(MAKE) build; \
else $(MAKE) build-release; \
- fi; \
- $(MAKE) pkg-deb;
+ fi
endef
define vpp_ldp_install_cmds
@@ -107,15 +93,23 @@ define vpp_ldp_install_cmds
endef
define vpp_ldp_pkg_deb_cmds
- @true
+ @cd $(vpp_ldp_src_dir); \
+ echo "---build deb: $(vpp_ldp_src_dir)"; \
+ if [ $(openssl3_enable) -eq 1 ]; then \
+ export OPENSSL_ROOT_DIR=$(openssl_install_dir); \
+ export LD_LIBRARY_PATH=$(openssl_install_dir)/lib; \
+ fi; \
+ $(MAKE) pkg-deb;
endef
define vpp_ldp_pkg_deb_cp_cmds
@echo "--- move deb to $(CURDIR)/deb-ldp ---"
@mkdir -p deb-ldp
@ls deb-ldp/ ;rm -f deb-ldp/*
- @mv $(I)/openssl-deb/*.deb .
- @rm $(B)/.openssl.pkg-deb.ok
+ @if [ $(openssl3_enable) -eq 1 ]; then \
+ mv $(I)/openssl-deb/*.deb .; \
+ rm $(B)/.openssl.pkg-deb.ok; \
+ fi
@mv $(vpp_ldp_pkg_deb_dir)/*.deb deb-ldp/.
endef
diff --git a/packages/vpp_vcl.mk b/packages/vpp_vcl.mk
index 2b2dd64..a923d01 100644
--- a/packages/vpp_vcl.mk
+++ b/packages/vpp_vcl.mk
@@ -27,8 +27,8 @@ endef
define vpp_vcl_patch_cmds
@echo "--- vpp patching ---"
@cd $(vpp_vcl_src_dir); \
- git reset --hard; git clean -f; git checkout master; \
- if [ $(_VPP_VER) != "master" ]; then \
+ git reset --hard; git clean -f; git checkout $(MAIN_BRANCH); \
+ if [ $(_VPP_VER) != $(MAIN_BRANCH) ]; then \
echo "--- vpp version: $(_VPP_VER) ---"; \
if [ $(_VPP_VER) = "2005" ]; then \
git checkout v20.05; \
@@ -41,14 +41,20 @@ define vpp_vcl_patch_cmds
echo Applying patch: $$(basename $$f) ; \
patch -p1 -d $(vpp_vcl_src_dir) < $$f ; \
done
- @if [ $(openssl3_enable) = 1 ]; then \
+ @if [ $(openssl3_enable) -eq 1 ]; then \
for f in $(CURDIR)/vpp_patches/other/*.patch ; do \
echo Applying patch: $$(basename $$f) ; \
patch -p1 -d $(vpp_vcl_src_dir) < $$f ; \
done; \
- if [ $(_VPP_VER) = "2005" -o $(_VPP_VER) = "master" ]; then \
- echo "--- vpp master ---"; \
- for f in $(CURDIR)/vpp_patches/other/master/*.patch;do\
+ if [ $(_VPP_VER) = $(MAIN_BRANCH) ]; then \
+ echo "--- vpp $(MAIN_BRANCH) ---"; \
+ for f in $(CURDIR)/vpp_patches/other/$(MAIN_BRANCH)/*.patch;do\
+ echo Applying patch: $$(basename $$f) ; \
+ patch -p1 -d $(vpp_vcl_src_dir) < $$f ; \
+ done; \
+ elif [ $(_VPP_VER) = "2005" ]; then \
+ echo "--- vpp 20.05 ---"; \
+ for f in $(CURDIR)/vpp_patches/other/2005/*.patch;do\
echo Applying patch: $$(basename $$f) ; \
patch -p1 -d $(vpp_vcl_src_dir) < $$f ; \
done; \
@@ -60,11 +66,17 @@ define vpp_vcl_patch_cmds
done; \
fi; \
fi
- @for f in $(CURDIR)/vpp_patches/vcl/*.patch ; do \
- echo Applying patch: $$(basename $$f) ; \
- patch -p1 -d $(vpp_vcl_src_dir) < $$f ; \
- done
-
+ @if [ $(_VPP_VER) = $(MAIN_BRANCH) ]; then \
+ for f in $(CURDIR)/vpp_patches/vcl/$(MAIN_BRANCH)/*.patch ; do \
+ echo Applying patch: $$(basename $$f) ; \
+ patch -p1 -d $(vpp_vcl_src_dir) < $$f ; \
+ done; \
+ else \
+ for f in $(CURDIR)/vpp_patches/vcl/other/*.patch ; do \
+ echo Applying patch: $$(basename $$f) ; \
+ patch -p1 -d $(vpp_vcl_src_dir) < $$f ; \
+ done; \
+ fi
@true
endef
@@ -76,16 +88,15 @@ endef
define vpp_vcl_build_cmds
@cd $(vpp_vcl_src_dir); \
echo "--- build : $(vpp_vcl_src_dir)"; \
- if [ $(openssl3_enable) = 1 ]; then \
+ if [ $(openssl3_enable) -eq 1 ]; then \
export OPENSSL_ROOT_DIR=$(openssl_install_dir); \
export LD_LIBRARY_PATH=$(openssl_install_dir)/lib; \
fi; \
$(MAKE) wipe-release; $(MAKE) wipe; \
cd build-root; $(MAKE) distclean; cd ..; \
- if [ $(debug) = 1 ]; then $(MAKE) build;\
+ if [ $(debug) -eq 1 ]; then $(MAKE) build;\
else $(MAKE) build-release; \
- fi; \
- $(MAKE) pkg-deb;
+ fi
endef
define vpp_vcl_install_cmds
@@ -93,15 +104,23 @@ define vpp_vcl_install_cmds
endef
define vpp_vcl_pkg_deb_cmds
- @true
+ @cd $(vpp_vcl_src_dir); \
+ echo "--- build deb : $(vpp_vcl_src_dir)"; \
+ if [ $(openssl3_enable) -eq 1 ]; then \
+ export OPENSSL_ROOT_DIR=$(openssl_install_dir); \
+ export LD_LIBRARY_PATH=$(openssl_install_dir)/lib; \
+ fi; \
+ $(MAKE) pkg-deb;
endef
define vpp_vcl_pkg_deb_cp_cmds
@echo "--- move deb to $(CURDIR)/dev-vcl ---"
@mkdir -p deb-vcl
@rm -f deb-vcl/*
- @mv $(I)/openssl-deb/*.deb .
- @rm $(B)/.openssl.pkg-deb.ok
+ @if [ $(openssl3_enable) -eq 1 ]; then \
+ mv $(I)/openssl-deb/*.deb .; \
+ rm $(B)/.openssl.pkg-deb.ok; \
+ fi
@mv $(vpp_vcl_pkg_deb_dir)/*.deb deb-vcl/.
endef