diff options
author | Andrei Belov <defan@nginx.com> | 2018-03-01 23:03:03 +0300 |
---|---|---|
committer | Andrei Belov <defan@nginx.com> | 2018-03-01 23:03:03 +0300 |
commit | 2d2b5048bc2150ed9abe7f0f24372442e277b738 (patch) | |
tree | 25e6c9361709b590b3276174d2218e14dec5a5f5 /pkg | |
parent | 1f06ccb6d898b6dbb2506e4a893691a67da80130 (diff) | |
download | unit-2d2b5048bc2150ed9abe7f0f24372442e277b738.tar.gz unit-2d2b5048bc2150ed9abe7f0f24372442e277b738.tar.bz2 |
Packages: added openSUSE Leap, openSUSE Tumbleweed, SLES support.
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/rpm/Makefile | 50 | ||||
-rw-r--r-- | pkg/rpm/Makefile.go | 15 | ||||
-rw-r--r-- | pkg/rpm/Makefile.perl | 5 | ||||
-rw-r--r-- | pkg/rpm/Makefile.php | 5 | ||||
-rw-r--r-- | pkg/rpm/Makefile.python27 | 5 | ||||
-rw-r--r-- | pkg/rpm/Makefile.python34 | 5 | ||||
-rw-r--r-- | pkg/rpm/Makefile.python36 | 5 | ||||
-rw-r--r-- | pkg/rpm/unit.spec.in | 2 |
8 files changed, 83 insertions, 9 deletions
diff --git a/pkg/rpm/Makefile b/pkg/rpm/Makefile index 37132fa8..0373a52d 100644 --- a/pkg/rpm/Makefile +++ b/pkg/rpm/Makefile @@ -8,21 +8,40 @@ DEFAULT_RELEASE := 1 VERSION ?= $(DEFAULT_VERSION) RELEASE ?= $(DEFAULT_RELEASE) -BUILD_DEPENDS_unit = gcc libxml2 libxslt rpm-build rpmlint -BUILD_DEPENDS = $(BUILD_DEPENDS_unit) - ifeq ($(shell rpm --eval "%{?rhel}"), 6) OSVER = centos6 else ifeq ($(shell rpm --eval "%{?rhel}"), 7) OSVER = centos7 -BUILD_DEPENDS += which else ifeq ($(shell rpm --eval "%{?amzn}"), 1) OSVER = amazonlinux1 -BUILD_DEPENDS += system-rpm-config else ifeq ($(shell rpm --eval "%{?amzn}"), 2) OSVER = amazonlinux2 +else ifeq ($(shell test `rpm --eval '0%{?suse_version} -ge 1315 -a 0%{?suse_version} -lt 1330 -a 0%{?is_opensuse} -eq 1'`; echo $$?), 0) +OSVER = opensuse-leap +else ifeq ($(shell test `rpm --eval '0%{?suse_version} -ge 1330 -a 0%{?is_opensuse} -eq 1'`; echo $$?), 0) +OSVER = opensuse-tumbleweed +else ifeq ($(shell test `rpm --eval '0%{?suse_version} -ge 1315 -a 0%{?is_opensuse} -eq 0'`; echo $$?), 0) +OSVER = sles +endif + +BUILD_DEPENDS_unit = gcc rpm-build rpmlint + +ifeq ($(OSVER), centos7) +BUILD_DEPENDS_unit += which +endif + +ifeq ($(OSVER), amazonlinux1) +BUILD_DEPENDS_unit += system-rpm-config endif +ifneq (,$(findstring $(OSVER),opensuse-leap opensuse-tumbleweed sles)) +BUILD_DEPENDS_unit += libxml2-tools libxslt1 +else +BUILD_DEPENDS_unit += libxml2 libxslt +endif + +BUILD_DEPENDS = $(BUILD_DEPENDS_unit) + MODULES= ifneq (,$(findstring $(OSVER),centos6 centos7 amazonlinux2)) @@ -42,6 +61,27 @@ include Makefile.go include Makefile.perl endif +ifeq ($(OSVER), opensuse-leap) +include Makefile.python27 +include Makefile.python34 +include Makefile.go +include Makefile.perl +endif + +ifeq ($(OSVER), opensuse-tumbleweed) +include Makefile.php +include Makefile.python27 +include Makefile.python36 +include Makefile.go +include Makefile.perl +endif + +ifeq ($(OSVER), sles) +include Makefile.python27 +include Makefile.python34 +include Makefile.perl +endif + CONFIGURE_ARGS=\ --prefix=/usr \ --state=%{_sharedstatedir}/unit \ diff --git a/pkg/rpm/Makefile.go b/pkg/rpm/Makefile.go index 1fc3dcb5..c979f097 100644 --- a/pkg/rpm/Makefile.go +++ b/pkg/rpm/Makefile.go @@ -15,17 +15,26 @@ MODULE_SOURCES_go= unit.example-go-app \ ifeq ($(OSVER), centos6) BUILD_DEPENDS_go= epel-release golang +else ifneq (,$(findstring $(OSVER),opensuse-leap opensuse-tumbleweed)) +BUILD_DEPENDS_go= go1.9 else BUILD_DEPENDS_go= golang endif BUILD_DEPENDS+= $(BUILD_DEPENDS_go) +ifneq (,$(findstring $(OSVER),opensuse-leap opensuse-tumbleweed)) define MODULE_DEFINITIONS_go - -BuildRequires: golang +BuildRequires: $(BUILD_DEPENDS_go) +BuildArch: noarch +%define gopath /usr/share/go/contrib +endef +else +define MODULE_DEFINITIONS_go +BuildRequires: $(BUILD_DEPENDS_go) BuildArch: noarch endef +endif export MODULE_DEFINITIONS_go define MODULE_PREINSTALL_go @@ -54,7 +63,7 @@ The $(MODULE_SUMMARY_go) has been installed. To check the sample app, run these commands: - GOPATH=/usr/share/gocode go build -o /tmp/go-app /usr/share/doc/unit-go/examples/go-app/let-my-people.go + GOPATH=%{gopath} go build -o /tmp/go-app /usr/share/doc/unit-go/examples/go-app/let-my-people.go sudo service unit start sudo service unit loadconfig /usr/share/doc/unit-go/examples/unit.config curl http://localhost:8500/ diff --git a/pkg/rpm/Makefile.perl b/pkg/rpm/Makefile.perl index d20c2539..5ecc4bd0 100644 --- a/pkg/rpm/Makefile.perl +++ b/pkg/rpm/Makefile.perl @@ -13,7 +13,12 @@ MODULE_INSTARGS_perl= perl-install MODULE_SOURCES_perl= unit.example-perl-app \ unit.example-perl-config +ifneq (,$(findstring $(OSVER),opensuse-leap opensuse-tumbleweed sles)) +BUILD_DEPENDS_perl= perl +else BUILD_DEPENDS_perl= perl-devel perl-libs perl-ExtUtils-Embed +endif + BUILD_DEPENDS+= $(BUILD_DEPENDS_perl) define MODULE_DEFINITIONS_perl diff --git a/pkg/rpm/Makefile.php b/pkg/rpm/Makefile.php index 6a75a92f..9556f839 100644 --- a/pkg/rpm/Makefile.php +++ b/pkg/rpm/Makefile.php @@ -13,7 +13,12 @@ MODULE_INSTARGS_php= php-install MODULE_SOURCES_php= unit.example-php-app \ unit.example-php-config +ifeq ($(OSVER), opensuse-tumbleweed) +BUILD_DEPENDS_php= php7-devel php7-embed +else BUILD_DEPENDS_php= php-devel php-embedded +endif + BUILD_DEPENDS+= $(BUILD_DEPENDS_php) define MODULE_PREINSTALL_php diff --git a/pkg/rpm/Makefile.python27 b/pkg/rpm/Makefile.python27 index 9f13ad9e..fe09bf1f 100644 --- a/pkg/rpm/Makefile.python27 +++ b/pkg/rpm/Makefile.python27 @@ -13,7 +13,12 @@ MODULE_INSTARGS_python27= python2.7-install MODULE_SOURCES_python27= unit.example-python-app \ unit.example-python27-config +ifneq (,$(findstring $(OSVER),opensuse-leap opensuse-tumbleweed sles)) +BUILD_DEPENDS_python27= python-devel +else BUILD_DEPENDS_python27= python27-devel +endif + BUILD_DEPENDS+= $(BUILD_DEPENDS_python27) define MODULE_PREINSTALL_python27 diff --git a/pkg/rpm/Makefile.python34 b/pkg/rpm/Makefile.python34 index ab4b285b..f7105644 100644 --- a/pkg/rpm/Makefile.python34 +++ b/pkg/rpm/Makefile.python34 @@ -13,7 +13,12 @@ MODULE_INSTARGS_python34= python3.4-install MODULE_SOURCES_python34= unit.example-python-app \ unit.example-python34-config +ifneq (,$(findstring $(OSVER),opensuse-leap sles)) +BUILD_DEPENDS_python34= python3-devel +else BUILD_DEPENDS_python34= python34-devel +endif + BUILD_DEPENDS+= $(BUILD_DEPENDS_python34) define MODULE_PREINSTALL_python34 diff --git a/pkg/rpm/Makefile.python36 b/pkg/rpm/Makefile.python36 index a794c092..05ab2334 100644 --- a/pkg/rpm/Makefile.python36 +++ b/pkg/rpm/Makefile.python36 @@ -13,7 +13,12 @@ MODULE_INSTARGS_python36= python3.6-install MODULE_SOURCES_python36= unit.example-python-app \ unit.example-python36-config +ifneq (,$(findstring $(OSVER),opensuse-tumbleweed sles)) +BUILD_DEPENDS_python36= python3-devel +else BUILD_DEPENDS_python36= python36-devel +endif + BUILD_DEPENDS+= $(BUILD_DEPENDS_python36) define MODULE_PREINSTALL_python36 diff --git a/pkg/rpm/unit.spec.in b/pkg/rpm/unit.spec.in index b510d069..12327449 100644 --- a/pkg/rpm/unit.spec.in +++ b/pkg/rpm/unit.spec.in @@ -1,5 +1,5 @@ # distribution specific definitions -%define use_systemd (0%{?rhel} && 0%{?rhel} >= 7) || (0%{?suse_version} == 1315) +%define use_systemd (0%{?rhel} && 0%{?rhel} >= 7) || (0%{?suse_version} >= 1315) %define bdir %{_builddir}/%{name}-%{version} %define dotests 0 |