git: 6a7814d13943 - main - www/p5-URI-Normalize: Add new port

From: Dan Langille <dvl_at_FreeBSD.org>
Date: Mon, 25 Apr 2022 13:17:11 UTC
The branch main has been updated by dvl:

URL: https://cgit.FreeBSD.org/ports/commit/?id=6a7814d1394361b14c5fb6f1dc8e0d3ae02dd003

commit 6a7814d1394361b14c5fb6f1dc8e0d3ae02dd003
Author:     Dan Langille <dvl@FreeBSD.org>
AuthorDate: 2022-04-25 13:14:20 +0000
Commit:     Dan Langille <dvl@FreeBSD.org>
CommitDate: 2022-04-25 13:17:03 +0000

    www/p5-URI-Normalize: Add new port
    
    ::Normalize normalizes URIs according to RFC 3986.
    
    This has a number of useful applications in allowing URIs to be compared with
    fewer false negatives. For example, all of the following URIs will normalize to
    the same value:
    
    HTTPS://www.example.com:443/../test/../foo/index.html
    https://WWW.EXAMPLE.COM/./foo/index.html
    https://www.example.com/%66%6f%6f/index.html
    https://www.example.com/foo/index.html
    
    That is, they will all be normalized into the last value.
    
    Example:
    
    use URI;
    use URI::Normalize qw( normalize_uri remove_dot_segments );
    my $uri = URI->new('HTTPS://www.Example.com:443/../test/../foo/index.html');
    
    say normalize_uri($uri);       #> https://www.example.com/foo/index.html
    say remove_dot_segments($uri); #> HTTPS://www.Example.com:443/foo/index.html
    
    WWW: https://metacpan.org/pod/URI::Normalize
---
 www/Makefile                   |  1 +
 www/p5-URI-Normalize/Makefile  | 21 +++++++++++++++++++++
 www/p5-URI-Normalize/distinfo  |  3 +++
 www/p5-URI-Normalize/pkg-descr | 23 +++++++++++++++++++++++
 www/p5-URI-Normalize/pkg-plist |  2 ++
 5 files changed, 50 insertions(+)

diff --git a/www/Makefile b/www/Makefile
index 572ef34a7fc3..ad35bf9c9c13 100644
--- a/www/Makefile
+++ b/www/Makefile
@@ -1193,6 +1193,7 @@
     SUBDIR += p5-URI-Escape-JavaScript
     SUBDIR += p5-URI-Escape-XS
     SUBDIR += p5-URI-Fetch
+    SUBDIR += p5-URI-Normalize
     SUBDIR += p5-URI-ParseSearchString
     SUBDIR += p5-URI-Sequin
     SUBDIR += p5-URI-Title
diff --git a/www/p5-URI-Normalize/Makefile b/www/p5-URI-Normalize/Makefile
new file mode 100644
index 000000000000..d153569e0eba
--- /dev/null
+++ b/www/p5-URI-Normalize/Makefile
@@ -0,0 +1,21 @@
+PORTNAME=	URI-Normalize
+PORTVERSION=	0.002
+CATEGORIES=	www perl5
+MASTER_SITES=	CPAN
+PKGNAMEPREFIX=	p5-
+
+MAINTAINER=	dvl@FreeBSD.org
+COMMENT=	Normalize URIs according to RFC 3986
+
+LICENSE=	GPLv1 ART10
+LICENSE_COMB=	dual
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+RUN_DEPENDS=	p5-URI>0:net/p5-URI
+
+USES=		perl5
+
+NO_ARCH=	yes
+USE_PERL5=	configure
+
+.include <bsd.port.mk>
diff --git a/www/p5-URI-Normalize/distinfo b/www/p5-URI-Normalize/distinfo
new file mode 100644
index 000000000000..0b2646d2e496
--- /dev/null
+++ b/www/p5-URI-Normalize/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1650631625
+SHA256 (URI-Normalize-0.002.tar.gz) = e08b96b53f45bc2e4b1ffb1eddbbf85ae89e6177c7ad79ea112a2b92040b1e83
+SIZE (URI-Normalize-0.002.tar.gz) = 10825
diff --git a/www/p5-URI-Normalize/pkg-descr b/www/p5-URI-Normalize/pkg-descr
new file mode 100644
index 000000000000..fb3526db427b
--- /dev/null
+++ b/www/p5-URI-Normalize/pkg-descr
@@ -0,0 +1,23 @@
+URI::Normalize normalizes URIs according to RFC 3986.
+
+This has a number of useful applications in allowing URIs to be compared with
+fewer false negatives. For example, all of the following URIs will normalize to
+the same value:
+
+HTTPS://www.example.com:443/../test/../foo/index.html
+https://WWW.EXAMPLE.COM/./foo/index.html
+https://www.example.com/%66%6f%6f/index.html
+https://www.example.com/foo/index.html
+
+That is, they will all be normalized into the last value.
+
+Example:
+
+use URI;
+use URI::Normalize qw( normalize_uri remove_dot_segments );
+my $uri = URI->new('HTTPS://www.Example.com:443/../test/../foo/index.html');
+
+say normalize_uri($uri);       #> https://www.example.com/foo/index.html
+say remove_dot_segments($uri); #> HTTPS://www.Example.com:443/foo/index.html
+
+WWW: https://metacpan.org/pod/URI::Normalize
diff --git a/www/p5-URI-Normalize/pkg-plist b/www/p5-URI-Normalize/pkg-plist
new file mode 100644
index 000000000000..fd7122b33775
--- /dev/null
+++ b/www/p5-URI-Normalize/pkg-plist
@@ -0,0 +1,2 @@
+%%SITE_PERL%%/URI/Normalize.pm
+%%PERL5_MAN3%%/URI::Normalize.3.gz