summaryrefslogtreecommitdiffstats
path: root/php-pecl-libsodium2.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-pecl-libsodium2.spec')
-rw-r--r--php-pecl-libsodium2.spec73
1 files changed, 43 insertions, 30 deletions
diff --git a/php-pecl-libsodium2.spec b/php-pecl-libsodium2.spec
index dd33410..b65263e 100644
--- a/php-pecl-libsodium2.spec
+++ b/php-pecl-libsodium2.spec
@@ -12,7 +12,8 @@
%endif
%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
-%global pecl_name libsodium
+%global proj_name libsodium
+%global pecl_name sodium
%global with_tests 0%{!?_without_tests:1}
%if "%{php_version}" < "5.6"
%global ini_name %{pecl_name}.ini
@@ -22,23 +23,23 @@
%global buildver %(pkg-config --silence-errors --modversion libsodium 2>/dev/null || echo 65536)
Summary: Wrapper for the Sodium cryptographic library
-Name: %{?sub_prefix}php-pecl-%{pecl_name}
-Version: 1.0.6
-Release: 3%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Name: %{?sub_prefix}php-pecl-%{proj_name}2
+Version: 2.0.2
+Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
License: BSD
Group: Development/Languages
-URL: http://pecl.php.net/package/%{pecl_name}
-Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
+URL: http://pecl.php.net/package/%{proj_name}
+Source0: http://pecl.php.net/get/%{proj_name}-%{version}.tgz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%if "%{?vendor}" == "Remi Collet"
# Ensure libsodium-last is used
-BuildRequires: libsodium-devel >= 1.0.7
+BuildRequires: pkgconfig(libsodium) >= 1.0.12
%else
# Per upstream documentation
BuildRequires: libsodium-devel >= 0.6.0
%endif
-BuildRequires: %{?scl_prefix}php-devel > 5.4
+BuildRequires: %{?scl_prefix}php-devel > 7
BuildRequires: %{?scl_prefix}php-pear
BuildRequires: %{?scl_prefix}php-json
BuildRequires: pkgconfig
@@ -50,34 +51,40 @@ Requires: libsodium%{?_isa} >= %{buildver}
Provides: %{?scl_prefix}php-%{pecl_name} = %{version}
Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}
-Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version}
-Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version}
+Provides: %{?scl_prefix}php-pecl(%{proj_name}) = %{version}
+Provides: %{?scl_prefix}php-pecl(%{proj_name})%{?_isa} = %{version}
%if "%{?scl_prefix}" != "%{?sub_prefix}"
-Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version}-%{release}
-Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release}
+Provides: %{?scl_prefix}php-pecl-%{pecl_name}2 = %{version}-%{release}
+Provides: %{?scl_prefix}php-pecl-%{pecl_name}2%{?_isa} = %{version}-%{release}
%endif
+# Only one version
+Conflicts: %{?scl_prefix}php-pecl-%{proj_name} < 2
%if "%{?vendor}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel}
# Other third party repo stuff
-Obsoletes: php53-pecl-%{pecl_name} <= %{version}
-Obsoletes: php53u-pecl-%{pecl_name} <= %{version}
-Obsoletes: php54-pecl-%{pecl_name} <= %{version}
-Obsoletes: php54w-pecl-%{pecl_name} <= %{version}
+Obsoletes: php53-pecl-%{proj_name}2 <= %{version}
+Obsoletes: php53u-pecl-%{proj_name}2 <= %{version}
+Obsoletes: php54-pecl-%{proj_name}2 <= %{version}
+Obsoletes: php54w-pecl-%{proj_name}2 <= %{version}
%if "%{php_version}" > "5.5"
-Obsoletes: php55u-pecl-%{pecl_name} <= %{version}
-Obsoletes: php55w-pecl-%{pecl_name} <= %{version}
+Obsoletes: php55u-pecl-%{proj_name}2 <= %{version}
+Obsoletes: php55w-pecl-%{proj_name}2 <= %{version}
%endif
%if "%{php_version}" > "5.6"
-Obsoletes: php56u-pecl-%{pecl_name} <= %{version}
-Obsoletes: php56w-pecl-%{pecl_name} <= %{version}
+Obsoletes: php56u-pecl-%{proj_name}2 <= %{version}
+Obsoletes: php56w-pecl-%{proj_name}2 <= %{version}
%endif
%if "%{php_version}" > "7.0"
-Obsoletes: php70u-pecl-%{pecl_name} <= %{version}
-Obsoletes: php70w-pecl-%{pecl_name} <= %{version}
+Obsoletes: php70u-pecl-%{proj_name}2 <= %{version}
+Obsoletes: php70w-pecl-%{proj_name}2 <= %{version}
%endif
%if "%{php_version}" > "7.1"
-Obsoletes: php71u-pecl-%{pecl_name} <= %{version}
-Obsoletes: php71w-pecl-%{pecl_name} <= %{version}
+Obsoletes: php71u-pecl-%{proj_name}2 <= %{version}
+Obsoletes: php71w-pecl-%{proj_name}2 <= %{version}
+%endif
+%if "%{php_version}" > "7.2"
+Obsoletes: php72u-pecl-%{proj_name}2 <= %{version}
+Obsoletes: php72w-pecl-%{proj_name}2 <= %{version}
%endif
%endif
@@ -96,7 +103,7 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
%prep
%setup -q -c
-mv %{pecl_name}-%{version} NTS
+mv %{proj_name}-%{version} NTS
# Don't install tests
sed -e 's/role="test"/role="src"/' \
@@ -105,8 +112,10 @@ sed -e 's/role="test"/role="src"/' \
cd NTS
+sed -e '/PHP_SODIUM_VERSION/s/2.0.1/2.0.2/' -i php_libsodium.h
+
# Sanity check, really often broken
-extver=$(sed -n '/#define PHP_LIBSODIUM_VERSION/{s/.* "//;s/".*$//;p}' php_libsodium.h)
+extver=$(sed -n '/#define PHP_SODIUM_VERSION/{s/.* "//;s/".*$//;p}' php_libsodium.h)
if test "x${extver}" != "x%{version}"; then
: Error: Upstream extension version is ${extver}, expecting %{version}.
exit 1
@@ -120,7 +129,7 @@ cp -pr NTS ZTS
# Create configuration file
cat > %{ini_name} << 'EOF'
-; Enable %{pecl_name} extension module
+; Enable %{proj_name} extension module
extension=%{pecl_name}.so
EOF
@@ -160,7 +169,7 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
# Documentation
for i in $(grep 'role="doc"' package.xml | sed -e 's/^.*name="//;s/".*$//')
-do install -Dpm 644 NTS/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
+do install -Dpm 644 NTS/$i %{buildroot}%{pecl_docdir}/%{proj_name}/$i
done
@@ -179,7 +188,7 @@ fi
%postun
if [ $1 -eq 0 -a -x %{__pecl} ] ; then
- %{pecl_uninstall} %{pecl_name} >/dev/null || :
+ %{pecl_uninstall} %{proj_name} >/dev/null || :
fi
%endif
@@ -224,7 +233,7 @@ rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
-%doc %{pecl_docdir}/%{pecl_name}
+%doc %{pecl_docdir}/%{proj_name}
%{?_licensedir:%license NTS/LICENSE}
%{pecl_xmldir}/%{name}.xml
@@ -238,6 +247,10 @@ rm -rf %{buildroot}
%changelog
+* Mon Jul 17 2017 Remi Collet <remi@fedoraproject.org> - 2.0.2-1
+- renamed to php-pecl-libsodium2 (new API)
+- update to 2.0.2
+
* Thu Dec 1 2016 Remi Collet <remi@fedoraproject.org> - 1.0.6-3
- rebuild with PHP 7.1.0 GA