xref: /unit/pkg/rpm/Makefile.perl (revision 912:23693ac60089)
1MODULES+=		perl
2MODULE_SUFFIX_perl=	perl
3
4MODULE_SUMMARY_perl=	Perl module for NGINX Unit
5
6MODULE_VERSION_perl=	$(VERSION)
7MODULE_RELEASE_perl=	1
8
9MODULE_CONFARGS_perl=	perl
10MODULE_MAKEARGS_perl=	perl
11MODULE_INSTARGS_perl=	perl-install
12
13MODULE_SOURCES_perl=	unit.example-perl-app \
14			unit.example-perl-config
15
16ifneq (,$(findstring $(OSVER),opensuse-leap opensuse-tumbleweed sles))
17BUILD_DEPENDS_perl=	perl
18else
19BUILD_DEPENDS_perl=	perl-devel perl-libs perl-ExtUtils-Embed
20endif
21
22BUILD_DEPENDS+=		$(BUILD_DEPENDS_perl)
23
24define MODULE_DEFINITIONS_perl
25BuildRequires: $(BUILD_DEPENDS_perl)
26endef
27export MODULE_DEFINITIONS_perl
28
29define MODULE_PREINSTALL_perl
30%{__mkdir} -p %{buildroot}%{_datadir}/doc/unit-perl/examples/perl-app
31%{__install} -m 644 -p %{SOURCE100} \
32    %{buildroot}%{_datadir}/doc/unit-perl/examples/perl-app/index.pl
33%{__install} -m 644 -p %{SOURCE101} \
34    %{buildroot}%{_datadir}/doc/unit-perl/examples/unit.config
35endef
36export MODULE_PREINSTALL_perl
37
38define MODULE_FILES_perl
39%{_libdir}/unit/modules/*
40%{_libdir}/unit/debug-modules/*
41endef
42export MODULE_FILES_perl
43
44define MODULE_POST_perl
45cat <<BANNER
46----------------------------------------------------------------------
47
48The $(MODULE_SUMMARY_perl) has been installed.
49
50To check out the sample app, run these commands:
51
52 sudo service unit start
53 cd /usr/share/doc/%{name}/examples
54 sudo curl -X PUT --data-binary @unit.config --unix-socket /var/run/unit/control.sock http://localhost/config
55 curl http://localhost:8600/
56
57Online documentation is available at https://unit.nginx.org
58
59----------------------------------------------------------------------
60BANNER
61endef
62export MODULE_POST_perl
63