From cdd247fd26a980c14f19e85d8c22b9970a568d7da64b851ce1b8fd2355deb5ad Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Thu, 18 Feb 2016 11:51:37 +0000 Subject: [PATCH] Accepting request 359630 from home:Rotkraut Add package python3-magic providing Python 3 bindings. OBS-URL: https://build.opensuse.org/request/show/359630 OBS-URL: https://build.opensuse.org/package/show/Base:System/file?expand=0&rev=126 --- file.changes | 5 ++++ file.spec | 4 ++- python-magic.changes | 7 +++++ python-magic.spec | 12 ++++++--- python3-magic.changes | 5 ++++ python3-magic.spec | 59 +++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 87 insertions(+), 5 deletions(-) create mode 100644 python3-magic.changes create mode 100644 python3-magic.spec diff --git a/file.changes b/file.changes index ba8fc70..fac5865 100644 --- a/file.changes +++ b/file.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Feb 16 12:40:33 UTC 2016 - rolf@rotkraut.de + +- Make the python command a macro. + ------------------------------------------------------------------- Thu Jan 21 11:32:14 UTC 2016 - dmueller@suse.com diff --git a/file.spec b/file.spec index c2d1ddb..cfc1e4a 100644 --- a/file.spec +++ b/file.spec @@ -19,6 +19,8 @@ %define somajor 1 %define libname libmagic%{somajor} +%define python python + Name: file BuildRequires: findutils BuildRequires: libtool @@ -143,7 +145,7 @@ CFLAGS="$RPM_OPT_FLAGS -DHOWMANY=69632 -fPIE" %{__make} %{?_smp_mflags} pkgdatadir='$(datadir)' LDFLAGS="-pie" %if 0%{?build_python_bindings:1} pushd python -python setup.py build +%python setup.py build popd %endif diff --git a/python-magic.changes b/python-magic.changes index a37083e..42fb0a7 100644 --- a/python-magic.changes +++ b/python-magic.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Feb 16 12:41:14 UTC 2016 - rolf@rotkraut.de + +- Make the python command a macro. +- Remove %py_requires. +- Add dependency on libmagic. + ------------------------------------------------------------------- Thu Jan 21 11:32:14 UTC 2016 - dmueller@suse.com diff --git a/python-magic.spec b/python-magic.spec index 6ca8651..247da54 100644 --- a/python-magic.spec +++ b/python-magic.spec @@ -16,6 +16,10 @@ # +%{expand:%(sed -n -e '/^%%define somajor/,/^%%define libname/p' <%_sourcedir/file.spec)} + +%define python python + Name: python-magic %define build_python_bindings 1 BuildRequires: findutils @@ -28,9 +32,9 @@ Release: 0 Summary: Python module to use libmagic License: BSD-3-Clause and BSD-4-Clause Group: Development/Languages/Python -%py_requires Source99: file.spec %{expand:%(sed -n -e '/^Source:/,/^BuildRoot:/p' <%_sourcedir/file.spec)} +Requires: %libname %global _sysconfdir /etc %global _miscdir %{_datadir}/misc @@ -43,9 +47,9 @@ interface. %install pushd python -python setup.py install --root=%{buildroot} \ - --prefix=%{_prefix} \ - --record-rpm=../python_files +%python setup.py install --root=%{buildroot} \ + --prefix=%{_prefix} \ + --record-rpm=../python_files popd %files -f python_files diff --git a/python3-magic.changes b/python3-magic.changes new file mode 100644 index 0000000..6b4698f --- /dev/null +++ b/python3-magic.changes @@ -0,0 +1,5 @@ +------------------------------------------------------------------- +Tue Feb 16 12:42:29 UTC 2016 - rolf@rotkraut.de + +- Add package python3-magic. + diff --git a/python3-magic.spec b/python3-magic.spec new file mode 100644 index 0000000..1fa1742 --- /dev/null +++ b/python3-magic.spec @@ -0,0 +1,59 @@ +# +# spec file for package python3-magic +# +# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# + + +%{expand:%(sed -n -e '/^%%define somajor/,/^%%define libname/p' <%_sourcedir/file.spec)} + +%define python python3 + +Name: python3-magic +%define build_python_bindings 1 +BuildRequires: findutils +BuildRequires: libtool +BuildRequires: python3-devel +BuildRequires: zlib-devel +Url: http://www.darwinsys.com/file/ +Version: 5.25 +Release: 0 +Summary: Python module to use libmagic +License: BSD-3-Clause and BSD-4-Clause +Group: Development/Languages/Python +Source99: file.spec +%{expand:%(sed -n -e '/^Source:/,/^BuildRoot:/p' <%_sourcedir/file.spec)} +Requires: %libname +%global _sysconfdir /etc +%global _miscdir %{_datadir}/misc + +%description +This package contains the python binding that require the magic "file" +interface. + +%prep +%{expand:%(sed -n -e '/^%%prep/,/^%%install/p' <%_sourcedir/file.spec | sed -e '1d' -e '$d')} + +%install +pushd python +%python setup.py install --root=%{buildroot} \ + --prefix=%{_prefix} \ + --record-rpm=../python_files +popd + +%files -f python_files +%defattr(-,root,root) +%doc python/README python/example.py + +%changelog