summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-11-01 09:39:41 +0100
committerRemi Collet <remi@remirepo.net>2017-11-01 09:39:41 +0100
commit20b8a6f1c9312c97759b25d50ceb04eb03021c65 (patch)
tree130f69f70a378f597f1c24a7a647aff74e09c449
parent5f9f4ccd76a822f7784c0397b702824e7cd6b5a5 (diff)
rename to php-icewind-smb2
update to 2.0.2
-rw-r--r--.gitignore1
-rw-r--r--composer.json24
-rw-r--r--php-icewind-smb2.spec74
3 files changed, 67 insertions, 32 deletions
diff --git a/.gitignore b/.gitignore
index fc9aa8c..f7ab517 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+php-icewind-smb2-config.json
clog
package-*.xml
*.tgz
diff --git a/composer.json b/composer.json
new file mode 100644
index 0000000..8374f56
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,24 @@
+{
+ "name" : "icewind/smb",
+ "description" : "php wrapper for smbclient and libsmbclient-php",
+ "license" : "MIT",
+ "authors" : [
+ {
+ "name" : "Robin Appelman",
+ "email": "icewind@owncloud.com"
+ }
+ ],
+ "require" : {
+ "php": ">=5.4",
+ "icewind/streams": ">=0.2.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.8"
+ },
+ "autoload" : {
+ "psr-4": {
+ "Icewind\\SMB\\": "src/",
+ "Icewind\\SMB\\Test\\": "tests/"
+ }
+ }
+}
diff --git a/php-icewind-smb2.spec b/php-icewind-smb2.spec
index c72463c..0079e3e 100644
--- a/php-icewind-smb2.spec
+++ b/php-icewind-smb2.spec
@@ -1,4 +1,4 @@
-# remirepo/fedora spec file for php-icewind-smb
+# remirepo/fedora spec file for php-icewind-smb2
#
# Copyright (c) 2015-2017 Remi Collet
# License: CC-BY-SA
@@ -7,7 +7,7 @@
# Please, preserve the changelog entries
#
# Github information
-%global gh_commit 5e073449ee3b4b8142c4eeb265f27ce72ebe3932
+%global gh_commit 6691355d9314ac3a8cb9ec9446e4c26e8aab09d0
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner icewind1991
%global gh_project SMB
@@ -17,6 +17,8 @@
# Namespace information
%global ns_vendor Icewind
%global ns_name SMB
+# API version, for parallel installation
+%global major 2
# Test suite requires a Samba server and configuration file
# yum install samba
# systemctl start smb
@@ -27,8 +29,8 @@
# create php-icewind-smb-config.json using config.json from sources
%global with_tests 0%{?_with_tests:1}
-Name: php-%{pk_vendor}-%{pk_name}
-Version: 1.1.2
+Name: php-%{pk_vendor}-%{pk_name}%{major}
+Version: 2.0.2
Release: 1%{?dist}
Summary: php wrapper for smbclient and libsmbclient-php
@@ -36,13 +38,11 @@ Group: Development/Libraries
License: MIT
URL: https://github.com/%{gh_owner}/%{gh_project}
Source0: %{url}/archive/%{gh_commit}/%{name}-%{version}-%{gh_short}.tar.gz
-Source1: %{name}-autoload.php
%if %{with_tests}
# Can't be provided, contains credential
Source2: %{name}-config.json
%endif
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
%if %{with_tests}
# For tests
@@ -53,8 +53,7 @@ BuildRequires: php-mbstring
BuildRequires: php-pcre
BuildRequires: php-posix
# From composer.json, "require-dev": {
-# "satooshi/php-coveralls" : "v1.0.0",
-# "phpunit/phpunit": "^4.8"
+# "phpunit/phpunit": "^4.8"
BuildRequires: php-composer(phpunit/phpunit) >= 4.8
BuildRequires: php-composer(theseer/autoload)
# Autoloader
@@ -62,11 +61,11 @@ BuildRequires: php-composer(fedora/autoloader)
%endif
# From composer.json, "require": {
-# "php": ">=5.4"
-# "icewind/streams": ">=0.2.0"
+# "php": ">=5.4"
+# "icewind/streams": ">=0.2.0"
Requires: php(language) >= 5.4
Requires: php-composer(%{pk_vendor}/streams) >= 0.2
-# From phpcompatinfo report for version 1.0.4
+# From phpcompatinfo report for version 2.0.2
Requires: %{_bindir}/smbclient
Requires: php-date
Requires: php-mbstring
@@ -90,14 +89,23 @@ PHP wrapper for smbclient and libsmbclient-php
* A stream-based api to remove the need for temporary files
* Support for using libsmbclient directly trough libsmbclient-php
-To use this library, you just have to add, in your project:
- require-once '%{_datadir}/php/%{ns_vendor}/%{ns_name}/autoload.php';
+Autoloader: %{_datadir}/php/%{ns_vendor}/%{ns_name}%{major}/autoload.php
%prep
%setup -q -n %{gh_project}-%{gh_commit}
-cp %{SOURCE1} src/autoload.php
+cat << 'EOF' | tee src/autoload.php
+<?php
+/* Autoloader for icewind/smb and its dependencies */
+
+require_once '%{_datadir}/php/Fedora/Autoloader/autoload.php';
+
+\Fedora\Autoloader\Autoload::addPsr4('Icewind\\SMB\\', __DIR__);
+\Fedora\Autoloader\Dependencies::required([
+ '%{_datadir}/php/Icewind/Streams/autoload.php',
+]);
+EOF
%build
@@ -105,46 +113,48 @@ cp %{SOURCE1} src/autoload.php
%install
-rm -rf %{buildroot}
-# Restore PSR-0 tree
mkdir -p %{buildroot}%{_datadir}/php/%{ns_vendor}
-cp -pr src %{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_name}
+cp -pr src %{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_name}%{major}
%if %{with_tests}
%check
+mkdir vendor
+cat << 'EOF' | tee vendor/autoload.php
+<?php
+require_once '%{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_name}%{major}/autoload.php';
+\Fedora\Autoloader\Autoload::addPsr4('Icewind\\SMB\\Test\\', dirname(__DIR__) . '/tests');
+EOF
+
cd tests
: Client configuration
cp %{SOURCE2} config.json
-: Generate a simple autoloader for test suite
-%{_bindir}/phpab --output bootstrap.php .
-echo "require '%{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_name}/autoload.php';" >> bootstrap.php
-
: Run the test suite
-%{_bindir}/phpunit
-
-if which php70; then
- php70 %{_bindir}/phpunit --verbose
-fi
+ret=0
+for cmd in php php56 php70 php71 php72; do
+ if which $cmd; then
+ $cmd %{_bindir}/phpunit || ret=1
+ fi
+done
+exit $ret
%endif
-%clean
-rm -rf %{buildroot}
-
-
%files
-%defattr(-,root,root,-)
%{!?_licensedir:%global license %%doc}
%license LICENSE.txt
%doc composer.json
%doc *.md example.php
-%{_datadir}/php/%{ns_vendor}/%{ns_name}
+%{_datadir}/php/%{ns_vendor}/%{ns_name}%{major}
%changelog
+* Wed Nov 1 2017 Remi Collet <remi@remirepo.net> - 2.0.2-1
+- rename to php-icewind-smb2
+- update to 2.0.2
+
* Thu Dec 8 2016 Remi Collet <remi@fedoraproject.org> - 1.1.2-1
- update to 1.1.2
- raise dependency on PHP 5.4