summaryrefslogtreecommitdiffstats
path: root/php-pear-Net-DNS2.spec
blob: cadb44b8cdd7e3772c80e6ee03f76c91c3963572 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# fedora/remirepo spec file for php-pear-Net-DNS2
#
# Copyright (c) 2012-2017 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#

%{!?__pear: %global __pear %{_bindir}/pear}
%global pear_name Net_DNS2

Name:           php-pear-Net-DNS2
Version:        1.4.2
Release:        2%{?dist}
Summary:        PHP Resolver library used to communicate with a DNS server

Group:          Development/Libraries
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
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
BuildRequires:  php-pear(PEAR)
# for tests
BuildRequires:  %{_bindir}/phpunit

Requires(post): %{__pear}
Requires(postun): %{__pear}
Requires:       php-pear(PEAR)

# From phpcompatinfo report for version 1.4.2
Requires:       php-ctype
Requires:       php-date
Requires:       php-json
Requires:       php-pcre
Requires:       php-shmop
Requires:       php-sockets
Requires:       php-spl
# Optional
Requires:       php-filter
Requires:       php-hash
Requires:       php-openssl

Provides:       php-pear(%{pear_name}) = %{version}
Provides:       php-composer(pear/net_dns2) = %{version}


%description
Net_DNS2 - Native PHP5 DNS Resolver and Updater

The main features for this package include:
* Increased performance; most requests are 2-10x faster than Net_DNS
* Near drop-in replacement for Net_DNS
* Uses PHP5 style classes and exceptions
* Support for IPv4 and IPv6, TCP and UDP sockets.
* Includes a separate, more intuitive Updater class for handling dynamic update
* Support zone signing using TSIG and SIG(0) for updates and zone transfers
* Includes a local cache using shared memory or flat file to improve performance
* includes many more RR's, including DNSSEC RR's.


%prep
%setup -q -c
sed -e 's/md5sum="[^"]*"//' \
    -i package.xml

cd %{pear_name}-%{version}
mv ../package.xml %{name}.xml
%patch0 -p1
%patch1 -p1


%build
cd %{pear_name}-%{version}
# Empty build section, most likely nothing required.


%install
rm -rf %{buildroot}

cd %{pear_name}-%{version}
%{__pear} install --nodeps --packagingroot %{buildroot} %{name}.xml

# Clean up unnecessary files
rm -rf %{buildroot}%{pear_metadir}/.??*

# Install XML package description
mkdir -p %{buildroot}%{pear_xmldir}
install -pm 644 %{name}.xml %{buildroot}%{pear_xmldir}


%clean
rm -rf %{buildroot}


%check
cd %{pear_name}-%{version}/tests
if ping -c 1 google.com &>/dev/null
then
  suite=AllTests.php
else
  : Resolver test disabled
  suite=Net_DNS2_ParserTest.php
fi
phpunit --include-path=.. $suite


%post
%{__pear} install --nodeps --soft --force --register-only \
    %{pear_xmldir}/%{name}.xml >/dev/null || :

%postun
if [ $1 -eq 0 ] ; then
    %{__pear} uninstall --nodeps --ignore-errors --register-only \
        pear.php.net/%{pear_name} >/dev/null || :
fi


%files
%defattr(-,root,root,-)
%doc %{pear_docdir}/%{pear_name}
%{pear_xmldir}/%{name}.xml
%dir %{pear_phpdir}/Net
%{pear_phpdir}/Net/DNS2
%{pear_phpdir}/Net/DNS2.php
%{pear_testdir}/%{pear_name}


%changelog
* Tue Nov 29 2016 Remi Collet <remi@fedoraproject.org> - 1.4.2-2
- use upstream patch for PHP 7

* Mon Nov 28 2016 Remi Collet <remi@fedoraproject.org> - 1.4.2-1
- Update to 1.4.2 (stable)
- add patch for PHP 7
  open https://github.com/mikepultz/netdns2/pull/56

* Mon Apr 13 2015 Remi Collet <remi@fedoraproject.org> - 1.4.1-1
- Update to 1.4.1

* Mon Dec 15 2014 Remi Collet <remi@fedoraproject.org> - 1.4.0-1
- Update to 1.4.0 (stable)
- provide php-composer(pear/net_dns2)

* Sun Dec 01 2013 Remi Collet <remi@fedoraproject.org> - 1.3.2-1
- Update to 1.3.2 (stable)

* Thu Jun 13 2013 Remi Collet <remi@fedoraproject.org> - 1.3.1-1
- Update to 1.3.1
- hack for https://pear.php.net/bugs/19977 (bad role)

* Mon Apr 08 2013 Remi Collet <remi@fedoraproject.org> - 1.3.0-1
- Update to 1.3.0
- hack for https://pear.php.net/bugs/19886 (shortag)

* Wed Mar 06 2013 Remi Collet <remi@fedoraproject.org> - 1.2.5-1
- Update to 1.2.5

* Sat Aug 18 2012 Remi Collet <remi@fedoraproject.org> - 1.2.3-1
- Version 1.2.3 (stable), API 1.2.3 (stable)
- upstream now provides LICENSE and tests
- run all tests if network available, else only parser

* Wed Aug 15 2012 Remi Collet <remi@fedoraproject.org> - 1.2.2-2
- rebuilt for new pear_testdir
- use php-pear(PEAR) in BR/R

* Sun Aug 12 2012 Remi Collet <remi@fedoraproject.org> - 1.2.2-1
- Version 1.2.2 (stable), API 1.2.2 (stable)
- Initial package