summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-05-15 06:18:38 +0000
committerCoprDistGit <infra@openeuler.org>2023-05-15 06:18:38 +0000
commitf7e050db1d8dc530fe66c5401eaedfed352f9279 (patch)
tree260a33f9e79bf9eaf9325787145eb994b5bf60c4
parent1e70a7008324ab83f01a08b3a4172970ed1f92f2 (diff)
automatic import of python-pysmbc
-rw-r--r--.gitignore1
-rw-r--r--python-pysmbc.spec150
-rw-r--r--sources1
3 files changed, 152 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..f2697a4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/pysmbc-1.0.25.1.tar.gz
diff --git a/python-pysmbc.spec b/python-pysmbc.spec
new file mode 100644
index 0000000..11c1d1a
--- /dev/null
+++ b/python-pysmbc.spec
@@ -0,0 +1,150 @@
+%global _empty_manifest_terminate_build 0
+Name: python-pysmbc
+Version: 1.0.25.1
+Release: 1
+Summary: Python bindings for libsmbclient
+License: GPLv2+
+URL: https://github.com/hamano/pysmbc
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/d9/5c/8a26c7f6431a000ed806f5086f8c972f4edff5231d89bf76d15699167bad/pysmbc-1.0.25.1.tar.gz
+BuildArch: noarch
+
+
+%description
+This is a set of Python bindings for the libsmbclient library
+from the samba project.
+
+>>> # Directory listing example:
+>>> import smbc
+>>> ctx = smbc.Context (auth_fn=my_auth_callback_fn)
+>>> entries = ctx.opendir ("smb://SERVER").getdents ()
+>>> for entry in entries:
+... print entry
+<smbc.Dirent object "music" (File share) at 0x7fbd7c42b3a0>
+<smbc.Dirent object "IPC$" (IPC share) at 0x7fbd7c42b148>
+<smbc.Dirent object "Charlie" (Printer share) at 0x7fbd7c42b3c8>
+>>> d = ctx.open ("smb://SERVER/music")
+
+>>> # Write file example:
+>>> import smbc
+>>> import os
+>>> ctx = smbc.Context (auth_fn=my_auth_callback_fn)
+>>> file = ctx.open ("smb://SERVER/music/file.txt", os.O_CREAT | os.O_WRONLY)
+>>> file.write ("hello")
+
+>>> # Read file example:
+>>> import smbc
+>>> ctx = smbc.Context (auth_fn=my_auth_callback_fn)
+>>> file = ctx.open ("smb://SERVER/music/file.txt")
+>>> print file.read()
+hello
+
+%package -n python3-pysmbc
+Summary: Python bindings for libsmbclient
+Provides: python-pysmbc
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-pysmbc
+This is a set of Python bindings for the libsmbclient library
+from the samba project.
+
+>>> # Directory listing example:
+>>> import smbc
+>>> ctx = smbc.Context (auth_fn=my_auth_callback_fn)
+>>> entries = ctx.opendir ("smb://SERVER").getdents ()
+>>> for entry in entries:
+... print entry
+<smbc.Dirent object "music" (File share) at 0x7fbd7c42b3a0>
+<smbc.Dirent object "IPC$" (IPC share) at 0x7fbd7c42b148>
+<smbc.Dirent object "Charlie" (Printer share) at 0x7fbd7c42b3c8>
+>>> d = ctx.open ("smb://SERVER/music")
+
+>>> # Write file example:
+>>> import smbc
+>>> import os
+>>> ctx = smbc.Context (auth_fn=my_auth_callback_fn)
+>>> file = ctx.open ("smb://SERVER/music/file.txt", os.O_CREAT | os.O_WRONLY)
+>>> file.write ("hello")
+
+>>> # Read file example:
+>>> import smbc
+>>> ctx = smbc.Context (auth_fn=my_auth_callback_fn)
+>>> file = ctx.open ("smb://SERVER/music/file.txt")
+>>> print file.read()
+hello
+
+%package help
+Summary: Development documents and examples for pysmbc
+Provides: python3-pysmbc-doc
+%description help
+This is a set of Python bindings for the libsmbclient library
+from the samba project.
+
+>>> # Directory listing example:
+>>> import smbc
+>>> ctx = smbc.Context (auth_fn=my_auth_callback_fn)
+>>> entries = ctx.opendir ("smb://SERVER").getdents ()
+>>> for entry in entries:
+... print entry
+<smbc.Dirent object "music" (File share) at 0x7fbd7c42b3a0>
+<smbc.Dirent object "IPC$" (IPC share) at 0x7fbd7c42b148>
+<smbc.Dirent object "Charlie" (Printer share) at 0x7fbd7c42b3c8>
+>>> d = ctx.open ("smb://SERVER/music")
+
+>>> # Write file example:
+>>> import smbc
+>>> import os
+>>> ctx = smbc.Context (auth_fn=my_auth_callback_fn)
+>>> file = ctx.open ("smb://SERVER/music/file.txt", os.O_CREAT | os.O_WRONLY)
+>>> file.write ("hello")
+
+>>> # Read file example:
+>>> import smbc
+>>> ctx = smbc.Context (auth_fn=my_auth_callback_fn)
+>>> file = ctx.open ("smb://SERVER/music/file.txt")
+>>> print file.read()
+hello
+
+%prep
+%autosetup -n pysmbc-1.0.25.1
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-pysmbc -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Mon May 15 2023 Python_Bot <Python_Bot@openeuler.org> - 1.0.25.1-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..d6cc7d9
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+16715bce4df017b86d3ea8ded9817d2e pysmbc-1.0.25.1.tar.gz