diff --git a/Net-LibIDN-0.12-Respect-Config-s-cc-ccflags-and-ldflags.patch b/Net-LibIDN-0.12-Respect-Config-s-cc-ccflags-and-ldflags.patch new file mode 100644 index 0000000..a1b6350 --- /dev/null +++ b/Net-LibIDN-0.12-Respect-Config-s-cc-ccflags-and-ldflags.patch @@ -0,0 +1,93 @@ +From 3bd67bf63ee68c88cc05a66607a79c5cd314a6d2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Tue, 14 Jul 2015 14:25:57 +0200 +Subject: [PATCH] Respect Config's cc ccflags and ldflags +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The ExtUils::MakeMaker expects LIBS contains only libs and INC contain +only include paths. Thus you cannot put ldflags od ccflags there. They +will be injected later when generating the Makefile. + +However to use the flags when checking for libidn, you have to use +apply them manually only for the manual check. + +This patch adds cc and ccflags into consideration as some systems +needs them when using cusotm ldflags. + +Signed-off-by: Petr Písař +--- + Makefile.PL | 31 +++++++++++++++++++------------ + 1 file changed, 19 insertions(+), 12 deletions(-) + +diff --git a/Makefile.PL b/Makefile.PL +index 6709fe1..47f63db 100644 +--- a/Makefile.PL ++++ b/Makefile.PL +@@ -47,23 +47,17 @@ sub InitMakeParams + "disable-tld" => \$disable_tld + ); + ++ $Params{LIBS} = ''; + if ($libdir) + { +- $Params{LIBS} = "-L$libdir -lidn"; +- } +- else +- { +- $Params{LIBS} = $Config{ldflags} . ' -lidn'; ++ $Params{LIBS} .= "-L$libdir "; + } ++ $Params{LIBS} .= '-lidn'; + + if ($incdir) + { + $Params{INC} = "-I$incdir"; + } +- else +- { +- $Params{INC} = ''; +- } + + my $libidn = CheckLibidn($Params{INC}, $Params{LIBS}); + +@@ -146,11 +140,24 @@ sub FilterTLD + } + } + ++sub concat { ++ my ($a, $b) = @_; ++ if (!defined $a) ++ { ++ $a = ''; ++ } ++ if (!defined $b) ++ { ++ $b = ''; ++ }; ++ return ($a . ' ' . $b); ++} ++ + sub CheckCCode + { + my $code = shift; +- my $cflags = shift; +- my $ldflags = shift; ++ my $cflags = concat($Config{ccflags}, shift); ++ my $ldflags = concat($Config{ldflags}, shift); + my $output = shift; + my $test = '__test'.$testno++; + local * FILE; +@@ -165,7 +172,7 @@ sub CheckCCode + return 0; + } + +- foreach my $cc (qw/cc gcc/) ++ foreach my $cc ($Config{cc}, qw/cc gcc/) + { + unlink($test); + system "$cc $cflags -o $test $test.c $ldflags"; +-- +2.4.3 + diff --git a/Net-LibIDN-0.12.tar.gz b/Net-LibIDN-0.12.tar.gz new file mode 100644 index 0000000..a6343b9 Binary files /dev/null and b/Net-LibIDN-0.12.tar.gz differ diff --git a/README.en.md b/README.en.md deleted file mode 100644 index c88585f..0000000 --- a/README.en.md +++ /dev/null @@ -1,36 +0,0 @@ -# perl-Net-LibIDN - -#### Description -Perl bindings for GNU Libidn - -#### Software Architecture -Software architecture description - -#### Installation - -1. xxxx -2. xxxx -3. xxxx - -#### Instructions - -1. xxxx -2. xxxx -3. xxxx - -#### Contribution - -1. Fork the repository -2. Create Feat_xxx branch -3. Commit your code -4. Create Pull Request - - -#### Gitee Feature - -1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md -2. Gitee blog [blog.gitee.com](https://blog.gitee.com) -3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) -4. The most valuable open source project [GVP](https://gitee.com/gvp) -5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) -6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/README.md b/README.md deleted file mode 100644 index 1564591..0000000 --- a/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# perl-Net-LibIDN - -#### 介绍 -Perl bindings for GNU Libidn - -#### 软件架构 -软件架构说明 - - -#### 安装教程 - -1. xxxx -2. xxxx -3. xxxx - -#### 使用说明 - -1. xxxx -2. xxxx -3. xxxx - -#### 参与贡献 - -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request - - -#### 码云特技 - -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. 码云官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解码云上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目 -5. 码云官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. 码云封面人物是一档用来展示码云会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/perl-Net-LibIDN.spec b/perl-Net-LibIDN.spec new file mode 100644 index 0000000..0d74fdb --- /dev/null +++ b/perl-Net-LibIDN.spec @@ -0,0 +1,57 @@ +Name: perl-Net-LibIDN +Version: 0.12 +Release: 33 +Summary: Perl bindings for GNU Libidn +License: GPL+ or Artistic +URL: https://metacpan.org/release/Net-LibIDN +Source0: https://cpan.metacpan.org/authors/id/T/TH/THOR/Net-LibIDN-%{version}.tar.gz +Patch0: Net-LibIDN-0.12-Respect-Config-s-cc-ccflags-and-ldflags.patch + +BuildRequires: gcc libidn-devel perl-interpreter perl-devel perl-generators +BuildRequires: perl(ExtUtils::MakeMaker) perl(Getopt::Long) perl(AutoLoader) +BuildRequires: perl(Carp) perl(Exporter) perl(Test) +Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) + +%{?perl_default_filter} + +%description +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. + +%package_help + +%prep +%autosetup -n Net-LibIDN-%{version} -p1 + +for F in _LibIDN.pm; do + iconv -f latin1 -t utf-8 < "$F" > "${F}.utf" + sed -i -e '/^=encoding\s/ s/latin1/utf-8/' "${F}.utf" + touch -r "$F" "${F}.utf" + mv "${F}.utf" "$F" +done; + +%build +perl Makefile.PL NO_PACKLIST=1 INSTALLDIRS=vendor +make %{?_smp_mflags} + +%install +make pure_install DESTDIR=$RPM_BUILD_ROOT +%{_fixperms} $RPM_BUILD_ROOT/* + +%check +make test + +%files +%defattr(-,root,root) +%{perl_vendorarch}/Net +%{perl_vendorarch}/auto/Net + +%files help +%defattr(-,root,root) +%doc Artistic Changes README +%{_mandir}/man3/Net::LibIDN.3pm.gz + +%changelog +* Mon Feb 17 2020 openEuler Buildteam - 0.12-33 +- Package init