diff options
Diffstat (limited to 'python-pysmbc.spec')
| -rw-r--r-- | python-pysmbc.spec | 150 |
1 files changed, 150 insertions, 0 deletions
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 |
