xref: /unit/pkg/rpm/Makefile.python27 (revision 1333:7b483cf5cb09)
1490Sdefan@nginx.comMODULES+=		python27
2561Sdefan@nginx.comMODULE_SUFFIX_python27=	python2.7
3490Sdefan@nginx.com
4490Sdefan@nginx.comMODULE_SUMMARY_python27=	Python 2.7 module for NGINX Unit
5490Sdefan@nginx.com
6490Sdefan@nginx.comMODULE_VERSION_python27=	$(VERSION)
7821Svbart@nginx.comMODULE_RELEASE_python27=	1
8490Sdefan@nginx.com
9490Sdefan@nginx.comMODULE_CONFARGS_python27=	python --config=python2.7-config
10490Sdefan@nginx.comMODULE_MAKEARGS_python27=	python2.7
11490Sdefan@nginx.comMODULE_INSTARGS_python27=	python2.7-install
12490Sdefan@nginx.com
13490Sdefan@nginx.comMODULE_SOURCES_python27=	unit.example-python-app \
14490Sdefan@nginx.com			unit.example-python27-config
15490Sdefan@nginx.com
16562Sdefan@nginx.comifneq (,$(findstring $(OSVER),opensuse-leap opensuse-tumbleweed sles))
17562Sdefan@nginx.comBUILD_DEPENDS_python27=	python-devel
181016Sdefan@nginx.comelse ifneq (,$(findstring $(OSVER),fedora centos8))
19563Sdefan@nginx.comBUILD_DEPENDS_python27=	python2-devel
20*1310Sdefan@nginx.comelse ifneq (,$(findstring $(OSVER),centos7 amazonlinux2))
211301Sdefan@nginx.comBUILD_DEPENDS_python27=	python-devel
22562Sdefan@nginx.comelse
23490Sdefan@nginx.comBUILD_DEPENDS_python27=	python27-devel
24562Sdefan@nginx.comendif
25562Sdefan@nginx.com
26490Sdefan@nginx.comBUILD_DEPENDS+=		$(BUILD_DEPENDS_python27)
27490Sdefan@nginx.com
281301Sdefan@nginx.comdefine MODULE_DEFINITIONS_python27
29*1310Sdefan@nginx.com%if (0%{?rhel} == 7) || (0%{?amzn} == 2)
301301Sdefan@nginx.comObsoletes: unit-python
311301Sdefan@nginx.com%endif
321301Sdefan@nginx.comendef
331301Sdefan@nginx.comexport MODULE_DEFINITIONS_python27
341301Sdefan@nginx.com
35490Sdefan@nginx.comdefine MODULE_PREINSTALL_python27
36490Sdefan@nginx.com%{__mkdir} -p %{buildroot}%{_datadir}/doc/unit-python27/examples/python-app
37490Sdefan@nginx.com%{__install} -m 644 -p %{SOURCE100} \
38490Sdefan@nginx.com    %{buildroot}%{_datadir}/doc/unit-python27/examples/python-app/wsgi.py
39490Sdefan@nginx.com%{__install} -m 644 -p %{SOURCE101} \
40490Sdefan@nginx.com    %{buildroot}%{_datadir}/doc/unit-python27/examples/unit.config
41490Sdefan@nginx.comendef
42490Sdefan@nginx.comexport MODULE_PREINSTALL_python27
43490Sdefan@nginx.com
44490Sdefan@nginx.comdefine MODULE_FILES_python27
45490Sdefan@nginx.com%{_libdir}/unit/modules/*
46490Sdefan@nginx.com%{_libdir}/unit/debug-modules/*
47490Sdefan@nginx.comendef
48490Sdefan@nginx.comexport MODULE_FILES_python27
49490Sdefan@nginx.com
50490Sdefan@nginx.comdefine MODULE_POST_python27
51490Sdefan@nginx.comcat <<BANNER
52490Sdefan@nginx.com----------------------------------------------------------------------
53490Sdefan@nginx.com
54490Sdefan@nginx.comThe $(MODULE_SUMMARY_python27) has been installed.
55490Sdefan@nginx.com
56490Sdefan@nginx.comTo check the sample app, run these commands:
57490Sdefan@nginx.com
58490Sdefan@nginx.com sudo service unit start
59787Sdefan@nginx.com cd /usr/share/doc/%{name}/examples
60912Sdefan@nginx.com sudo curl -X PUT --data-binary @unit.config --unix-socket /var/run/unit/control.sock http://localhost/config
61490Sdefan@nginx.com curl http://localhost:8400/
62490Sdefan@nginx.com
63490Sdefan@nginx.comOnline documentation is available at https://unit.nginx.org
64490Sdefan@nginx.com
65490Sdefan@nginx.com----------------------------------------------------------------------
66490Sdefan@nginx.comBANNER
67490Sdefan@nginx.comendef
68490Sdefan@nginx.comexport MODULE_POST_python27
69