SHELL:=/bin/bash UBUNTU_VERSION ?= 2404 CODENAME ?= noble VERSION:=1.20.0 build: $(CODENAME)/cppse-opentelemetry_$(VERSION)_amd64.deb $(CODENAME)/cppse-opentelemetry_$(VERSION)_amd64.deb: mkdir -p $(CODENAME) make ubuntu$(UBUNTU_VERSION) ubuntu$(UBUNTU_VERSION): git clone --recurse-submodules https://github.com/open-telemetry/opentelemetry-cpp || true git checkout v$(VERSION) || true mkdir -p out bash ../ubuntu$(UBUNTU_VERSION).sh make opentelem make package-ubuntu$(UBUNTU_VERSION) .PHONY : opentelem opentelem: pushd opentelemetry-cpp && \ set -ex && \ git config --global --add safe.directory $$PWD && \ git checkout v1.8.3 && \ mkdir -p build && \ cd build && \ sudo apt update && \ sudo apt install libcurl4-openssl-dev libprotobuf-dev -y && \ cmake -DBUILD_PACKAGE:BOOL=on -DBUILD_TESTING=off -DWITH_OTLP_HTTP=on -DWITH_OTLP_HTTP=on -DWITH_EXAMPLES=off .. && \ cmake --build . --target all && \ echo cpack -G DEB && \ popd # # for some reason this whole package build stuff doesn't work.. # and ditto for the --install target.. ffs. # #cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=$$PWD/../out/ -DBUILD_TESTING=off -DBUILD_PACKAGE=ON .. && \ #cmake --build . --target all && \ #cmake --version && \ #cmake --install . --prefix $$PWD/../../out/ -v && \ #cpack -C debug && \ package-ubuntu$(UBUNTU_VERSION): rm -rf pkg_out mkdir -p pkg_out/opt/cppse/build/ rsync -raPv out/ pkg_out/opt/cppse/build/ rm -rf $(CODENAME)/cppse-opentelemetry_*_amd64.deb docker run -v "$$(pwd):/src/" rayburgemeestre/fpm-ubuntu:24.04 fpm -f -v $(VERSION) --iteration $(CODENAME) -s dir -t deb -n cppse-opentelemetry --license MPL2 --maintainer "Ray Burgemeestre " --description "opentelemetry - build dependency" --url "https://github.com/open-telemetry/opentelemetry-cpp" --deb-generate-changes -C /src/pkg_out cp -prv cppse-opentelemetry_*_amd64.deb $(CODENAME)/ clean: sudo rm -rf opentelemetry-cpp sudo rm -rf out sudo rm -rf pkg_out shell: FLAGS="-i --privileged" bash ../ubuntu$(UBUNTU_VERSION).sh /bin/bash