From ab3d1297af91bf8ade401ec4548d53f963788d14 Mon Sep 17 00:00:00 2001 From: Konstantin Pavlov Date: Wed, 28 Dec 2022 20:06:43 -0800 Subject: Packages: do not clean up rpm build root. These directories are used in the Makefile to determine status of a target. --- pkg/rpm/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkg/rpm') diff --git a/pkg/rpm/Makefile b/pkg/rpm/Makefile index d00a25ac..5c104ca3 100644 --- a/pkg/rpm/Makefile +++ b/pkg/rpm/Makefile @@ -184,7 +184,7 @@ rpmbuild/SOURCES/unit-$(VERSION).tar.gz: unit: check-build-depends-unit rpmbuild/SPECS/unit.spec rpmbuild/SOURCES/unit-$(VERSION).tar.gz @echo "===> Building $@ package" ; \ - rpmbuild -D "_topdir `pwd`/rpmbuild" -ba rpmbuild/SPECS/unit.spec && \ + rpmbuild -D "_topdir `pwd`/rpmbuild" -ba --noclean rpmbuild/SPECS/unit.spec && \ ln -s rpmbuild/BUILD/$@-$(VERSION)/build $@ rpmlint: @@ -235,7 +235,7 @@ 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" ; \ - rpmbuild -D "_topdir `pwd`/rpmbuild" -ba rpmbuild/SPECS/$@.spec && \ + rpmbuild -D "_topdir `pwd`/rpmbuild" -ba --noclean rpmbuild/SPECS/$@.spec && \ ln -s rpmbuild/BUILD/$(subst _,-,$@)-$(VERSION)/build $@ test: unit modules -- cgit From b0bb829107094a64ed6c93b88b6ed4847bd3fa53 Mon Sep 17 00:00:00 2001 From: Konstantin Pavlov Date: Mon, 6 Feb 2023 12:39:06 -0800 Subject: Packages: get rid of deprecated configure options. --- pkg/rpm/Makefile | 4 ++-- pkg/rpm/unit.module.spec.in | 4 ++-- pkg/rpm/unit.spec.in | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'pkg/rpm') diff --git a/pkg/rpm/Makefile b/pkg/rpm/Makefile index 5c104ca3..a6efb625 100644 --- a/pkg/rpm/Makefile +++ b/pkg/rpm/Makefile @@ -108,11 +108,11 @@ endif CONFIGURE_ARGS_COMMON=\ --prefix=/usr \ - --state=%{_sharedstatedir}/unit \ + --libstatedir=%{_sharedstatedir}/unit \ --control="unix:/var/run/unit/control.sock" \ --pid=/var/run/unit/unit.pid \ --log=/var/log/unit/unit.log \ - --tmp=/var/tmp \ + --tmpdir=/var/tmp \ --user=unit \ --group=unit \ --tests \ diff --git a/pkg/rpm/unit.module.spec.in b/pkg/rpm/unit.module.spec.in index bc68a254..04323afc 100644 --- a/pkg/rpm/unit.module.spec.in +++ b/pkg/rpm/unit.module.spec.in @@ -61,7 +61,7 @@ tar --strip-components=1 -zxf %{SOURCE0} %build ./configure \ %{CONFIGURE_ARGS} \ - --modules=%{_libdir}/unit/debug-modules \ + --modulesdir=%{_libdir}/unit/debug-modules \ --cc-opt="%{CC_OPT}" \ --debug ./configure %%MODULE_CONFARGS%% @@ -69,7 +69,7 @@ make %%MODULE_MAKEARGS%% %{__mv} build build-debug ./configure \ %{CONFIGURE_ARGS} \ - --modules=%{_libdir}/unit/modules \ + --modulesdir=%{_libdir}/unit/modules \ --cc-opt="%{CC_OPT}" ./configure %%MODULE_CONFARGS%% make %%MODULE_MAKEARGS%% diff --git a/pkg/rpm/unit.spec.in b/pkg/rpm/unit.spec.in index 06880fcf..4259e013 100644 --- a/pkg/rpm/unit.spec.in +++ b/pkg/rpm/unit.spec.in @@ -80,7 +80,7 @@ Library and include files required for NGINX Unit modules development. PKG_CONFIG_PATH=%{bdir}/pkg/contrib/njs/build \ ./configure \ %{CONFIGURE_ARGS} \ - --modules=%{_libdir}/unit/debug-modules \ + --modulesdir=%{_libdir}/unit/debug-modules \ --libdir=%{_libdir} \ --cc-opt="%{CC_OPT}" \ --ld-opt="%{LD_OPT}" \ @@ -92,7 +92,7 @@ PKG_CONFIG_PATH=%{bdir}/pkg/contrib/njs/build \ PKG_CONFIG_PATH=%{bdir}/pkg/contrib/njs/build \ ./configure \ %{CONFIGURE_ARGS} \ - --modules=%{_libdir}/unit/modules \ + --modulesdir=%{_libdir}/unit/modules \ --libdir=%{_libdir} \ --cc-opt="%{CC_OPT}" \ --ld-opt="%{LD_OPT}" -- cgit From 5ba79b9b524ef746bc3269520c3f6b893f39275c Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Mon, 27 Mar 2023 13:43:37 +0200 Subject: Renamed --libstatedir to --statedir. In BSD systems, it's usually or some other dir under that is not , so $statedir is a more generic name. See hier(7). Reported-by: Andrei Zeliankou Reported-by: Zhidao Hong Reviewed-by: Konstantin Pavlov Reviewed-by: Andrew Clayton Cc: Liam Crilly Signed-off-by: Alejandro Colomar --- pkg/rpm/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkg/rpm') diff --git a/pkg/rpm/Makefile b/pkg/rpm/Makefile index a6efb625..b3265eac 100644 --- a/pkg/rpm/Makefile +++ b/pkg/rpm/Makefile @@ -108,7 +108,7 @@ endif CONFIGURE_ARGS_COMMON=\ --prefix=/usr \ - --libstatedir=%{_sharedstatedir}/unit \ + --statedir=%{_sharedstatedir}/unit \ --control="unix:/var/run/unit/control.sock" \ --pid=/var/run/unit/unit.pid \ --log=/var/log/unit/unit.log \ -- cgit From 700ee28bbfe9b50482e6d34734c856f829bbe23f Mon Sep 17 00:00:00 2001 From: Konstantin Pavlov Date: Wed, 22 Mar 2023 16:55:25 -0700 Subject: Packages: check rpm database for actual provides. Previously, we required an exact non-virtual package, however it's fine if some package has a fully-virtual provides for what we need. --- pkg/rpm/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkg/rpm') diff --git a/pkg/rpm/Makefile b/pkg/rpm/Makefile index b3265eac..93502942 100644 --- a/pkg/rpm/Makefile +++ b/pkg/rpm/Makefile @@ -142,7 +142,7 @@ check-build-depends-%: esac ; \ not_installed= ; \ for pkg in $${pkgs}; do \ - rpm -qi $${pkg} >/dev/null 2>&1 ; \ + rpm -qi --whatprovides $${pkg} >/dev/null 2>&1 ; \ if [ $$? -ne 0 ]; then \ not_installed="$${not_installed} $${pkg}" ; \ fi ; \ -- cgit From 24243ecab3ed119b9c91664ccbe368e492c2efe7 Mon Sep 17 00:00:00 2001 From: Konstantin Pavlov Date: Wed, 22 Mar 2023 16:55:36 -0700 Subject: Packages: Added Amazon Linux 2023. --- pkg/rpm/Makefile | 12 ++++ pkg/rpm/Makefile.jsc-common | 8 +++ pkg/rpm/Makefile.jsc17 | 70 ++++++++++++++++++++++ pkg/rpm/Makefile.python311 | 2 + pkg/rpm/Makefile.python39 | 2 +- pkg/rpm/rpmbuild/SOURCES/unit.example-jsc17-config | 15 +++++ 6 files changed, 108 insertions(+), 1 deletion(-) create mode 100644 pkg/rpm/Makefile.jsc17 create mode 100644 pkg/rpm/rpmbuild/SOURCES/unit.example-jsc17-config (limited to 'pkg/rpm') diff --git a/pkg/rpm/Makefile b/pkg/rpm/Makefile index 93502942..0aa6beb2 100644 --- a/pkg/rpm/Makefile +++ b/pkg/rpm/Makefile @@ -18,6 +18,8 @@ else ifeq ($(shell rpm --eval "%{?rhel}"), 9) OSVER = centos9 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 35 -a 0%{?fedora} -le 36'`; echo $$?),0) OSVER = fedora else ifeq ($(shell test `rpm --eval '0%{?fedora} -ge 37'`; echo $$?),0) @@ -84,6 +86,16 @@ include Makefile.jsc-common include Makefile.jsc8 endif +ifeq ($(OSVER), amazonlinux2023) +include Makefile.php +include Makefile.python39 +include Makefile.python311 +include Makefile.go +include Makefile.perl +include Makefile.jsc-common +include Makefile.jsc17 +endif + ifeq ($(OSVER), fedora) include Makefile.php include Makefile.python310 diff --git a/pkg/rpm/Makefile.jsc-common b/pkg/rpm/Makefile.jsc-common index 9688e265..ebacf69d 100644 --- a/pkg/rpm/Makefile.jsc-common +++ b/pkg/rpm/Makefile.jsc-common @@ -8,13 +8,21 @@ MODULE_RELEASE_jsc_common= 1 JAVA_ARCH_jsc_common= $(shell /usr/lib/jvm/java-1.8.0/bin/java -XshowSettings 2>&1 | grep -F -e os.arch | sed -e 's/^.*= //') +ifneq (,$(findstring $(OSVER),amazonlinux2023)) +MODULE_CONFARGS_jsc_common= java --home=/usr/lib/jvm/java-17-amazon-corretto --lib-path=/usr/lib/jvm/java-17-amazon-corretto/lib --jars=/usr/share/unit-jsc-common/ +else MODULE_CONFARGS_jsc_common= java --home=/usr/lib/jvm/java-1.8.0 --lib-path=/usr/lib/jvm/jre-1.8.0/lib/$(JAVA_ARCH_jsc_common) --jars=/usr/share/unit-jsc-common/ +endif MODULE_MAKEARGS_jsc_common= java MODULE_INSTARGS_jsc_common= java-shared-install MODULE_SOURCES_jsc_common= COPYRIGHT.unit-jsc-common +ifneq (,$(findstring $(OSVER),amazonlinux2023)) +BUILD_DEPENDS_jsc_common= java-17-amazon-corretto-devel curl +else BUILD_DEPENDS_jsc_common= java-1.8.0-openjdk-devel curl +endif BUILD_DEPENDS+= $(BUILD_DEPENDS_jsc_common) define MODULE_DEFINITIONS_jsc_common diff --git a/pkg/rpm/Makefile.jsc17 b/pkg/rpm/Makefile.jsc17 new file mode 100644 index 00000000..7efdafaa --- /dev/null +++ b/pkg/rpm/Makefile.jsc17 @@ -0,0 +1,70 @@ +MODULES+= jsc17 +MODULE_SUFFIX_jsc17= jsc17 + +MODULE_SUMMARY_jsc17= Java 17 module for NGINX Unit + +MODULE_VERSION_jsc17= $(VERSION) +MODULE_RELEASE_jsc17= 1 + +MODULE_CONFARGS_jsc17= java --module=java17 --home=/usr/lib/jvm/java-17-amazon-corretto --lib-path=/usr/lib/jvm/java-17-amazon-corretto/lib --jars=/usr/share/unit-jsc-common/ +MODULE_MAKEARGS_jsc17= java17 +MODULE_INSTARGS_jsc17= java17-install + +MODULE_SOURCES_jsc17= unit.example-jsc-app \ + unit.example-jsc17-config + +BUILD_DEPENDS_jsc17= java-17-amazon-corretto-devel +BUILD_DEPENDS+= $(BUILD_DEPENDS_jsc17) + +define MODULE_DEFINITIONS_jsc17 +Requires: unit-jsc-common == $(MODULE_VERSION_jsc_common)-$(MODULE_RELEASE_jsc_common)%{?dist}.ngx +Requires: java-17-amazon-corretto-headless +endef +export MODULE_DEFINITIONS_jsc17 + +define MODULE_PREINSTALL_jsc17 +%{__mkdir} -p %{buildroot}%{_datadir}/doc/unit-jsc17/examples/jsc-app +%{__install} -m 644 -p %{SOURCE100} \ + %{buildroot}%{_datadir}/doc/unit-jsc17/examples/jsc-app/index.jsp +%{__install} -m 644 -p %{SOURCE101} \ + %{buildroot}%{_datadir}/doc/unit-jsc17/examples/unit.config +%{__install} -m 644 -p %{bdir}/src/java/README.JSR-340 \ + %{buildroot}%{_datadir}/doc/unit-jsc17/ +endef +export MODULE_PREINSTALL_jsc17 + +define MODULE_POSTINSTALL_jsc17 +DESTDIR=%{buildroot} make java-shared-uninstall +endef +export MODULE_POSTINSTALL_jsc17 + +define MODULE_FILES_jsc17 +%{_libdir}/unit/modules/* +%{_libdir}/unit/debug-modules/* +%dir %{_datadir}/doc/unit-jsc17 +%{_datadir}/doc/unit-jsc17/* +%{_datadir}/unit-jsc-common/* +endef +export MODULE_FILES_jsc17 + +define MODULE_POST_jsc17 +cat < Date: Wed, 29 Mar 2023 12:42:54 -0700 Subject: Packages: fixed rpm builds after 817968931c58. --- pkg/rpm/unit.spec.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pkg/rpm') diff --git a/pkg/rpm/unit.spec.in b/pkg/rpm/unit.spec.in index 4259e013..0914e513 100644 --- a/pkg/rpm/unit.spec.in +++ b/pkg/rpm/unit.spec.in @@ -86,7 +86,7 @@ PKG_CONFIG_PATH=%{bdir}/pkg/contrib/njs/build \ --ld-opt="%{LD_OPT}" \ --debug %{__make} %{?_smp_mflags} -%{__make} %{?_smp_mflags} build/libunit.a +%{__make} %{?_smp_mflags} build/lib/libunit.a %{__mv} build build-debug PKG_CONFIG_PATH=%{bdir}/pkg/contrib/njs/build \ @@ -103,9 +103,9 @@ PKG_CONFIG_PATH=%{bdir}/pkg/contrib/njs/build \ %{__rm} -rf %{buildroot} %{__ln_s} build-nodebug build DESTDIR=%{buildroot} make unitd-install libunit-install manpage-install -%{__install} -m755 %{bdir}/build-debug/unitd \ +%{__install} -m755 %{bdir}/build-debug/sbin/unitd \ %{buildroot}%{_sbindir}/unitd-debug -%{__install} -m644 %{bdir}/build-debug/libunit.a \ +%{__install} -m644 %{bdir}/build-debug/lib/libunit.a \ %{buildroot}%{_libdir}/libunit-debug.a %{__mkdir} -p %{buildroot}%{_libdir}/unit/modules %{__mkdir} -p %{buildroot}%{_libdir}/unit/debug-modules -- cgit From 497b84c18f6b903fc5cc5dd05c50e4648d2db777 Mon Sep 17 00:00:00 2001 From: Konstantin Pavlov Date: Thu, 30 Mar 2023 10:51:32 -0700 Subject: Packages: Used a stricter check for Amazon Linux 2023. Previously, findstring matched on amazonlinux2 too, breaking the build on that OS. --- pkg/rpm/Makefile.jsc-common | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkg/rpm') diff --git a/pkg/rpm/Makefile.jsc-common b/pkg/rpm/Makefile.jsc-common index ebacf69d..a3c3a3da 100644 --- a/pkg/rpm/Makefile.jsc-common +++ b/pkg/rpm/Makefile.jsc-common @@ -8,7 +8,7 @@ MODULE_RELEASE_jsc_common= 1 JAVA_ARCH_jsc_common= $(shell /usr/lib/jvm/java-1.8.0/bin/java -XshowSettings 2>&1 | grep -F -e os.arch | sed -e 's/^.*= //') -ifneq (,$(findstring $(OSVER),amazonlinux2023)) +ifeq ($(OSVER),amazonlinux2023) MODULE_CONFARGS_jsc_common= java --home=/usr/lib/jvm/java-17-amazon-corretto --lib-path=/usr/lib/jvm/java-17-amazon-corretto/lib --jars=/usr/share/unit-jsc-common/ else MODULE_CONFARGS_jsc_common= java --home=/usr/lib/jvm/java-1.8.0 --lib-path=/usr/lib/jvm/jre-1.8.0/lib/$(JAVA_ARCH_jsc_common) --jars=/usr/share/unit-jsc-common/ @@ -18,7 +18,7 @@ MODULE_INSTARGS_jsc_common= java-shared-install MODULE_SOURCES_jsc_common= COPYRIGHT.unit-jsc-common -ifneq (,$(findstring $(OSVER),amazonlinux2023)) +ifeq ($(OSVER),amazonlinux2023) BUILD_DEPENDS_jsc_common= java-17-amazon-corretto-devel curl else BUILD_DEPENDS_jsc_common= java-1.8.0-openjdk-devel curl -- cgit From 73c6c8a7f7cae0ef18131c6db000bffd82ce9593 Mon Sep 17 00:00:00 2001 From: Konstantin Pavlov Date: Thu, 30 Mar 2023 16:03:41 -0700 Subject: Packages: added unitc and setup-unit. --- pkg/rpm/Makefile | 3 ++- pkg/rpm/unit.spec.in | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'pkg/rpm') diff --git a/pkg/rpm/Makefile b/pkg/rpm/Makefile index 0aa6beb2..584f2d3a 100644 --- a/pkg/rpm/Makefile +++ b/pkg/rpm/Makefile @@ -192,7 +192,8 @@ endif rpmbuild/SOURCES/unit-$(VERSION).tar.gz: cd ../.. && tar -czf pkg/rpm/rpmbuild/SOURCES/unit-$(VERSION).tar.gz \ --transform "s#^#unit-$(VERSION)/#" \ - LICENSE NOTICE CHANGES README.md CONTRIBUTING.md configure auto src test version go pkg/contrib docs/man/unitd.8.in + LICENSE NOTICE CHANGES README.md CONTRIBUTING.md configure auto src \ + test tools version go pkg/contrib docs/man/unitd.8.in unit: check-build-depends-unit rpmbuild/SPECS/unit.spec rpmbuild/SOURCES/unit-$(VERSION).tar.gz @echo "===> Building $@ package" ; \ diff --git a/pkg/rpm/unit.spec.in b/pkg/rpm/unit.spec.in index 0914e513..14a2ea00 100644 --- a/pkg/rpm/unit.spec.in +++ b/pkg/rpm/unit.spec.in @@ -103,6 +103,11 @@ PKG_CONFIG_PATH=%{bdir}/pkg/contrib/njs/build \ %{__rm} -rf %{buildroot} %{__ln_s} build-nodebug build DESTDIR=%{buildroot} make unitd-install libunit-install manpage-install +%{__mkdir} -p %{buildroot}%{_bindir} +%{__install} -m755 %{bdir}/tools/unitc \ + %{buildroot}%{_bindir}/unitc +%{__install} -m755 %{bdir}/tools/setup-unit \ + %{buildroot}%{_bindir}/setup-unit %{__install} -m755 %{bdir}/build-debug/sbin/unitd \ %{buildroot}%{_sbindir}/unitd-debug %{__install} -m644 %{bdir}/build-debug/lib/libunit.a \ @@ -197,6 +202,8 @@ BANNER %files %defattr(-,root,root,-) +%attr(0755,root,root) %{_bindir}/unitc +%attr(0755,root,root) %{_bindir}/setup-unit %attr(0755,root,root) %{_sbindir}/unitd %attr(0755,root,root) %{_sbindir}/unitd-debug %{_unitdir}/unit.service -- cgit From 1266eda80c2f3b67d50b13d88d1ea51729eab772 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Mon, 24 Apr 2023 17:59:34 +0200 Subject: Docs: moved uintd.8 to man8/ subdirectory. Reviewed-by: Artem Konev Signed-off-by: Alejandro Colomar --- pkg/rpm/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkg/rpm') diff --git a/pkg/rpm/Makefile b/pkg/rpm/Makefile index 584f2d3a..d3cc34bd 100644 --- a/pkg/rpm/Makefile +++ b/pkg/rpm/Makefile @@ -193,7 +193,7 @@ rpmbuild/SOURCES/unit-$(VERSION).tar.gz: cd ../.. && tar -czf pkg/rpm/rpmbuild/SOURCES/unit-$(VERSION).tar.gz \ --transform "s#^#unit-$(VERSION)/#" \ LICENSE NOTICE CHANGES README.md CONTRIBUTING.md configure auto src \ - test tools version go pkg/contrib docs/man/unitd.8.in + test tools version go pkg/contrib docs/man/man8/unitd.8.in unit: check-build-depends-unit rpmbuild/SPECS/unit.spec rpmbuild/SOURCES/unit-$(VERSION).tar.gz @echo "===> Building $@ package" ; \ -- cgit