summaryrefslogtreecommitdiffstats
path: root/fuel/build/opendaylight
diff options
context:
space:
mode:
Diffstat (limited to 'fuel/build/opendaylight')
-rw-r--r--fuel/build/opendaylight/Makefile28
-rw-r--r--fuel/build/opendaylight/f_odl/Makefile2
-rwxr-xr-xfuel/build/opendaylight/make-odl-deb.sh32
3 files changed, 42 insertions, 20 deletions
diff --git a/fuel/build/opendaylight/Makefile b/fuel/build/opendaylight/Makefile
index 9c3d22d..c112ff6 100644
--- a/fuel/build/opendaylight/Makefile
+++ b/fuel/build/opendaylight/Makefile
@@ -34,20 +34,42 @@ all: odl
.PHONY: setup
setup:
- @if [ ! -d "$(TOPDIR)/f_odl" ]; then ln -s "$(realpath $(BUILD_DIR))/f_odl" "$(realpath $(TOPDIR))/f_odl"; fi
+ rm -f "$(BUILD_BASE)/f_odl"
+ ln -s "$(shell readlink -e $(BUILD_DIR))/f_odl" "$(shell readlink -e $(BUILD_BASE))/f_odl"
+
+.PHONY: check-cache-validity
+check-cache-validity:
+ @if [ $(git ls-remote $(ODL_MAIN_REPO) $(ODL_MAIN_TAG) | awk '{print $(NF-1)}') -ne $(cat $(CACHE_DIR)/.versions | grep odl | awk '{print $NF}') ]; then @echo "Cache is not up to date, stopping!"; exit 1; fi
.PHONY: odl
odl:
+
ifeq ($(ODL_MAIN_REPO),)
@echo "No config-spec target for ODL, nothing to build"
else
ifeq ($(shell if [ -e .odl-build.log ];then cat .odl-build.log; fi;),$(ODL_MAIN_TAG))
@cd /tmp && git clone $(ODL_MAIN_REPO) && cd /tmp/controller && git checkout $(ODL_MAIN_TAG)
+
@echo "ODL is up to date"
else
- @if [ ! -d "/tmp/controller" ]; then cd /tmp && git clone $(ODL_MAIN_REPO); fi;
- @cd /tmp/controller && git checkout $(ODL_MAIN_TAG) && mvn -Dmaven.test.skip=true -gs $(MAVEN_SPEC) clean install;
+ @if [ ! -d "/tmp/controller" ]; then\
+ cd /tmp && git clone $(ODL_MAIN_REPO);\
+ fi;
+
+ @if [ "$(UNIT_TEST)" = "FALSE" ]; then\
+ echo "Building ODL without unit test";\
+ cd /tmp/controller &&\
+ git checkout $(ODL_MAIN_TAG) &&\
+ mvn -D maven.test.skip=true -gs $(MAVEN_SPEC) clean install;\
+ else\
+ echo "Building ODL with unit test";\
+ cd /tmp/controller &&\
+ git checkout $(ODL_MAIN_TAG) &&\
+ mvn -gs $(MAVEN_SPEC) clean install;\
+ fi;
+
+ @echo "odl" `git -C /tmp/controller show | grep commit | rev | cut -f1 -d " "` >> $(BUILD_BASE)/.versions
@./make-odl-deb.sh -N $(ODL_SHORT_NAME)_`cd /tmp/controller; git rev-parse --short HEAD` -n $(ODL_SHORT_NAME) -v "$(ODL_VERSION)" -t "$(ODL_MAIN_TAG)" -m $(MAINTAINER) -d $(DEPEND) -p $(TARGET_BUILD_PATH)
@echo $(ODL_MAIN_TAG) > .odl-build.log
endif
diff --git a/fuel/build/opendaylight/f_odl/Makefile b/fuel/build/opendaylight/f_odl/Makefile
index 8ac5108..6983f0c 100644
--- a/fuel/build/opendaylight/f_odl/Makefile
+++ b/fuel/build/opendaylight/f_odl/Makefile
@@ -23,7 +23,7 @@ ifeq ($(ODL_MAIN_REPO),)
else
@mkdir -p tmp/src
@mkdir -p release/pool/main
- @cp -rp $(DEB_NAME) tmp/src
+ @cp -rp package/$(DEB_NAME) tmp/src
@gzip -f9 tmp/src/$(DEB_NAME)/usr/share/doc/$(ODL_NAME_SHORT)/changelog.Debian
@fakeroot dpkg-deb --build tmp/src/$(DEB_NAME)
@lintian tmp/src/$(DEB_NAME).deb
diff --git a/fuel/build/opendaylight/make-odl-deb.sh b/fuel/build/opendaylight/make-odl-deb.sh
index 24974dc..5222087 100755
--- a/fuel/build/opendaylight/make-odl-deb.sh
+++ b/fuel/build/opendaylight/make-odl-deb.sh
@@ -260,11 +260,11 @@ do
done
# Constructing script variables
-DEB_PACK_BASE_PATH="f_${PACKAGE_SHORT_NAME}/${PACKAGE_NAME}_${PACKAGE_VERSION}/"
+DEB_PACK_BASE_PATH="f_${PACKAGE_SHORT_NAME}/package/${PACKAGE_NAME}_${PACKAGE_VERSION}"
echo ${DEB_PACK_BASE_PATH} >> "$BUILD_HISTORY"
TARGET_INSTALL_PATH="/usr/share/java/${PACKAGE_SHORT_NAME}/"
-DEB_PACK_CONTENT_PATH="${DEB_PACK_BASE_PATH}usr/share/java/${PACKAGE_SHORT_NAME}/"
-DEB_PACK_CONFIG_PATH="${DEB_PACK_BASE_PATH}etc/${PACKAGE_SHORT_NAME}"
+DEB_PACK_CONTENT_PATH="${DEB_PACK_BASE_PATH}/usr/share/java/${PACKAGE_SHORT_NAME}/"
+DEB_PACK_CONFIG_PATH="${DEB_PACK_BASE_PATH}/etc/${PACKAGE_SHORT_NAME}"
TARGET_TAR=$(ls ${TARGET_BUILD_PATH}*.tar.gz)
TARGET_TAR="${TARGET_TAR##*/}"
TAR_PATH="${TARGET_TAR%.*}"
@@ -295,20 +295,20 @@ find ${DEB_PACK_CONFIG_PATH}/etc/ -type f -print -exec chmod 644 {} \;
find ${DEB_PACK_CONFIG_PATH}/etc/ -type d -print -exec chmod 755 {} \;
# Create package usr/bin odl script
-mkdir "${DEB_PACK_BASE_PATH}usr/bin"
-chmod 755 "${DEB_PACK_BASE_PATH}usr/bin"
-make-DEBIAN_bin > "${DEB_PACK_BASE_PATH}usr/bin/odl"
-chmod 755 "${DEB_PACK_BASE_PATH}usr/bin/odl"
+mkdir "${DEB_PACK_BASE_PATH}/usr/bin"
+chmod 755 "${DEB_PACK_BASE_PATH}/usr/bin"
+make-DEBIAN_bin > "${DEB_PACK_BASE_PATH}/usr/bin/odl"
+chmod 755 "${DEB_PACK_BASE_PATH}/usr/bin/odl"
# Create Deb pack install meta-data
-mkdir "${DEB_PACK_BASE_PATH}DEBIAN"
-make-DEBIAN_control > "${DEB_PACK_BASE_PATH}DEBIAN/control"
-make-DEBIAN_conffiles > "${DEB_PACK_BASE_PATH}DEBIAN/conffiles"
-mkdir -p "${DEB_PACK_BASE_PATH}usr/share/doc/${PACKAGE_SHORT_NAME}"
-make-DEBIAN_copyright > "${DEB_PACK_BASE_PATH}usr/share/doc/${PACKAGE_SHORT_NAME}/copyright"
-make-DEBIAN_changelog > "${DEB_PACK_BASE_PATH}usr/share/doc/${PACKAGE_SHORT_NAME}/changelog.Debian"
+mkdir "${DEB_PACK_BASE_PATH}/DEBIAN"
+make-DEBIAN_control > "${DEB_PACK_BASE_PATH}/DEBIAN/control"
+make-DEBIAN_conffiles > "${DEB_PACK_BASE_PATH}/DEBIAN/conffiles"
+mkdir -p "${DEB_PACK_BASE_PATH}/usr/share/doc/${PACKAGE_SHORT_NAME}"
+make-DEBIAN_copyright > "${DEB_PACK_BASE_PATH}/usr/share/doc/${PACKAGE_SHORT_NAME}/copyright"
+make-DEBIAN_changelog > "${DEB_PACK_BASE_PATH}/usr/share/doc/${PACKAGE_SHORT_NAME}/changelog.Debian"
# Create Deb pack post install symlinks and usr/bin scripts
-make-DEBIAN_postinst > "${DEB_PACK_BASE_PATH}DEBIAN/postinst"
-chmod 755 "${DEB_PACK_BASE_PATH}DEBIAN/postinst"
-mkdir -p "${DEB_PACK_BASE_PATH}usr/bin"
+make-DEBIAN_postinst > "${DEB_PACK_BASE_PATH}/DEBIAN/postinst"
+chmod 755 "${DEB_PACK_BASE_PATH}/DEBIAN/postinst"
+mkdir -p "${DEB_PACK_BASE_PATH}/usr/bin"