summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2023-07-21 15:44:53 +0200
committerRemi Collet <remi@php.net>2023-07-21 15:44:53 +0200
commit212d9dc23a5560688c487957526ebf0753064f12 (patch)
tree078c171dae1f2c55a534b0085bd3574aebc00a25
parente22a4088ff53d9d34c8c323de4bd3bd372b2c2f7 (diff)
build out of sources tree
-rw-r--r--REFLECTION23
-rw-r--r--php-pecl-pcsc.spec58
2 files changed, 41 insertions, 40 deletions
diff --git a/REFLECTION b/REFLECTION
index c1b1758..3bc7af9 100644
--- a/REFLECTION
+++ b/REFLECTION
@@ -1,4 +1,4 @@
-Extension [ <persistent> extension #91 PC/SC version 0.5.1 ] {
+Extension [ <persistent> extension #89 PC/SC version 0.5.1 ] {
- Constants [74] {
Constant [ int SCARD_E_BAD_SEEK ] { 2148532265 }
@@ -88,58 +88,67 @@ Extension [ <persistent> extension #91 PC/SC version 0.5.1 ] {
- Parameters [1] {
Parameter #0 [ <required> $context ]
}
+ - Return [ bool ]
}
Function [ <internal:PC/SC> function scard_is_valid_context ] {
- Parameters [1] {
Parameter #0 [ <required> $context ]
}
+ - Return [ bool ]
}
Function [ <internal:PC/SC> function scard_list_readers ] {
- Parameters [1] {
Parameter #0 [ <required> $context ]
}
+ - Return [ array|false ]
}
Function [ <internal:PC/SC> function scard_connect ] {
- Parameters [4] {
Parameter #0 [ <required> $context ]
- Parameter #1 [ <required> $reader_name ]
- Parameter #2 [ <optional> $preferred_protocol ]
- Parameter #3 [ <optional> &$current_protocol ]
+ Parameter #1 [ <required> string $reader_name ]
+ Parameter #2 [ <optional> int $preferred_protocol = SCARD_PROTOCOL_T0 | SCARD_PROTOCOL_T1 ]
+ Parameter #3 [ <optional> int &$current_protocol = NULL ]
}
+ - Return [ array|false ]
}
Function [ <internal:PC/SC> function scard_disconnect ] {
- Parameters [2] {
Parameter #0 [ <required> $card ]
- Parameter #1 [ <optional> $disposition ]
+ Parameter #1 [ <optional> int $disposition = SCARD_EJECT_CARD ]
}
+ - Return [ bool ]
}
Function [ <internal:PC/SC> function scard_transmit ] {
- Parameters [2] {
Parameter #0 [ <required> $card ]
- Parameter #1 [ <required> $command ]
+ Parameter #1 [ <required> string $command ]
}
+ - Return [ string|false ]
}
Function [ <internal:PC/SC> function scard_status ] {
- Parameters [1] {
Parameter #0 [ <required> $card ]
}
+ - Return [ array|false ]
}
Function [ <internal:PC/SC> function scard_last_errno ] {
- Parameters [0] {
}
+ - Return [ int ]
}
Function [ <internal:PC/SC> function scard_errstr ] {
- Parameters [1] {
- Parameter #0 [ <required> $errno ]
+ Parameter #0 [ <required> int $errno ]
}
+ - Return [ string ]
}
}
}
diff --git a/php-pecl-pcsc.spec b/php-pecl-pcsc.spec
index 59e71ec..0cfcbb8 100644
--- a/php-pecl-pcsc.spec
+++ b/php-pecl-pcsc.spec
@@ -1,7 +1,7 @@
# spec file for php-pecl-pcsc
#
-# Copyright (c) 2014-2021 Remi Collet
-# License: CC-BY-SA
+# Copyright (c) 2014-2023 Remi Collet
+# License: CC-BY-SA-4.0
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
@@ -11,15 +11,17 @@
%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
%global pecl_name pcsc
%global ini_name 40-%{pecl_name}.ini
+%global sources %{pecl_name}-%{version}
+%global _configure ../%{sources}/configure
Summary: An extension for PHP using the winscard PC/SC API
Name: %{?scl_prefix}php-pecl-%{pecl_name}
Version: 0.5.1
-Release: 1%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
-License: BSD
+Release: 2%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
+License: PHP-3.01
Group: Development/Languages
URL: https://pecl.php.net/package/%{pecl_name}
-Source0: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz
+Source0: https://pecl.php.net/get/%{sources}.tgz
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
@@ -29,7 +31,6 @@ BuildRequires: %{?scl_prefix}php-pear
Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
Requires: %{?scl_prefix}php(api) = %{php_core_api}
-%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}}
Provides: %{?scl_prefix}php-%{pecl_name} = %{version}
Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}
@@ -38,19 +39,6 @@ Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version}
Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version}-%{release}
Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release}
-%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel}
-# Other third party repo stuff
-%if "%{php_version}" > "7.3"
-Obsoletes: php73-pecl-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "7.4"
-Obsoletes: php74-pecl-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "8.0"
-Obsoletes: php80-pecl-%{pecl_name} <= %{version}
-%endif
-%endif
-
%description
This is an extension for using PC/SC based smart cards with PHP.
@@ -72,11 +60,10 @@ These are the files needed to compile programs using %{name}.
%prep
%setup -q -c
-mv %{pecl_name}-%{version} NTS
%{?_licensedir:sed -e '/COPYING/s/role="doc"/role="src"/' -i package.xml}
-cd NTS
+cd %{sources}
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_PCSC_VERSION/{s/.* "//;s/".*$//;p}' php_pcsc.h)
if test "x${extver}" != "x%{version}"; then
@@ -85,9 +72,9 @@ if test "x${extver}" != "x%{version}"; then
fi
cd ..
+mkdir NTS
%if %{with_zts}
-# Duplicate source tree for NTS / ZTS build
-cp -pr NTS ZTS
+mkdir ZTS
%endif
# Create configuration file
@@ -98,18 +85,19 @@ EOF
%build
-cd NTS
-%{_bindir}/phpize
+cd %{sources}
+%{__phpize}
+
+cd ../NTS
%configure \
- --with-php-config=%{_bindir}/php-config \
+ --with-php-config=%{__phpconfig} \
--with-libdir=%{_lib}
make %{?_smp_mflags}
%if %{with_zts}
cd ../ZTS
-%{_bindir}/zts-phpize
%configure \
- --with-php-config=%{_bindir}/zts-php-config \
+ --with-php-config=%{__ztsphpconfig} \
--with-libdir=%{_lib}
make %{?_smp_mflags}
%endif
@@ -134,7 +122,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 %{sources}/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
done
@@ -159,23 +147,24 @@ fi
%check
-cd NTS
+cd %{sources}
+
: Minimal load test for NTS extension
%{__php} --no-php-ini \
- --define extension=modules/%{pecl_name}.so \
+ --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
--modules | grep '^PC/SC$'
%if %{with_zts}
cd ../ZTS
: Minimal load test for ZTS extension
%{__ztsphp} --no-php-ini \
- --define extension=modules/%{pecl_name}.so \
+ --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \
--modules | grep '^PC/SC$'
%endif
%files
-%{?_licensedir:%license NTS/COPYING}
+%{?_licensedir:%license %{sources}/COPYING}
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
@@ -197,6 +186,9 @@ cd ../ZTS
%changelog
+* Fri Jul 21 2023 Remi Collet <remi@remirepo.net> - 0.5.1-2
+- build out of sources tree
+
* Sun Feb 21 2021 Remi Collet <remi@remirepo.net> - 0.5.1-1
- update to 0.5.1
- drop patch merged upstream