From 655ca61b2b944396ff4b7ca174aa79a7b55db8bc Mon Sep 17 00:00:00 2001 From: Konstantin Pavlov Date: Fri, 22 Nov 2024 05:20:31 +0000 Subject: Packages: support rpm 4.20+ In 4.20, rpm changed the way build roots are named. Our packaging relies on the symlinks being created as a part of a rule to make sure targets are being built correctly. This patch implements (a hacky) way to check what the build root should be named on a currently running rpm version and adjusts the symlinks accordingly. --- pkg/rpm/Makefile | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'pkg/rpm/Makefile') diff --git a/pkg/rpm/Makefile b/pkg/rpm/Makefile index f00b336a..8e353459 100644 --- a/pkg/rpm/Makefile +++ b/pkg/rpm/Makefile @@ -174,8 +174,9 @@ rpmbuild/SOURCES/unit-$(VERSION).tar.gz: unit: check-build-depends-unit rpmbuild/SPECS/unit.spec rpmbuild/SOURCES/unit-$(VERSION).tar.gz @echo "===> Building $@ package" ; \ + BUILDROOT=`rpmbuild -bc --short-circuit -D "_topdir \`pwd\`/rpmbuild" -D "__spec_build_pre echo bdir=%{_builddir}; exit 0" rpmbuild/SPECS/unit.spec | grep ^bdir= | cut -d'=' -f 2` ; \ rpmbuild -D "_topdir `pwd`/rpmbuild" -ba --noclean rpmbuild/SPECS/unit.spec && \ - ln -s rpmbuild/BUILD/$@-$(VERSION)/build $@ + ln -s $$BUILDROOT/$@-$(VERSION)/build $@ rpmlint: find rpmbuild/ -name "*.rpm" -print -exec rpmlint {} \; @@ -227,29 +228,34 @@ rpmbuild/SPECS/unit-%.spec: unit.module.spec.in ../../docs/changes.xml | rpmbuil unit-%: check-build-depends-% rpmbuild/SPECS/unit-%.spec rpmbuild/SOURCES/unit-$(VERSION).tar.gz @echo "===> Building $(subst _,-,$@) package" ; \ + BUILDROOT=`rpmbuild -bc --short-circuit -D "_topdir \`pwd\`/rpmbuild" -D "__spec_build_pre echo bdir=%{_builddir}; exit 0" rpmbuild/SPECS/$@.spec | grep ^bdir= | cut -d'=' -f 2` ; \ rpmbuild -D "_topdir `pwd`/rpmbuild" -ba --noclean rpmbuild/SPECS/$@.spec && \ - ln -s rpmbuild/BUILD/$(subst _,-,$@)-$(VERSION)/build $@ + ln -s $$BUILDROOT/$(subst _,-,$@)-$(VERSION)/build $@ test: unit modules @{ \ - for so in `find rpmbuild/BUILD/*/build-nodebug/ -type f \( -name "*.so" -o -name "*.jar" \)`; do \ + BUILDROOT=`rpmbuild -bc --short-circuit -D "_topdir \`pwd\`/rpmbuild" -D "__spec_build_pre echo bdir=%{_builddir}; exit 0" rpmbuild/SPECS/unit.spec | grep ^bdir= | cut -d'=' -f 2` ; \ + NODEBUGS=`find rpmbuild/BUILD -type d -name "build-nodebug"` ; \ + for so in `find $${NODEBUGS} -type f \( -name "*.so" -o -name "*.jar" \)`; do \ soname=`basename $${so}` ; \ test "$${soname}" = "java.unit.so" && continue ; \ - test -h rpmbuild/BUILD/unit-$(VERSION)/build-nodebug/$${soname} || \ - ln -fs `pwd`/$${so} rpmbuild/BUILD/unit-$(VERSION)/build-nodebug/$${soname} ; \ + test -h $$BUILDROOT/unit-$(VERSION)/build-nodebug/$${soname} || \ + ln -fs `pwd`/$${so} $$BUILDROOT/unit-$(VERSION)/build-nodebug/$${soname} ; \ done ; \ - ( cd rpmbuild/BUILD/unit-$(VERSION) && rm -f build && ln -s build-nodebug build && env python3 -m pytest --user=nobody $(PYTEST_ARGS) ) ; \ + ( cd $$BUILDROOT/unit-$(VERSION) && rm -f build && ln -s build-nodebug build && env python3 -m pytest --user=nobody $(PYTEST_ARGS) ) ; \ } test-debug: unit modules @{ \ - for so in `find rpmbuild/BUILD/*/build-debug/ -type f \( -name "*.so" -o -name "*.jar" \)`; do \ + BUILDROOT=`rpmbuild -bc --short-circuit -D "_topdir \`pwd\`/rpmbuild" -D "__spec_build_pre echo bdir=%{_builddir}; exit 0" rpmbuild/SPECS/unit.spec | grep ^bdir= | cut -d'=' -f 2` ; \ + DEBUGS=`find rpmbuild/BUILD -type d -name "build-debug"` ; \ + for so in `find $$DEBUGS -type f \( -name "*.so" -o -name "*.jar" \)`; do \ soname=`basename $${so}` ; \ test "$${soname}" = "java.unit.so" && continue ; \ - test -h rpmbuild/BUILD/unit-$(VERSION)/build-debug/$${soname} || \ - ln -fs `pwd`/$${so} rpmbuild/BUILD/unit-$(VERSION)/build-debug/$${soname} ; \ + test -h $$BUILDROOT/unit-$(VERSION)/build-debug/$${soname} || \ + ln -fs `pwd`/$${so} $$BUILDROOT/unit-$(VERSION)/build-debug/$${soname} ; \ done ; \ - ( cd rpmbuild/BUILD/unit-$(VERSION) && rm -f build && ln -s build-debug build && env python3 -m pytest --user=nobody $(PYTEST_ARGS) ) ; \ + ( cd $$BUILDROOT/unit-$(VERSION) && rm -f build && ln -s build-debug build && env python3 -m pytest --user=nobody $(PYTEST_ARGS) ) ; \ } clean: -- cgit From 19f403f5d015058399511af0fe3533899bbe506c Mon Sep 17 00:00:00 2001 From: Konstantin Pavlov Date: Thu, 21 Nov 2024 18:32:28 -0800 Subject: Packages: add Fedora 41 support While at it, removed support for Fedora 39 as it's EOL. --- pkg/rpm/Makefile | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'pkg/rpm/Makefile') diff --git a/pkg/rpm/Makefile b/pkg/rpm/Makefile index 8e353459..63213dc8 100644 --- a/pkg/rpm/Makefile +++ b/pkg/rpm/Makefile @@ -18,8 +18,10 @@ else ifeq ($(shell rpm --eval "%{?amzn}"), 2) OSVER = amazonlinux2 else ifeq ($(shell rpm --eval "%{?amzn}"), 2023) OSVER = amazonlinux2023 -else ifeq ($(shell test `rpm --eval '0%{?fedora} -ge 39'`; echo $$?),0) -OSVER = fedora39 +else ifeq ($(shell test `rpm --eval '0%{?fedora} -eq 40'`; echo $$?),0) +OSVER = fedora40 +else ifeq ($(shell test `rpm --eval '0%{?fedora} -eq 41'`; echo $$?),0) +OSVER = fedora41 endif BUILD_DEPENDS_unit = gcc rpm-build rpmlint clang llvm @@ -81,7 +83,7 @@ include Makefile.jsc17 include Makefile.wasm endif -ifeq ($(OSVER), fedora39) +ifeq ($(OSVER), fedora40) include Makefile.php include Makefile.python312 include Makefile.go @@ -92,6 +94,17 @@ include Makefile.jsc17 include Makefile.wasm endif +ifeq ($(OSVER), fedora41) +include Makefile.php +include Makefile.python313 +include Makefile.go +include Makefile.perl +include Makefile.ruby +include Makefile.jsc-common +include Makefile.jsc17 +include Makefile.jsc21 +include Makefile.wasm +endif CONFIGURE_ARGS_COMMON=\ --prefix=/usr \ -- cgit From 6f9954bdc044add9eeeb65c2fb67d553b32e9214 Mon Sep 17 00:00:00 2001 From: Konstantin Pavlov Date: Fri, 13 Dec 2024 03:40:17 +0000 Subject: Packages: enable otel support --- pkg/rpm/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pkg/rpm/Makefile') diff --git a/pkg/rpm/Makefile b/pkg/rpm/Makefile index 63213dc8..fed2d290 100644 --- a/pkg/rpm/Makefile +++ b/pkg/rpm/Makefile @@ -122,7 +122,8 @@ CONFIGURE_ARGS_COMMON=\ CONFIGURE_ARGS=\ $(CONFIGURE_ARGS_COMMON) \ - --njs + --njs \ + --otel export CR=\\n -- cgit