diff options
author | Andrei Belov <defan@nginx.com> | 2019-02-28 18:22:15 +0300 |
---|---|---|
committer | Andrei Belov <defan@nginx.com> | 2019-02-28 18:22:15 +0300 |
commit | 7ce6f0597543baee4275e8d66567d08f2ddaf48b (patch) | |
tree | 1ccc536803ebcfa99626770521c11674ccef5722 /pkg/rpm/Makefile | |
parent | 834e8ca576868c5ecd104bd5ebec9968c7f80a0b (diff) | |
download | unit-7ce6f0597543baee4275e8d66567d08f2ddaf48b.tar.gz unit-7ce6f0597543baee4275e8d66567d08f2ddaf48b.tar.bz2 |
Packages: added unit-jsc (Java Servlet Container) family.
Diffstat (limited to '')
-rw-r--r-- | pkg/rpm/Makefile | 39 | ||||
-rw-r--r-- | pkg/rpm/Makefile.jsc-common | 41 | ||||
-rw-r--r-- | pkg/rpm/Makefile.jsc11 | 65 | ||||
-rw-r--r-- | pkg/rpm/Makefile.jsc8 | 65 |
4 files changed, 202 insertions, 8 deletions
diff --git a/pkg/rpm/Makefile b/pkg/rpm/Makefile index 56cf31b5..d94890f2 100644 --- a/pkg/rpm/Makefile +++ b/pkg/rpm/Makefile @@ -7,9 +7,9 @@ DEFAULT_RELEASE := 1 VERSION ?= $(NXT_VERSION) RELEASE ?= $(DEFAULT_RELEASE) -ifeq ($(shell rpm --eval "%{?rhel}"), 6) +ifeq ($(shell test `rpm --eval '0%{?rhel} -eq 6 -a 0%{?amzn} -eq 0'`; echo $$?), 0) OSVER = centos6 -else ifeq ($(shell rpm --eval "%{?rhel}"), 7) +else ifeq ($(shell test `rpm --eval '0%{?rhel} -eq 7 -a 0%{?amzn} -eq 0'`; echo $$?), 0) OSVER = centos7 else ifeq ($(shell rpm --eval "%{?amzn}"), 1) OSVER = amazonlinux1 @@ -49,13 +49,18 @@ ifeq ($(OSVER), centos6) include Makefile.php include Makefile.python include Makefile.go +include Makefile.jsc-common +include Makefile.jsc8 endif -ifneq (,$(findstring $(OSVER),centos7 amazonlinux2)) +ifeq ($(OSVER), centos7) include Makefile.php include Makefile.python include Makefile.go include Makefile.perl +include Makefile.jsc-common +include Makefile.jsc8 +include Makefile.jsc11 endif ifeq ($(OSVER), amazonlinux1) @@ -66,6 +71,17 @@ include Makefile.python35 include Makefile.python36 include Makefile.go include Makefile.perl +include Makefile.jsc-common +include Makefile.jsc8 +endif + +ifeq ($(OSVER), amazonlinux2) +include Makefile.php +include Makefile.python +include Makefile.go +include Makefile.perl +include Makefile.jsc-common +include Makefile.jsc8 endif ifeq ($(OSVER), opensuse-leap) @@ -102,6 +118,9 @@ endif include Makefile.go include Makefile.perl include Makefile.ruby +include Makefile.jsc-common +include Makefile.jsc8 +include Makefile.jsc11 endif CONFIGURE_ARGS=\ @@ -191,9 +210,10 @@ rpmbuild/SPECS/unit-%.spec: unit.module.spec.in ../../docs/changes.xml | rpmbuil sources="$${sources}\n$${s}" ; \ i=$$(($${i}+1)) ; \ done ; \ - pkgname=$(shell echo $@ | cut -d '/' -f 3 | cut -d '.' -f 1) ; \ + pkgname=$(shell echo $@ | cut -d '/' -f 3 | tr '_' '-' | cut -d '.' -f 1) ; \ definitions=`echo "$$MODULE_DEFINITIONS_$*" | sed -e ':a' -e 'N' -e '$$!ba' -e "s/\n/\$$CR/g"` ; \ preinstall=`echo "$$MODULE_PREINSTALL_$*" | sed -e ':a' -e 'N' -e '$$!ba' -e "s/\n/\$$CR/g"` ; \ + postinstall=`echo "$$MODULE_POSTINSTALL_$*" | sed -e ':a' -e 'N' -e '$$!ba' -e "s/\n/\$$CR/g"` ; \ files=`echo "$$MODULE_FILES_$*" | sed -e ':a' -e 'N' -e '$$!ba' -e "s/\n/\$$CR/g"` ; \ post=`echo "$$MODULE_POST_$*" | sed -e ':a' -e 'N' -e '$$!ba' -e "s/\n/\$$CR/g"` ; \ cat unit.module.spec.in | sed \ @@ -210,6 +230,7 @@ rpmbuild/SPECS/unit-%.spec: unit.module.spec.in ../../docs/changes.xml | rpmbuil -e "s#%%MODULE_INSTARGS%%#$(MODULE_INSTARGS_$*)#g" \ -e "s#%%MODULE_DEFINITIONS%%#$${definitions}#g" \ -e "s#%%MODULE_PREINSTALL%%#$${preinstall}#g" \ + -e "s#%%MODULE_POSTINSTALL%%#$${postinstall}#g" \ -e "s#%%MODULE_FILES%%#$${files}#g" \ -e "s#%%MODULE_POST%%#$${post}#g" \ > $@.tmp ; \ @@ -221,14 +242,15 @@ rpmbuild/SPECS/unit-%.spec: unit.module.spec.in ../../docs/changes.xml | rpmbuil mv $@.tmp $@ unit-%: check-build-depends-% rpmbuild/SPECS/unit-%.spec rpmbuild/SOURCES/unit-$(VERSION).tar.gz - @echo "===> Building $@ package" ; \ + @echo "===> Building $(subst _,-,$@) package" ; \ rpmbuild -D "_topdir `pwd`/rpmbuild" -ba rpmbuild/SPECS/$@.spec && \ - ln -s rpmbuild/BUILD/$@-$(VERSION)/build $@ + ln -s rpmbuild/BUILD/$(subst _,-,$@)-$(VERSION)/build $@ test: unit modules @{ \ - for so in `find rpmbuild/BUILD/*/build-nodebug/ -type f -name "*.so"`; do \ + for so in `find rpmbuild/BUILD/*/build-nodebug/ -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} ; \ done ; \ @@ -237,8 +259,9 @@ test: unit modules test-debug: unit modules @{ \ - for so in `find rpmbuild/BUILD/*/build-debug/ -type f -name "*.so"`; do \ + for so in `find rpmbuild/BUILD/*/build-debug/ -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} ; \ done ; \ diff --git a/pkg/rpm/Makefile.jsc-common b/pkg/rpm/Makefile.jsc-common new file mode 100644 index 00000000..d73ed06c --- /dev/null +++ b/pkg/rpm/Makefile.jsc-common @@ -0,0 +1,41 @@ +MODULES+= jsc_common +MODULE_SUFFIX_jsc_common= jsc-common + +MODULE_SUMMARY_jsc_common= Java shared packages for NGINX Unit + +MODULE_VERSION_jsc_common= $(VERSION) +MODULE_RELEASE_jsc_common= 1 + +MODULE_CONFARGS_jsc_common= java --home=/usr/lib/jvm/java-1.8.0 --jars=/usr/share/unit-jsc-common/ +MODULE_MAKEARGS_jsc_common= java +MODULE_INSTARGS_jsc_common= java-shared-install + +MODULE_SOURCES_jsc_common= COPYRIGHT.unit-jsc-common + +BUILD_DEPENDS_jsc_common= java-1.8.0-openjdk-devel +BUILD_DEPENDS+= $(BUILD_DEPENDS_jsc_common) + +define MODULE_DEFINITIONS_jsc_common +BuildArch: noarch +endef +export MODULE_DEFINITIONS_jsc_common + +define MODULE_FILES_jsc_common +%dir %{_datadir}/unit-jsc-common +%{_datadir}/unit-jsc-common/* +endef +export MODULE_FILES_jsc_common + +define MODULE_POST_jsc_common +cat <<BANNER +---------------------------------------------------------------------- + +The $(MODULE_SUMMARY_jsc_common) have been installed. + +Please find licenses and related information here: + /usr/share/doc/unit-jsc-common/COPYRIGHT + +---------------------------------------------------------------------- +BANNER +endef +export MODULE_POST_jsc_common diff --git a/pkg/rpm/Makefile.jsc11 b/pkg/rpm/Makefile.jsc11 new file mode 100644 index 00000000..d0f80b9b --- /dev/null +++ b/pkg/rpm/Makefile.jsc11 @@ -0,0 +1,65 @@ +MODULES+= jsc11 +MODULE_SUFFIX_jsc11= jsc11 + +MODULE_SUMMARY_jsc11= Java 11 module for NGINX Unit + +MODULE_VERSION_jsc11= $(VERSION) +MODULE_RELEASE_jsc11= 1 + +MODULE_CONFARGS_jsc11= java --module=java11 --home=/usr/lib/jvm/java-11 --jars=/usr/share/unit-jsc-common/ +MODULE_MAKEARGS_jsc11= java11 +MODULE_INSTARGS_jsc11= java11-install + +MODULE_SOURCES_jsc11= unit.example-jsc-app \ + unit.example-jsc11-config + +BUILD_DEPENDS_jsc11= java-11-openjdk-devel +BUILD_DEPENDS+= $(BUILD_DEPENDS_jsc11) + +define MODULE_DEFINITIONS_jsc11 +Requires: unit-jsc-common == $(MODULE_VERSION_jsc_common)-$(MODULE_RELEASE_jsc_common)%{?dist}.ngx +endef +export MODULE_DEFINITIONS_jsc11 + +define MODULE_PREINSTALL_jsc11 +%{__mkdir} -p %{buildroot}%{_datadir}/doc/unit-jsc11/examples/jsc-app +%{__install} -m 644 -p %{SOURCE100} \ + %{buildroot}%{_datadir}/doc/unit-jsc11/examples/jsc-app/index.jsp +%{__install} -m 644 -p %{SOURCE101} \ + %{buildroot}%{_datadir}/doc/unit-jsc11/examples/unit.config +endef +export MODULE_PREINSTALL_jsc11 + +define MODULE_POSTINSTALL_jsc11 +DESTDIR=%{buildroot} make java-shared-uninstall +endef +export MODULE_POSTINSTALL_jsc11 + +define MODULE_FILES_jsc11 +%{_libdir}/unit/modules/* +%{_libdir}/unit/debug-modules/* +%dir %{_datadir}/doc/unit-jsc11 +%{_datadir}/doc/unit-jsc11/* +%{_datadir}/unit-jsc-common/* +endef +export MODULE_FILES_jsc11 + +define MODULE_POST_jsc11 +cat <<BANNER +---------------------------------------------------------------------- + +The $(MODULE_SUMMARY_jsc11) has been installed. + +To check out the sample app, run these commands: + + sudo service unit restart + cd /usr/share/doc/%{name}/examples + sudo curl -X PUT --data-binary @unit.config --unix-socket /var/run/unit/control.sock http://localhost/config + curl http://localhost:8800/ + +Online documentation is available at https://unit.nginx.org + +---------------------------------------------------------------------- +BANNER +endef +export MODULE_POST_jsc11 diff --git a/pkg/rpm/Makefile.jsc8 b/pkg/rpm/Makefile.jsc8 new file mode 100644 index 00000000..80c06427 --- /dev/null +++ b/pkg/rpm/Makefile.jsc8 @@ -0,0 +1,65 @@ +MODULES+= jsc8 +MODULE_SUFFIX_jsc8= jsc8 + +MODULE_SUMMARY_jsc8= Java 8 module for NGINX Unit + +MODULE_VERSION_jsc8= $(VERSION) +MODULE_RELEASE_jsc8= 1 + +MODULE_CONFARGS_jsc8= java --module=java8 --home=/usr/lib/jvm/java-1.8.0 --jars=/usr/share/unit-jsc-common/ +MODULE_MAKEARGS_jsc8= java8 +MODULE_INSTARGS_jsc8= java8-install + +MODULE_SOURCES_jsc8= unit.example-jsc-app \ + unit.example-jsc8-config + +BUILD_DEPENDS_jsc8= java-1.8.0-openjdk-devel +BUILD_DEPENDS+= $(BUILD_DEPENDS_jsc8) + +define MODULE_DEFINITIONS_jsc8 +Requires: unit-jsc-common == $(MODULE_VERSION_jsc_common)-$(MODULE_RELEASE_jsc_common)%{?dist}.ngx +endef +export MODULE_DEFINITIONS_jsc8 + +define MODULE_PREINSTALL_jsc8 +%{__mkdir} -p %{buildroot}%{_datadir}/doc/unit-jsc8/examples/jsc-app +%{__install} -m 644 -p %{SOURCE100} \ + %{buildroot}%{_datadir}/doc/unit-jsc8/examples/jsc-app/index.jsp +%{__install} -m 644 -p %{SOURCE101} \ + %{buildroot}%{_datadir}/doc/unit-jsc8/examples/unit.config +endef +export MODULE_PREINSTALL_jsc8 + +define MODULE_POSTINSTALL_jsc8 +DESTDIR=%{buildroot} make java-shared-uninstall +endef +export MODULE_POSTINSTALL_jsc8 + +define MODULE_FILES_jsc8 +%{_libdir}/unit/modules/* +%{_libdir}/unit/debug-modules/* +%dir %{_datadir}/doc/unit-jsc8 +%{_datadir}/doc/unit-jsc8/* +%{_datadir}/unit-jsc-common/* +endef +export MODULE_FILES_jsc8 + +define MODULE_POST_jsc8 +cat <<BANNER +---------------------------------------------------------------------- + +The $(MODULE_SUMMARY_jsc8) has been installed. + +To check out the sample app, run these commands: + + sudo service unit restart + cd /usr/share/doc/%{name}/examples + sudo curl -X PUT --data-binary @unit.config --unix-socket /var/run/unit/control.sock http://localhost/config + curl http://localhost:8800/ + +Online documentation is available at https://unit.nginx.org + +---------------------------------------------------------------------- +BANNER +endef +export MODULE_POST_jsc8 |