Skip to content

Commit

Permalink
ZCS-13983:Replaced perl-net-libidn with perl-net-libidn2 for RHEL9
Browse files Browse the repository at this point in the history
  • Loading branch information
umagmrit committed Sep 13, 2024
1 parent ad2f2cd commit 38c5dba
Show file tree
Hide file tree
Showing 14 changed files with 196 additions and 1 deletion.
1 change: 1 addition & 0 deletions perl-versions.def
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
65 changes: 65 additions & 0 deletions thirdparty/perl-net-libidn2/Makefile
Original file line number Diff line number Diff line change
@@ -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)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
zimbra-perl-MODNORMNAME (VERSION-ITERATIONZAPPEND) unstable; urgency=low

* Initial Release.

-- Zimbra Packaging Services <[email protected]> Wed, 9 Sep 2015 00:00:00 +0000
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9
16 changes: 16 additions & 0 deletions thirdparty/perl-net-libidn2/zimbra-perl-net-libidn2/debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Source: zimbra-perl-MODNORMNAME
Section: perl
Priority: optional
Maintainer: Zimbra Packaging Services <[email protected]>
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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Source: https://metacpan.org/release/MODNAME
Upstream-Contact: [email protected]
Upstream-Name: MODNAME

Files: *
Copyright: 2003-2009, Thomas Jacob, Internet24.de
License: Artistic or GPL-1+

Files: debian/*
Copyright: 2015, Zimbra Packaging Services <[email protected]>
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'.
Empty file.
26 changes: 26 additions & 0 deletions thirdparty/perl-net-libidn2/zimbra-perl-net-libidn2/debian/rules
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (quilt)
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
version=3
https://metacpan.org/release/MODNAME .*/MODNAME-v?(\d[\d.-]*)\.(?:tar(?:\.gz|\.bz2)?|tgz)$
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
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
3 changes: 3 additions & 0 deletions zimbra/perl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)

Expand Down
3 changes: 3 additions & 0 deletions zimbra/perl/RHEL.def
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion zimbra/perl/zimbra-perl/rpm/SPECS/perl.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 38c5dba

Please sign in to comment.