Skip to content

Commit 0c4ec72

Browse files
committed
Packages: added support for Amazon Linux.
1 parent be8df06 commit 0c4ec72

12 files changed

+302
-2
lines changed

pkg/rpm/Makefile

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,33 @@ RELEASE ?= $(DEFAULT_RELEASE)
1111
BUILD_DEPENDS_unit = libxml2 libxslt rpm-build rpmlint
1212
BUILD_DEPENDS = $(BUILD_DEPENDS_unit)
1313

14+
ifeq ($(shell rpm --eval "%{?rhel}"), 6)
15+
OSVER = centos6
16+
else ifeq ($(shell rpm --eval "%{?rhel}"), 7)
17+
OSVER = centos7
18+
else ifeq ($(shell rpm --eval "%{?amzn}"), 1)
19+
OSVER = amazonlinux1
20+
BUILD_DEPENDS += system-rpm-config
21+
else ifeq ($(shell rpm --eval "%{?amzn}"), 2)
22+
OSVER = amazonlinux2
23+
endif
24+
1425
MODULES=
15-
-include Makefile.*
26+
27+
ifneq (,$(findstring $(OSVER),centos6 centos7 amazonlinux2))
28+
include Makefile.php
29+
include Makefile.python
30+
include Makefile.go
31+
endif
32+
33+
ifeq ($(OSVER), amazonlinux1)
34+
include Makefile.php
35+
include Makefile.python27
36+
include Makefile.python34
37+
include Makefile.python35
38+
include Makefile.python36
39+
include Makefile.go
40+
endif
1641

1742
CONFIGURE_ARGS=\
1843
--prefix=/usr \

pkg/rpm/Makefile.python

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ MODULE_INSTARGS_python= python-install
1212
MODULE_SOURCES_python= unit.example-python-app \
1313
unit.example-python-config
1414

15+
ifeq ($(shell rpm --eval "%{?amzn}"), 1)
16+
BUILD_DEPENDS_python= python26-devel
17+
else
1518
BUILD_DEPENDS_python= python-devel
19+
endif
20+
1621
BUILD_DEPENDS+= $(BUILD_DEPENDS_python)
1722

1823
define MODULE_PREINSTALL_python

pkg/rpm/Makefile.python27

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
MODULES+= python27
2+
3+
MODULE_SUMMARY_python27= Python 2.7 module for NGINX Unit
4+
5+
MODULE_VERSION_python27= $(VERSION)
6+
MODULE_RELEASE_python27= 1
7+
8+
MODULE_CONFARGS_python27= python --config=python2.7-config
9+
MODULE_MAKEARGS_python27= python2.7
10+
MODULE_INSTARGS_python27= python2.7-install
11+
12+
MODULE_SOURCES_python27= unit.example-python-app \
13+
unit.example-python27-config
14+
15+
BUILD_DEPENDS_python27= python27-devel
16+
BUILD_DEPENDS+= $(BUILD_DEPENDS_python27)
17+
18+
define MODULE_PREINSTALL_python27
19+
%{__mkdir} -p %{buildroot}%{_datadir}/doc/unit-python27/examples/python-app
20+
%{__install} -m 644 -p %{SOURCE100} \
21+
%{buildroot}%{_datadir}/doc/unit-python27/examples/python-app/wsgi.py
22+
%{__install} -m 644 -p %{SOURCE101} \
23+
%{buildroot}%{_datadir}/doc/unit-python27/examples/unit.config
24+
endef
25+
export MODULE_PREINSTALL_python27
26+
27+
define MODULE_FILES_python27
28+
%{_libdir}/unit/modules/*
29+
%{_libdir}/unit/debug-modules/*
30+
endef
31+
export MODULE_FILES_python27
32+
33+
define MODULE_POST_python27
34+
cat <<BANNER
35+
----------------------------------------------------------------------
36+
37+
The $(MODULE_SUMMARY_python27) has been installed.
38+
39+
To check the sample app, run these commands:
40+
41+
sudo service unit start
42+
sudo service unit loadconfig /usr/share/doc/unit-python27/examples/unit.config
43+
curl http://localhost:8400/
44+
45+
Online documentation is available at https://unit.nginx.org
46+
47+
----------------------------------------------------------------------
48+
BANNER
49+
endef
50+
export MODULE_POST_python27

pkg/rpm/Makefile.python34

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
MODULES+= python34
2+
3+
MODULE_SUMMARY_python34= Python 3.4 module for NGINX Unit
4+
5+
MODULE_VERSION_python34= $(VERSION)
6+
MODULE_RELEASE_python34= 1
7+
8+
MODULE_CONFARGS_python34= python --config=python3.4-config
9+
MODULE_MAKEARGS_python34= python3.4
10+
MODULE_INSTARGS_python34= python3.4-install
11+
12+
MODULE_SOURCES_python34= unit.example-python-app \
13+
unit.example-python34-config
14+
15+
BUILD_DEPENDS_python34= python34-devel
16+
BUILD_DEPENDS+= $(BUILD_DEPENDS_python34)
17+
18+
define MODULE_PREINSTALL_python34
19+
%{__mkdir} -p %{buildroot}%{_datadir}/doc/unit-python34/examples/python-app
20+
%{__install} -m 644 -p %{SOURCE100} \
21+
%{buildroot}%{_datadir}/doc/unit-python34/examples/python-app/wsgi.py
22+
%{__install} -m 644 -p %{SOURCE101} \
23+
%{buildroot}%{_datadir}/doc/unit-python34/examples/unit.config
24+
endef
25+
export MODULE_PREINSTALL_python34
26+
27+
define MODULE_FILES_python34
28+
%{_libdir}/unit/modules/*
29+
%{_libdir}/unit/debug-modules/*
30+
endef
31+
export MODULE_FILES_python34
32+
33+
define MODULE_POST_python34
34+
cat <<BANNER
35+
----------------------------------------------------------------------
36+
37+
The $(MODULE_SUMMARY_python34) has been installed.
38+
39+
To check the sample app, run these commands:
40+
41+
sudo service unit start
42+
sudo service unit loadconfig /usr/share/doc/unit-python34/examples/unit.config
43+
curl http://localhost:8400/
44+
45+
Online documentation is available at https://unit.nginx.org
46+
47+
----------------------------------------------------------------------
48+
BANNER
49+
endef
50+
export MODULE_POST_python34

pkg/rpm/Makefile.python35

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
MODULES+= python35
2+
3+
MODULE_SUMMARY_python35= Python 3.5 module for NGINX Unit
4+
5+
MODULE_VERSION_python35= $(VERSION)
6+
MODULE_RELEASE_python35= 1
7+
8+
MODULE_CONFARGS_python35= python --config=python3.5-config
9+
MODULE_MAKEARGS_python35= python3.5
10+
MODULE_INSTARGS_python35= python3.5-install
11+
12+
MODULE_SOURCES_python35= unit.example-python-app \
13+
unit.example-python35-config
14+
15+
BUILD_DEPENDS_python35= python35-devel
16+
BUILD_DEPENDS+= $(BUILD_DEPENDS_python35)
17+
18+
define MODULE_PREINSTALL_python35
19+
%{__mkdir} -p %{buildroot}%{_datadir}/doc/unit-python35/examples/python-app
20+
%{__install} -m 644 -p %{SOURCE100} \
21+
%{buildroot}%{_datadir}/doc/unit-python35/examples/python-app/wsgi.py
22+
%{__install} -m 644 -p %{SOURCE101} \
23+
%{buildroot}%{_datadir}/doc/unit-python35/examples/unit.config
24+
endef
25+
export MODULE_PREINSTALL_python35
26+
27+
define MODULE_FILES_python35
28+
%{_libdir}/unit/modules/*
29+
%{_libdir}/unit/debug-modules/*
30+
endef
31+
export MODULE_FILES_python35
32+
33+
define MODULE_POST_python35
34+
cat <<BANNER
35+
----------------------------------------------------------------------
36+
37+
The $(MODULE_SUMMARY_python35) has been installed.
38+
39+
To check the sample app, run these commands:
40+
41+
sudo service unit start
42+
sudo service unit loadconfig /usr/share/doc/unit-python35/examples/unit.config
43+
curl http://localhost:8400/
44+
45+
Online documentation is available at https://unit.nginx.org
46+
47+
----------------------------------------------------------------------
48+
BANNER
49+
endef
50+
export MODULE_POST_python35

pkg/rpm/Makefile.python36

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
MODULES+= python36
2+
3+
MODULE_SUMMARY_python36= Python 3.6 module for NGINX Unit
4+
5+
MODULE_VERSION_python36= $(VERSION)
6+
MODULE_RELEASE_python36= 1
7+
8+
MODULE_CONFARGS_python36= python --config=python3.6-config
9+
MODULE_MAKEARGS_python36= python3.6
10+
MODULE_INSTARGS_python36= python3.6-install
11+
12+
MODULE_SOURCES_python36= unit.example-python-app \
13+
unit.example-python36-config
14+
15+
BUILD_DEPENDS_python36= python36-devel
16+
BUILD_DEPENDS+= $(BUILD_DEPENDS_python36)
17+
18+
define MODULE_PREINSTALL_python36
19+
%{__mkdir} -p %{buildroot}%{_datadir}/doc/unit-python36/examples/python-app
20+
%{__install} -m 644 -p %{SOURCE100} \
21+
%{buildroot}%{_datadir}/doc/unit-python36/examples/python-app/wsgi.py
22+
%{__install} -m 644 -p %{SOURCE101} \
23+
%{buildroot}%{_datadir}/doc/unit-python36/examples/unit.config
24+
endef
25+
export MODULE_PREINSTALL_python36
26+
27+
define MODULE_FILES_python36
28+
%{_libdir}/unit/modules/*
29+
%{_libdir}/unit/debug-modules/*
30+
endef
31+
export MODULE_FILES_python36
32+
33+
define MODULE_POST_python36
34+
cat <<BANNER
35+
----------------------------------------------------------------------
36+
37+
The $(MODULE_SUMMARY_python36) has been installed.
38+
39+
To check the sample app, run these commands:
40+
41+
sudo service unit start
42+
sudo service unit loadconfig /usr/share/doc/unit-python36/examples/unit.config
43+
curl http://localhost:8400/
44+
45+
Online documentation is available at https://unit.nginx.org
46+
47+
----------------------------------------------------------------------
48+
BANNER
49+
endef
50+
export MODULE_POST_python36
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"applications": {
3+
"example_python": {
4+
"type": "python 2.7",
5+
"user": "nobody",
6+
"workers": 2,
7+
"path": "/usr/share/doc/unit-python27/examples/python-app",
8+
"module": "wsgi"
9+
}
10+
},
11+
12+
"listeners": {
13+
"*:8400": {
14+
"application": "example_python"
15+
}
16+
}
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"applications": {
3+
"example_python": {
4+
"type": "python 3.4",
5+
"user": "nobody",
6+
"workers": 2,
7+
"path": "/usr/share/doc/unit-python34/examples/python-app",
8+
"module": "wsgi"
9+
}
10+
},
11+
12+
"listeners": {
13+
"*:8400": {
14+
"application": "example_python"
15+
}
16+
}
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"applications": {
3+
"example_python": {
4+
"type": "python 3.5",
5+
"user": "nobody",
6+
"workers": 2,
7+
"path": "/usr/share/doc/unit-python35/examples/python-app",
8+
"module": "wsgi"
9+
}
10+
},
11+
12+
"listeners": {
13+
"*:8400": {
14+
"application": "example_python"
15+
}
16+
}
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"applications": {
3+
"example_python": {
4+
"type": "python 3.6",
5+
"user": "nobody",
6+
"workers": 2,
7+
"path": "/usr/share/doc/unit-python36/examples/python-app",
8+
"module": "wsgi"
9+
}
10+
},
11+
12+
"listeners": {
13+
"*:8400": {
14+
"application": "example_python"
15+
}
16+
}
17+
}

pkg/rpm/unit.module.spec.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
%%MODULE_DEFINITIONS%%
55

6-
%if 0%{?rhel} == 7
6+
%if (0%{?rhel} == 7 && 0%{?amzn} == 0)
77
%define dist .el7
88
%endif
99

pkg/rpm/unit.spec.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ Requires: initscripts >= 8.36
1010
%if 0%{?rhel} == 7
1111
Requires: systemd
1212
BuildRequires: systemd-units
13+
%if 0%{?amzn} == 0
1314
%define dist .el7
1415
%endif
16+
%endif
1517

1618
%if 0%{?suse_version} == 1315
1719
BuildRequires: systemd

0 commit comments

Comments
 (0)