xref: /unit/pkg/rpm/Makefile.python27 (revision 1333:7b483cf5cb09)
1MODULES+=		python27
2MODULE_SUFFIX_python27=	python2.7
3
4MODULE_SUMMARY_python27=	Python 2.7 module for NGINX Unit
5
6MODULE_VERSION_python27=	$(VERSION)
7MODULE_RELEASE_python27=	1
8
9MODULE_CONFARGS_python27=	python --config=python2.7-config
10MODULE_MAKEARGS_python27=	python2.7
11MODULE_INSTARGS_python27=	python2.7-install
12
13MODULE_SOURCES_python27=	unit.example-python-app \
14			unit.example-python27-config
15
16ifneq (,$(findstring $(OSVER),opensuse-leap opensuse-tumbleweed sles))
17BUILD_DEPENDS_python27=	python-devel
18else ifneq (,$(findstring $(OSVER),fedora centos8))
19BUILD_DEPENDS_python27=	python2-devel
20else ifneq (,$(findstring $(OSVER),centos7 amazonlinux2))
21BUILD_DEPENDS_python27=	python-devel
22else
23BUILD_DEPENDS_python27=	python27-devel
24endif
25
26BUILD_DEPENDS+=		$(BUILD_DEPENDS_python27)
27
28define MODULE_DEFINITIONS_python27
29%if (0%{?rhel} == 7) || (0%{?amzn} == 2)
30Obsoletes: unit-python
31%endif
32endef
33export MODULE_DEFINITIONS_python27
34
35define MODULE_PREINSTALL_python27
36%{__mkdir} -p %{buildroot}%{_datadir}/doc/unit-python27/examples/python-app
37%{__install} -m 644 -p %{SOURCE100} \
38    %{buildroot}%{_datadir}/doc/unit-python27/examples/python-app/wsgi.py
39%{__install} -m 644 -p %{SOURCE101} \
40    %{buildroot}%{_datadir}/doc/unit-python27/examples/unit.config
41endef
42export MODULE_PREINSTALL_python27
43
44define MODULE_FILES_python27
45%{_libdir}/unit/modules/*
46%{_libdir}/unit/debug-modules/*
47endef
48export MODULE_FILES_python27
49
50define MODULE_POST_python27
51cat <<BANNER
52----------------------------------------------------------------------
53
54The $(MODULE_SUMMARY_python27) has been installed.
55
56To check the sample app, run these commands:
57
58 sudo service unit start
59 cd /usr/share/doc/%{name}/examples
60 sudo curl -X PUT --data-binary @unit.config --unix-socket /var/run/unit/control.sock http://localhost/config
61 curl http://localhost:8400/
62
63Online documentation is available at https://unit.nginx.org
64
65----------------------------------------------------------------------
66BANNER
67endef
68export MODULE_POST_python27
69