Packages: added Perl package.
This commit is contained in:
@@ -9,7 +9,8 @@ PACKAGES= unit \
|
|||||||
unit-php \
|
unit-php \
|
||||||
unit-python unit-python2.7 unit-python3.4 \
|
unit-python unit-python2.7 unit-python3.4 \
|
||||||
unit-python3.5 unit-python3.6 \
|
unit-python3.5 unit-python3.6 \
|
||||||
unit-go unit-go1.7 unit-go1.8 unit-go1.9
|
unit-go unit-go1.7 unit-go1.8 unit-go1.9 \
|
||||||
|
unit-perl
|
||||||
|
|
||||||
|
|
||||||
all: changes changelogs
|
all: changes changelogs
|
||||||
|
|||||||
@@ -5,6 +5,19 @@
|
|||||||
<change_log title="unit">
|
<change_log title="unit">
|
||||||
|
|
||||||
|
|
||||||
|
<changes apply="unit-perl" ver="0.5" rev="1"
|
||||||
|
date="2018-02-01" time="18:00:00 +0300"
|
||||||
|
packager="Andrei Belov <defan@nginx.com>">
|
||||||
|
|
||||||
|
<change>
|
||||||
|
<para>
|
||||||
|
Initial release of Perl module for NGINX Unit.
|
||||||
|
</para>
|
||||||
|
</change>
|
||||||
|
|
||||||
|
</changes>
|
||||||
|
|
||||||
|
|
||||||
<changes apply="unit-go1.9" ver="0.4" rev="1"
|
<changes apply="unit-go1.9" ver="0.4" rev="1"
|
||||||
date="2018-01-15" time="18:00:00 +0300"
|
date="2018-01-15" time="18:00:00 +0300"
|
||||||
packager="Andrei Belov <defan@nginx.com>">
|
packager="Andrei Belov <defan@nginx.com>">
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ include Makefile.python27
|
|||||||
include Makefile.python36
|
include Makefile.python36
|
||||||
include Makefile.go18
|
include Makefile.go18
|
||||||
include Makefile.go19
|
include Makefile.go19
|
||||||
|
include Makefile.perl
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Ubuntu 17.04
|
# Ubuntu 17.04
|
||||||
@@ -33,6 +34,7 @@ include Makefile.python27
|
|||||||
include Makefile.python35
|
include Makefile.python35
|
||||||
include Makefile.go17
|
include Makefile.go17
|
||||||
include Makefile.go18
|
include Makefile.go18
|
||||||
|
include Makefile.perl
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Ubuntu 16.04
|
# Ubuntu 16.04
|
||||||
@@ -41,12 +43,14 @@ include Makefile.php
|
|||||||
include Makefile.python27
|
include Makefile.python27
|
||||||
include Makefile.python35
|
include Makefile.python35
|
||||||
include Makefile.go
|
include Makefile.go
|
||||||
|
include Makefile.perl
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Ubuntu 14.04
|
# Ubuntu 14.04
|
||||||
ifeq ($(CODENAME),trusty)
|
ifeq ($(CODENAME),trusty)
|
||||||
include Makefile.php
|
include Makefile.php
|
||||||
include Makefile.python
|
include Makefile.python
|
||||||
|
include Makefile.perl
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Debian 9
|
# Debian 9
|
||||||
@@ -56,6 +60,7 @@ include Makefile.python27
|
|||||||
include Makefile.python35
|
include Makefile.python35
|
||||||
include Makefile.go17
|
include Makefile.go17
|
||||||
include Makefile.go18
|
include Makefile.go18
|
||||||
|
include Makefile.perl
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Debian 8
|
# Debian 8
|
||||||
@@ -63,6 +68,7 @@ ifeq ($(CODENAME),jessie)
|
|||||||
include Makefile.php
|
include Makefile.php
|
||||||
include Makefile.python27
|
include Makefile.python27
|
||||||
include Makefile.python34
|
include Makefile.python34
|
||||||
|
include Makefile.perl
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CONFIGURE_ARGS=\
|
CONFIGURE_ARGS=\
|
||||||
|
|||||||
45
pkg/deb/Makefile.perl
Normal file
45
pkg/deb/Makefile.perl
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
MODULES+= perl
|
||||||
|
MODULE_SUFFIX_perl= perl
|
||||||
|
|
||||||
|
MODULE_SUMMARY_perl= Perl module for NGINX Unit
|
||||||
|
|
||||||
|
MODULE_VERSION_perl= $(VERSION)
|
||||||
|
MODULE_RELEASE_perl= 1
|
||||||
|
|
||||||
|
MODULE_CONFARGS_perl= perl
|
||||||
|
MODULE_MAKEARGS_perl= perl
|
||||||
|
MODULE_INSTARGS_perl= perl-install
|
||||||
|
|
||||||
|
MODULE_SOURCES_perl= unit.example-perl-app \
|
||||||
|
unit.example-perl-config
|
||||||
|
|
||||||
|
BUILD_DEPENDS_perl= libperl-dev
|
||||||
|
BUILD_DEPENDS+= $(BUILD_DEPENDS_perl)
|
||||||
|
|
||||||
|
MODULE_BUILD_DEPENDS_perl=,libperl-dev
|
||||||
|
|
||||||
|
define MODULE_PREINSTALL_perl
|
||||||
|
mkdir -p debian/unit-perl/usr/share/doc/unit-perl/examples/perl-app
|
||||||
|
install -m 644 -p debian/unit.example-perl-app debian/unit-perl/usr/share/doc/unit-perl/examples/perl-app/index.pl
|
||||||
|
install -m 644 -p debian/unit.example-perl-config debian/unit-perl/usr/share/doc/unit-perl/examples/unit.config
|
||||||
|
endef
|
||||||
|
export MODULE_PREINSTALL_perl
|
||||||
|
|
||||||
|
define MODULE_POST_perl
|
||||||
|
cat <<BANNER
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
|
The $(MODULE_SUMMARY_perl) has been installed.
|
||||||
|
|
||||||
|
To check out the sample app, run these commands:
|
||||||
|
|
||||||
|
sudo service unit restart
|
||||||
|
sudo service unit loadconfig /usr/share/doc/unit-perl/examples/unit.config
|
||||||
|
curl http://localhost:8600/
|
||||||
|
|
||||||
|
Online documentation is available at https://unit.nginx.org
|
||||||
|
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
BANNER
|
||||||
|
endef
|
||||||
|
export MODULE_POST_perl
|
||||||
12
pkg/deb/debian.module/unit.example-perl-app
Normal file
12
pkg/deb/debian.module/unit.example-perl-app
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
#!/usr/bin/env perl
|
||||||
|
|
||||||
|
use Data::Dumper;
|
||||||
|
|
||||||
|
my $app = sub {
|
||||||
|
my $env = shift;
|
||||||
|
return [
|
||||||
|
'200',
|
||||||
|
[ 'Content-Type' => 'text/plain' ],
|
||||||
|
[ "Hello from Unit, Perl $^V, environment:\n\n", Dumper($env) ],
|
||||||
|
];
|
||||||
|
};
|
||||||
17
pkg/deb/debian.module/unit.example-perl-config
Normal file
17
pkg/deb/debian.module/unit.example-perl-config
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"applications": {
|
||||||
|
"example_perl": {
|
||||||
|
"type": "perl",
|
||||||
|
"user": "nobody",
|
||||||
|
"processes": 1,
|
||||||
|
"working_directory": "/usr/share/doc/unit-perl/examples/perl-app",
|
||||||
|
"script": "/usr/share/doc/unit-perl/examples/perl-app/index.pl"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"listeners": {
|
||||||
|
"*:8600": {
|
||||||
|
"application": "example_perl"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -20,6 +20,14 @@
|
|||||||
"type": "go",
|
"type": "go",
|
||||||
"user": "nobody",
|
"user": "nobody",
|
||||||
"executable": "/tmp/go-app"
|
"executable": "/tmp/go-app"
|
||||||
|
},
|
||||||
|
|
||||||
|
"example_perl": {
|
||||||
|
"type": "perl",
|
||||||
|
"user": "nobody",
|
||||||
|
"processes": 1,
|
||||||
|
"working_directory": "/usr/share/doc/unit-perl/examples/perl-app",
|
||||||
|
"script": "/usr/share/doc/unit-perl/examples/perl-app/index.pl"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -34,6 +42,10 @@
|
|||||||
|
|
||||||
"*:8500": {
|
"*:8500": {
|
||||||
"application": "example_go"
|
"application": "example_go"
|
||||||
|
},
|
||||||
|
|
||||||
|
"*:8600": {
|
||||||
|
"application": "example_perl"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ ifneq (,$(findstring $(OSVER),centos6 centos7 amazonlinux2))
|
|||||||
include Makefile.php
|
include Makefile.php
|
||||||
include Makefile.python
|
include Makefile.python
|
||||||
include Makefile.go
|
include Makefile.go
|
||||||
|
include Makefile.perl
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(OSVER), amazonlinux1)
|
ifeq ($(OSVER), amazonlinux1)
|
||||||
@@ -37,6 +38,7 @@ include Makefile.python34
|
|||||||
include Makefile.python35
|
include Makefile.python35
|
||||||
include Makefile.python36
|
include Makefile.python36
|
||||||
include Makefile.go
|
include Makefile.go
|
||||||
|
include Makefile.perl
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CONFIGURE_ARGS=\
|
CONFIGURE_ARGS=\
|
||||||
|
|||||||
50
pkg/rpm/Makefile.perl
Normal file
50
pkg/rpm/Makefile.perl
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
MODULES+= perl
|
||||||
|
|
||||||
|
MODULE_SUMMARY_perl= Perl module for NGINX Unit
|
||||||
|
|
||||||
|
MODULE_VERSION_perl= $(VERSION)
|
||||||
|
MODULE_RELEASE_perl= 1
|
||||||
|
|
||||||
|
MODULE_CONFARGS_perl= perl
|
||||||
|
MODULE_MAKEARGS_perl= perl
|
||||||
|
MODULE_INSTARGS_perl= perl-install
|
||||||
|
|
||||||
|
MODULE_SOURCES_perl= unit.example-perl-app \
|
||||||
|
unit.example-perl-config
|
||||||
|
|
||||||
|
BUILD_DEPENDS_perl= perl-devel perl-libs
|
||||||
|
BUILD_DEPENDS+= $(BUILD_DEPENDS_perl)
|
||||||
|
|
||||||
|
define MODULE_PREINSTALL_perl
|
||||||
|
%{__mkdir} -p %{buildroot}%{_datadir}/doc/unit-perl/examples/perl-app
|
||||||
|
%{__install} -m 644 -p %{SOURCE100} \
|
||||||
|
%{buildroot}%{_datadir}/doc/unit-perl/examples/perl-app/index.pl
|
||||||
|
%{__install} -m 644 -p %{SOURCE101} \
|
||||||
|
%{buildroot}%{_datadir}/doc/unit-perl/examples/unit.config
|
||||||
|
endef
|
||||||
|
export MODULE_PREINSTALL_perl
|
||||||
|
|
||||||
|
define MODULE_FILES_perl
|
||||||
|
%{_libdir}/unit/modules/*
|
||||||
|
%{_libdir}/unit/debug-modules/*
|
||||||
|
endef
|
||||||
|
export MODULE_FILES_perl
|
||||||
|
|
||||||
|
define MODULE_POST_perl
|
||||||
|
cat <<BANNER
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
|
The $(MODULE_SUMMARY_perl) has been installed.
|
||||||
|
|
||||||
|
To check out the sample app, run these commands:
|
||||||
|
|
||||||
|
sudo service unit start
|
||||||
|
sudo service unit loadconfig /usr/share/doc/unit-perl/examples/unit.config
|
||||||
|
curl http://localhost:8600/
|
||||||
|
|
||||||
|
Online documentation is available at https://unit.nginx.org
|
||||||
|
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
BANNER
|
||||||
|
endef
|
||||||
|
export MODULE_POST_perl
|
||||||
12
pkg/rpm/rpmbuild/SOURCES/unit.example-perl-app
Normal file
12
pkg/rpm/rpmbuild/SOURCES/unit.example-perl-app
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
#!/usr/bin/env perl
|
||||||
|
|
||||||
|
use Data::Dumper;
|
||||||
|
|
||||||
|
my $app = sub {
|
||||||
|
my $env = shift;
|
||||||
|
return [
|
||||||
|
'200',
|
||||||
|
[ 'Content-Type' => 'text/plain' ],
|
||||||
|
[ "Hello from Unit, Perl $^V, environment:\n\n", Dumper($env) ],
|
||||||
|
];
|
||||||
|
};
|
||||||
17
pkg/rpm/rpmbuild/SOURCES/unit.example-perl-config
Normal file
17
pkg/rpm/rpmbuild/SOURCES/unit.example-perl-config
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"applications": {
|
||||||
|
"example_perl": {
|
||||||
|
"type": "perl",
|
||||||
|
"user": "nobody",
|
||||||
|
"processes": 1,
|
||||||
|
"working_directory": "/usr/share/doc/unit-perl/examples/perl-app",
|
||||||
|
"script": "/usr/share/doc/unit-perl/examples/perl-app/index.pl"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"listeners": {
|
||||||
|
"*:8600": {
|
||||||
|
"application": "example_perl"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -20,6 +20,14 @@
|
|||||||
"type": "go",
|
"type": "go",
|
||||||
"user": "nobody",
|
"user": "nobody",
|
||||||
"executable": "/tmp/go-app"
|
"executable": "/tmp/go-app"
|
||||||
|
},
|
||||||
|
|
||||||
|
"example_perl": {
|
||||||
|
"type": "perl",
|
||||||
|
"user": "nobody",
|
||||||
|
"processes": 1,
|
||||||
|
"working_directory": "/usr/share/doc/unit-perl/examples/perl-app",
|
||||||
|
"script": "/usr/share/doc/unit-perl/examples/perl-app/index.pl"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -34,6 +42,10 @@
|
|||||||
|
|
||||||
"*:8500": {
|
"*:8500": {
|
||||||
"application": "example_go"
|
"application": "example_go"
|
||||||
|
},
|
||||||
|
|
||||||
|
"*:8600": {
|
||||||
|
"application": "example_perl"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user