summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Net_DNS2-php7.patch70
-rw-r--r--php-pear-Net-DNS2.spec30
2 files changed, 18 insertions, 82 deletions
diff --git a/Net_DNS2-php7.patch b/Net_DNS2-php7.patch
deleted file mode 100644
index 5c8bb32..0000000
--- a/Net_DNS2-php7.patch
+++ /dev/null
@@ -1,70 +0,0 @@
-From 7a0e8ab3727c5f52bdf9dfb3ec0fe154ca4e699a Mon Sep 17 00:00:00 2001
-From: Mike Pultz <mike@mikepultz.com>
-Date: Mon, 28 Nov 2016 19:30:44 -0500
-Subject: [PATCH] - fixed a couple cases in NSAP.php where I was comparing a
- string to a integer - trunk is now v1.4.3
-
----
- Net/DNS2.php | 2 +-
- Net/DNS2/RR/NSAP.php | 6 +++---
- composer.json | 4 ++--
- tests/Net_DNS2_DNSSECTest.php | 2 +-
- 4 files changed, 7 insertions(+), 7 deletions(-)
-
-diff --git a/Net/DNS2.php b/Net/DNS2.php
-index 672e1cb..093ecb0 100644
---- a/Net/DNS2.php
-+++ b/Net/DNS2.php
-@@ -72,7 +72,7 @@ class Net_DNS2
- /*
- * the current version of this library
- */
-- const VERSION = '1.4.2';
-+ const VERSION = '1.4.3';
-
- /*
- * the default path to a resolv.conf file
-diff --git a/Net/DNS2/RR/NSAP.php b/Net/DNS2/RR/NSAP.php
-index b2b433a..b9d8a85 100644
---- a/Net/DNS2/RR/NSAP.php
-+++ b/Net/DNS2/RR/NSAP.php
-@@ -130,7 +130,7 @@ protected function rrFromString(array $rdata)
- //
- // make sure the afi value is 47
- //
-- if ($x['afi'] == 47) {
-+ if ($x['afi'] == '47') {
-
- $this->afi = '0x' . $x['afi'];
- $this->idi = $x['idi'];
-@@ -169,7 +169,7 @@ protected function rrSet(Net_DNS2_Packet &$packet)
- //
- // we only support AFI 47- there arent' any others defined.
- //
-- if ($this->afi == 47) {
-+ if ($this->afi == '47') {
-
- //
- // unpack the rest of the values
-@@ -212,7 +212,7 @@ protected function rrSet(Net_DNS2_Packet &$packet)
- */
- protected function rrGet(Net_DNS2_Packet &$packet)
- {
-- if ($this->afi == 0x47) {
-+ if ($this->afi == '0x47') {
-
- //
- // build the aa field
-diff --git a/tests/Net_DNS2_DNSSECTest.php b/tests/Net_DNS2_DNSSECTest.php
-index 027d614..f9febfa 100644
---- a/tests/Net_DNS2_DNSSECTest.php
-+++ b/tests/Net_DNS2_DNSSECTest.php
-@@ -80,7 +80,7 @@ public function testDNSSEC()
- $r->dnssec = true;
-
- $result = $r->query('org', 'SOA', 'IN');
--print_r($result);
-+
- $this->assertTrue(($result->header->ad == 1));
- $this->assertTrue(($result->additional[0] instanceof Net_DNS2_RR_OPT));
- $this->assertTrue(($result->additional[0]->do == 1));
diff --git a/php-pear-Net-DNS2.spec b/php-pear-Net-DNS2.spec
index cadb44b..acb33f7 100644
--- a/php-pear-Net-DNS2.spec
+++ b/php-pear-Net-DNS2.spec
@@ -11,8 +11,8 @@
%global pear_name Net_DNS2
Name: php-pear-Net-DNS2
-Version: 1.4.2
-Release: 2%{?dist}
+Version: 1.4.3
+Release: 1%{?dist}
Summary: PHP Resolver library used to communicate with a DNS server
Group: Development/Libraries
@@ -20,10 +20,8 @@ License: BSD
URL: http://pear.php.net/package/Net_DNS2
Source0: http://pear.php.net/get/%{pear_name}-%{version}.tgz
-# Fix include path furing the test suite
+# Fix include path during the test suite
Patch0: %{pear_name}-incl.patch
-# Upstream patch for PHP 7
-Patch1: %{pear_name}-php7.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@@ -74,7 +72,6 @@ sed -e 's/md5sum="[^"]*"//' \
cd %{pear_name}-%{version}
mv ../package.xml %{name}.xml
%patch0 -p1
-%patch1 -p1
%build
@@ -102,14 +99,19 @@ rm -rf %{buildroot}
%check
cd %{pear_name}-%{version}/tests
-if ping -c 1 google.com &>/dev/null
+if ! ping -c 1 google.com &>/dev/null
then
- suite=AllTests.php
-else
- : Resolver test disabled
- suite=Net_DNS2_ParserTest.php
+ : Internet needed for tests
+ exit 0
fi
-phpunit --include-path=.. $suite
+
+ret=0
+for cmd in php56 php70 php71 php; do
+ if which $cmd; then
+ $cmd %{_bindir}/phpunit --verbose --include-path=.. AllTests.php || ret=1
+ fi
+done
+exit $ret
%post
@@ -134,6 +136,10 @@ fi
%changelog
+* Tue Mar 7 2017 Remi Collet <remi@remirepo.net> - 1.4.3-1
+- Update to 1.4.3
+- only run test suite when connected to internet
+
* Tue Nov 29 2016 Remi Collet <remi@fedoraproject.org> - 1.4.2-2
- use upstream patch for PHP 7