From 38c5dbaef6cdb7902e4b557cd8d0fc6f2d2adca6 Mon Sep 17 00:00:00 2001 From: Umashankar Avagadda Date: Mon, 19 Feb 2024 07:28:11 +0000 Subject: [PATCH] ZCS-13983:Replaced perl-net-libidn with perl-net-libidn2 for RHEL9 --- perl-versions.def | 1 + thirdparty/perl-net-libidn2/Makefile | 65 +++++++++++++++++++ .../zimbra-perl-net-libidn2/debian/changelog | 5 ++ .../zimbra-perl-net-libidn2/debian/compat | 1 + .../zimbra-perl-net-libidn2/debian/control | 16 +++++ .../zimbra-perl-net-libidn2/debian/copyright | 37 +++++++++++ .../debian/patches/series | 0 .../zimbra-perl-net-libidn2/debian/rules | 26 ++++++++ .../debian/source/format | 1 + .../zimbra-perl-net-libidn2/debian/watch | 2 + .../rpm/SPECS/net-libidn2.spec | 35 ++++++++++ zimbra/perl/Makefile | 3 + zimbra/perl/RHEL.def | 3 + zimbra/perl/zimbra-perl/rpm/SPECS/perl.spec | 2 +- 14 files changed, 196 insertions(+), 1 deletion(-) create mode 100644 thirdparty/perl-net-libidn2/Makefile create mode 100644 thirdparty/perl-net-libidn2/zimbra-perl-net-libidn2/debian/changelog create mode 100644 thirdparty/perl-net-libidn2/zimbra-perl-net-libidn2/debian/compat create mode 100644 thirdparty/perl-net-libidn2/zimbra-perl-net-libidn2/debian/control create mode 100644 thirdparty/perl-net-libidn2/zimbra-perl-net-libidn2/debian/copyright create mode 100644 thirdparty/perl-net-libidn2/zimbra-perl-net-libidn2/debian/patches/series create mode 100644 thirdparty/perl-net-libidn2/zimbra-perl-net-libidn2/debian/rules create mode 100644 thirdparty/perl-net-libidn2/zimbra-perl-net-libidn2/debian/source/format create mode 100644 thirdparty/perl-net-libidn2/zimbra-perl-net-libidn2/debian/watch create mode 100644 thirdparty/perl-net-libidn2/zimbra-perl-net-libidn2/rpm/SPECS/net-libidn2.spec create mode 100644 zimbra/perl/RHEL.def diff --git a/perl-versions.def b/perl-versions.def index 9e72cf2d0..efd6a5bcb 100644 --- a/perl-versions.def +++ b/perl-versions.def @@ -73,6 +73,7 @@ NET_HTTP := 6.09 NET_LDAP := 0.65 NET_LDAPAPI := 3.0.3 NET_LIBIDN := 0.12 +NET_LIBIDN2 := 1.02 NET_SERVER := 2.009 NET_SSLEAY := 1.92 NETADDR_IP := 4.078 diff --git a/thirdparty/perl-net-libidn2/Makefile b/thirdparty/perl-net-libidn2/Makefile new file mode 100644 index 000000000..2a68b3d1f --- /dev/null +++ b/thirdparty/perl-net-libidn2/Makefile @@ -0,0 +1,65 @@ +PKG_ROOT := $(shell pwd) + +include $(PKG_ROOT)/../../package.def + +pvers := $(NET_LIBIDN2) +pname := Net-LibIDN2 +pname_lc := net-libidn2 + +pfile := $(pname)-$(pvers).tar.gz +psrc_file := $(SRC_DIR)/$(pfile) +purl := https://cpan.metacpan.org/authors/id/T/TH/THOR/$(pfile) +zname := zimbra-perl-$(pname_lc) +zspec := $(pname_lc).spec + +.PHONY: all checkos clean build getsrc pkgadd pkgrm setup + +all: checkos clean getsrc build pkgrm1 + +checkos: +ifneq ($(BUILD_PLATFORM), RHEL9_64) + @echo "Skipping OS, not required" + @exit 1 +endif + +# $(@D) == directory part of the target +getsrc: $(psrc_file) +$(psrc_file): + $(MKDIR) $(@D) && $(CD) $(@D) && $(WGET) $(purl) + +pkgadd: + $(PKG_EXTRACT) zimbra-perl-base + +pkgrm: pkgrm% +pkgrm%: + $(PKG_PURGE) zimbra-base + +setup: + $(generic-setup) + +build: setup pkgadd build_$(PKG_EXT) + +build_rpm: specfile = SPECS/$(zspec) +build_rpm: + $(CD) $(PLATFORM_DIR)/$(zname)/rpm && \ + $(replace-pkginfo) $(specfile) && \ + $(replace-pathinfo) $(specfile) && \ + $(replace-perl-modinfo) $(specfile) && \ + $(MKDIR) BUILD BUILDROOT RPMS SOURCES SRPMS && \ + $(CP) $(psrc_file) SOURCES/$(zname)-$(pvers).tar.gz && \ + $(PKG_BUILD) $(specfile) + +build_deb: z_tgz = $(zname)_$(pvers).orig.tar.gz +build_deb: z_shlibs = $(subst $(zname)/,,$(wildcard $(zname)/debian/z*.shlibs)) +build_deb: + $(CD) $(PLATFORM_DIR)/$(zname) && \ + $(replace-pkginfo) debian/changelog $(z_shlibs) && \ + $(replace-pathinfo) debian/rules && \ + $(replace-perl-modinfo) debian/changelog debian/control debian/copyright debian/watch && \ + $(CP) $(psrc_file) ../$(z_tgz) && \ + $(TAR) xfz ../$(z_tgz) --strip-components=1 --exclude=debian && \ + $(CP) $(PKG_ROOT)/patches/*.patch debian/patches/ && \ + $(PKG_BUILD) + +clean: pkgrm + $(generic-clean) diff --git a/thirdparty/perl-net-libidn2/zimbra-perl-net-libidn2/debian/changelog b/thirdparty/perl-net-libidn2/zimbra-perl-net-libidn2/debian/changelog new file mode 100644 index 000000000..7c71debe7 --- /dev/null +++ b/thirdparty/perl-net-libidn2/zimbra-perl-net-libidn2/debian/changelog @@ -0,0 +1,5 @@ +zimbra-perl-MODNORMNAME (VERSION-ITERATIONZAPPEND) unstable; urgency=low + + * Initial Release. + + -- Zimbra Packaging Services Wed, 9 Sep 2015 00:00:00 +0000 diff --git a/thirdparty/perl-net-libidn2/zimbra-perl-net-libidn2/debian/compat b/thirdparty/perl-net-libidn2/zimbra-perl-net-libidn2/debian/compat new file mode 100644 index 000000000..ec635144f --- /dev/null +++ b/thirdparty/perl-net-libidn2/zimbra-perl-net-libidn2/debian/compat @@ -0,0 +1 @@ +9 diff --git a/thirdparty/perl-net-libidn2/zimbra-perl-net-libidn2/debian/control b/thirdparty/perl-net-libidn2/zimbra-perl-net-libidn2/debian/control new file mode 100644 index 000000000..85b0ae906 --- /dev/null +++ b/thirdparty/perl-net-libidn2/zimbra-perl-net-libidn2/debian/control @@ -0,0 +1,16 @@ +Source: zimbra-perl-MODNORMNAME +Section: perl +Priority: optional +Maintainer: Zimbra Packaging Services +Build-Depends: debhelper (>= 9), zimbra-perl-base, libidn2-dev +Standards-Version: 3.9.5 +Homepage: https://metacpan.org/release/MODNAME + +Package: zimbra-perl-MODNORMNAME +Architecture: all +Depends: ${misc:Depends}, ${perl:Depends}, ${shlibs:Depends}, zimbra-perl-base, + libidn2 +Description: Net::LibIDN - Perl bindings for GNU Libidn + Provides bindings for GNU Libidn, a C library for handling + Internationalized Domain Names according to IDNA (RFC 3490), + in a way very much inspired by Turbo Fredriksson's PHP-IDN. diff --git a/thirdparty/perl-net-libidn2/zimbra-perl-net-libidn2/debian/copyright b/thirdparty/perl-net-libidn2/zimbra-perl-net-libidn2/debian/copyright new file mode 100644 index 000000000..7b53d6175 --- /dev/null +++ b/thirdparty/perl-net-libidn2/zimbra-perl-net-libidn2/debian/copyright @@ -0,0 +1,37 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Source: https://metacpan.org/release/MODNAME +Upstream-Contact: jacob@internet24.de +Upstream-Name: MODNAME + +Files: * +Copyright: 2003-2009, Thomas Jacob, Internet24.de +License: Artistic or GPL-1+ + +Files: debian/* +Copyright: 2015, Zimbra Packaging Services +License: GPL-2 + +License: Artistic + This program is free software; you can redistribute it and/or modify + it under the terms of the Artistic License, which comes with Perl. + . + On Debian systems, the complete text of the Artistic License can be + found in `/usr/share/common-licenses/Artistic'. + +License: GPL-1+ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 1, or (at your option) + any later version. + . + On Debian systems, the complete text of version 1 of the GNU General + Public License can be found in `/usr/share/common-licenses/GPL-1'. + +License: GPL-2 + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + . + On Debian systems, the full text of the GNU General Public License + version 2 can be found in `/usr/share/common-licenses/GPL-2'. diff --git a/thirdparty/perl-net-libidn2/zimbra-perl-net-libidn2/debian/patches/series b/thirdparty/perl-net-libidn2/zimbra-perl-net-libidn2/debian/patches/series new file mode 100644 index 000000000..e69de29bb diff --git a/thirdparty/perl-net-libidn2/zimbra-perl-net-libidn2/debian/rules b/thirdparty/perl-net-libidn2/zimbra-perl-net-libidn2/debian/rules new file mode 100644 index 000000000..9247fc3c1 --- /dev/null +++ b/thirdparty/perl-net-libidn2/zimbra-perl-net-libidn2/debian/rules @@ -0,0 +1,26 @@ +#!/usr/bin/make -f + +%: + dh $@ + +override_dh_auto_configure: + perl -I OZCL/perl5 Build.PL INSTALL_BASE=OZC \ + INSTALLSITEMAN1DIR=OZCS/man/man1 INSTALLSITEMAN3DIR=OZCS/man/man3 \ + LIB=OZCL/perl5 + +# these need to know about our custom location for modules +override_dh_perl: + dh_perl OZCL/perl5 + +override_dh_auto_test: + PERL5LIB=OZCL/perl5 dh_auto_test + +# remove .packlist and perllocal.pod +# $(DESTINSTALLSITEARCH)/auto/$(FULLEXT)/.packlist +# $(DESTINSTALLSITEARCH)/perllocal.pod +PERL_ARCHNAME := $(shell perl -MConfig -e 'print $$Config{archname}') +override_dh_auto_install: + ./Build install destdir=$(CURDIR)/debian/$(shell dh_listpackages)/OZCL/perl5/$(PERL_ARCHNAME) + + rm -f $(CURDIR)/debian/$(shell dh_listpackages)/OZCL/perl5/$(PERL_ARCHNAME)/perllocal.pod + rm -f $(CURDIR)/debian/$(shell dh_listpackages)/OZCL/perl5/$(PERL_ARCHNAME)/auto/*/*/.packlist diff --git a/thirdparty/perl-net-libidn2/zimbra-perl-net-libidn2/debian/source/format b/thirdparty/perl-net-libidn2/zimbra-perl-net-libidn2/debian/source/format new file mode 100644 index 000000000..163aaf8d8 --- /dev/null +++ b/thirdparty/perl-net-libidn2/zimbra-perl-net-libidn2/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/thirdparty/perl-net-libidn2/zimbra-perl-net-libidn2/debian/watch b/thirdparty/perl-net-libidn2/zimbra-perl-net-libidn2/debian/watch new file mode 100644 index 000000000..9d9d093ae --- /dev/null +++ b/thirdparty/perl-net-libidn2/zimbra-perl-net-libidn2/debian/watch @@ -0,0 +1,2 @@ +version=3 +https://metacpan.org/release/MODNAME .*/MODNAME-v?(\d[\d.-]*)\.(?:tar(?:\.gz|\.bz2)?|tgz)$ diff --git a/thirdparty/perl-net-libidn2/zimbra-perl-net-libidn2/rpm/SPECS/net-libidn2.spec b/thirdparty/perl-net-libidn2/zimbra-perl-net-libidn2/rpm/SPECS/net-libidn2.spec new file mode 100644 index 000000000..2c1786d40 --- /dev/null +++ b/thirdparty/perl-net-libidn2/zimbra-perl-net-libidn2/rpm/SPECS/net-libidn2.spec @@ -0,0 +1,35 @@ +Summary: Net::LibIDN2 - Perl bindings for GNU Libidn2 +Name: zimbra-perl-MODNORMNAME +Version: VERSION +Release: 1zimbra10.0b1ZAPPEND +License: GPL+ or Artistic +Source: %{name}-%{version}.tar.gz +Packager: Zimbra Packaging Services +Group: Development/Languages +BuildRequires: zimbra-perl-base, libidn2-devel +Requires: zimbra-perl-base, libidn2 +Obsoletes: zimbra-perl-net-libidn +AutoReqProv: no +URL: https://metacpan.org/release/MODNAME + +%description +Provides bindings for GNU Libidn2, a C library for handling internationalized domain names based on IDNA 2008, Punycode and TR46. + +%define debug_package %{nil} + +%prep +%setup -n MODNAME-%{version} + +%build +perl -I OZCL/perl5 Build.PL install_base=OZC --install_path libdoc=OZCS/man/man3 --install_path bindoc=OZCS/man/man1 +PERL5LIB=OZCL/perl5 ./Build test + +%define perl_archname %(perl -MConfig -e 'print $Config{archname}') +%install +./Build install destdir=${RPM_BUILD_ROOT} +rm -f %{buildroot}OZCL/perl5/%{perl_archname}/auto/*/*/.packlist + +%files +%defattr(-,root,root) +OZCL +OZCS/man diff --git a/zimbra/perl/Makefile b/zimbra/perl/Makefile index 2406c82ec..651dfa52e 100644 --- a/zimbra/perl/Makefile +++ b/zimbra/perl/Makefile @@ -6,6 +6,8 @@ pname_lc := perl zname := zimbra-$(pname_lc) zspec := $(pname_lc).spec +perldeps = $(perldeps.$(BUILD_PLATFORM)) + .PHONY: all clean build setup all: clean build @@ -19,6 +21,7 @@ build_rpm: specfile = SPECS/$(zspec) build_rpm: $(CD) $(PLATFORM_DIR)/$(zname)/rpm && \ $(replace-pkginfo) $(specfile) && \ + $(PERL) -pi -e 's/PERLDEPS/$(perldeps)/' $(specfile) && \ $(MKDIR) BUILD BUILDROOT RPMS SOURCES SRPMS && \ $(PKG_BUILD) $(specfile) diff --git a/zimbra/perl/RHEL.def b/zimbra/perl/RHEL.def new file mode 100644 index 000000000..ddb0f1189 --- /dev/null +++ b/zimbra/perl/RHEL.def @@ -0,0 +1,3 @@ +perldeps.RHEL9_64 := zimbra-perl-net-libidn2 +perldeps.RHEL8_64 := zimbra-perl-net-libidn +perldeps.RHEL7_64 := zimbra-perl-net-libidn diff --git a/zimbra/perl/zimbra-perl/rpm/SPECS/perl.spec b/zimbra/perl/zimbra-perl/rpm/SPECS/perl.spec index 016d3c17c..c659b5f0c 100644 --- a/zimbra/perl/zimbra-perl/rpm/SPECS/perl.spec +++ b/zimbra/perl/zimbra-perl/rpm/SPECS/perl.spec @@ -34,7 +34,7 @@ Requires: zimbra-perl-mime-lite Requires: zimbra-perl-mime-tools, zimbra-perl-mime-types, zimbra-perl-mozilla-ca, zimbra-perl-netaddr-ip Requires: zimbra-perl-net-cidr, zimbra-perl-net-cidr-lite, zimbra-perl-net-dns, zimbra-perl-net-dns-resolver-programmable Requires: zimbra-perl-net-http >= 6.09-1zimbra8.7b5ZAPPEND, zimbra-perl-net-ldap, zimbra-perl-net-ldapapi >= 3.0.3-1zimbra8.7b3ZAPPEND -Requires: zimbra-perl-net-libidn +Requires: PERLDEPS Requires: zimbra-perl-net-server >= 2.009-1zimbra8.7b1ZAPPEND Requires: zimbra-perl-net-ssleay >= 1.92-1zimbra8.8b1ZAPPEND, zimbra-perl-parent, zimbra-perl-proc-processtable Requires: zimbra-perl-soap-lite >= 1.19-1zimbra8.7b5ZAPPEND, zimbra-perl-socket