2020-11-18 20:05:06 -06:00
|
|
|
.ONESHELL:
|
|
|
|
SHELL = /bin/bash
|
|
|
|
.SHELLFLAGS += -e
|
|
|
|
|
2020-11-23 18:45:34 -06:00
|
|
|
LIBYANG_URL = https://sonicstorage.blob.core.windows.net/debian/pool/main/liby/libyang
|
|
|
|
|
|
|
|
DSC_FILE = libyang_$(LIBYANG1_FULLVERSION).dsc
|
|
|
|
ORIG_FILE = libyang_$(LIBYANG1_VERSION).orig.tar.gz
|
|
|
|
DEBIAN_FILE = libyang_$(LIBYANG1_FULLVERSION).debian.tar.xz
|
2020-11-18 20:05:06 -06:00
|
|
|
|
2020-11-23 18:45:34 -06:00
|
|
|
DSC_FILE_URL = $(LIBYANG_URL)/$(DSC_FILE)
|
|
|
|
ORIG_FILE_URL = $(LIBYANG_URL)/$(ORIG_FILE)
|
|
|
|
DEBIAN_FILE_URL = $(LIBYANG_URL)/$(DEBIAN_FILE)
|
|
|
|
|
|
|
|
MAIN_TARGET = $(LIBYANG1)
|
|
|
|
DERIVED_TARGETS = $(LIBYANG1_DEV) $(LIBYANG1_DBG) $(LIBYANG1_CPP) $(LIBYANG1_CPP_DEV) $(LIBYANG1_CPP_DBG) $(YANG_TOOLS) $(LIBYANG1_TOOLS) $(LIBYANG1_TOOLS_DBG)
|
2020-11-18 20:05:06 -06:00
|
|
|
|
|
|
|
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
|
|
|
|
# Obtaining the libyang
|
2020-11-23 18:45:34 -06:00
|
|
|
rm -fr ./libyang-$(LIBYANG1_VERSION)
|
|
|
|
|
|
|
|
# download debian libyang
|
|
|
|
wget -NO "$(DSC_FILE)" $(DSC_FILE_URL)
|
|
|
|
wget -NO "$(ORIG_FILE)" $(ORIG_FILE_URL)
|
|
|
|
wget -NO "$(DEBIAN_FILE)" $(DEBIAN_FILE_URL)
|
|
|
|
dpkg-source -x libyang_$(LIBYANG1_FULLVERSION).dsc
|
|
|
|
|
|
|
|
pushd libyang-$(LIBYANG1_VERSION)
|
|
|
|
sed -i 's/set(LIBYANG_MAJOR_SOVERSION 1)/set(LIBYANG_MAJOR_SOVERSION 2)/' CMakeLists.txt
|
|
|
|
sed -i 's/libyang1/libyang2/' debian/libyang1.install
|
2021-01-04 14:28:32 -06:00
|
|
|
# Enable large file support for 32-bit arch
|
|
|
|
echo 'add_definitions(-D_FILE_OFFSET_BITS=64)' >> CMakeLists.txt
|
|
|
|
|
2021-01-12 08:03:12 -06:00
|
|
|
dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
|
2020-11-18 20:05:06 -06:00
|
|
|
popd
|
2020-11-23 18:45:34 -06:00
|
|
|
|
|
|
|
# Move the newly-built .deb packages to the destination directory
|
|
|
|
mv $* $(DERIVED_TARGETS) $(DEST)/
|
2020-11-18 20:05:06 -06:00
|
|
|
|
|
|
|
$(addprefix $(DEST)/, $(DERIVED_TARGETS)): $(DEST)/% : $(DEST)/$(MAIN_TARGET)
|