From b1bef68f62fb028803c79e2fcbf834f45bce278ee4d0e299622509a51a2171c1 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Sat, 7 Oct 2017 10:37:20 +0000 Subject: [PATCH] Accepting request 528985 from devel:languages:python:singlespec-staging - remove python build instructions from master spec file, move completely into python-magic.spec - converted to singlespec, dropped separate python3-magic spec file - moved python build instructions from file.spec to python-magic.spec - do not need to build the binary parts in order to build the python part - removed inlining of %defines from file.spec because it is unreliable in presence of parametrized macros - added provides: python-file-magic to comply with the python package naming policy OBS-URL: https://build.opensuse.org/request/show/528985 OBS-URL: https://build.opensuse.org/package/show/Base:System/file?expand=0&rev=164 --- file.changes | 6 +++++ file.spec | 7 ----- python-magic.changes | 12 +++++++++ python-magic.spec | 36 ++++++++++++++++---------- python3-magic.changes | 15 ----------- python3-magic.spec | 60 ------------------------------------------- 6 files changed, 40 insertions(+), 96 deletions(-) delete mode 100644 python3-magic.changes delete mode 100644 python3-magic.spec diff --git a/file.changes b/file.changes index 350804f..565c8b5 100644 --- a/file.changes +++ b/file.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Sep 26 15:20:23 UTC 2017 - jmatejek@suse.com + +- remove python build instructions from master spec file, move completely + into python-magic.spec + ------------------------------------------------------------------- Wed Sep 13 10:35:43 UTC 2017 - werner@suse.de diff --git a/file.spec b/file.spec index 3ea15e3..a837625 100644 --- a/file.spec +++ b/file.spec @@ -19,8 +19,6 @@ %define somajor 1 %define libname libmagic%{somajor} -%define python python - Name: file BuildRequires: findutils BuildRequires: libtool @@ -145,11 +143,6 @@ autoreconf -fiv CFLAGS="$RPM_OPT_FLAGS -DHOWMANY=69632 -fPIE" %configure --disable-silent-rules --datadir=%{_miscdir} --disable-static --with-pic --enable-fsect-man5 %{__make} %{?_smp_mflags} pkgdatadir='$(datadir)' LDFLAGS="-pie" -%if 0%{?build_python_bindings:1} -pushd python -%python setup.py build -popd -%endif %install export LANG=POSIX diff --git a/python-magic.changes b/python-magic.changes index d662b72..155efba 100644 --- a/python-magic.changes +++ b/python-magic.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Tue Sep 26 15:17:29 UTC 2017 - jmatejek@suse.com + +- converted to singlespec, dropped separate python3-magic spec file +- moved python build instructions from file.spec to python-magic.spec +- do not need to build the binary parts in order to build the python part +- removed inlining of %defines from file.spec because it is unreliable + in presence of parametrized macros +- added provides: python-file-magic to comply with the python package + naming policy + ------------------------------------------------------------------- Wed Apr 20 08:49:18 UTC 2016 - werner@suse.de @@ -119,3 +130,4 @@ Mon Jan 28 18:10:23 CET 2008 - rguenther@suse.de - Split off from file. + diff --git a/python-magic.spec b/python-magic.spec index f6b008c..7797bb7 100644 --- a/python-magic.spec +++ b/python-magic.spec @@ -16,16 +16,16 @@ # -%{expand:%(sed -n -e '/^%%define somajor/,/^%%define libname/p' <%_sourcedir/file.spec)} +# PyPI package name is file-magic. Version is taken from setup.py +%define file_magic_version 0.3.0 -%define python python +%{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-magic -%define build_python_bindings 1 +BuildRequires: %{python_module setuptools} BuildRequires: findutils BuildRequires: libtool -BuildRequires: python-devel -BuildRequires: python-setuptools +BuildRequires: python-rpm-macros BuildRequires: zlib-devel Url: http://www.darwinsys.com/file/ Version: 5.32 @@ -34,27 +34,35 @@ 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 +%{expand:%(sed -n -e '/^Source:/,/^BuildRoot:/p' <%{_sourcedir}/file.spec)} +Requires: libmagic1 +Provides: python-file-magic = %{file_magic_version} %global _miscdir %{_datadir}/misc -%description +%python_subpackages + +%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')} +%{expand:%(sed -n -e '/^%%prep/,/^%%build/p' <%{_sourcedir}/file.spec | sed -e '1d' -e '$d')} + +%build +pushd python +%python_build +popd %install pushd python -%python setup.py install --root=%{buildroot} \ - --prefix=%{_prefix} \ - --record-rpm=../python_files +%python_install popd -%files -f python_files +%files %{python_files} %defattr(-,root,root) %doc python/README python/example.py +%{python_sitelib}/magic.py* +%pycache_only %{python_sitelib}/__pycache__ +%{python_sitelib}/file_magic-*-py%{python_version}.egg-info %changelog diff --git a/python3-magic.changes b/python3-magic.changes deleted file mode 100644 index 1374a18..0000000 --- a/python3-magic.changes +++ /dev/null @@ -1,15 +0,0 @@ -------------------------------------------------------------------- -Wed Apr 20 08:49:18 UTC 2016 - werner@suse.de - -- Add Build Require python3-setuptools - -------------------------------------------------------------------- -Mon Apr 18 12:21:42 UTC 2016 - werner@suse.de - -- Now it's file 5.26 - -------------------------------------------------------------------- -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 deleted file mode 100644 index 78d705d..0000000 --- a/python3-magic.spec +++ /dev/null @@ -1,60 +0,0 @@ -# -# spec file for package python3-magic -# -# Copyright (c) 2017 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: python3-setuptools -BuildRequires: zlib-devel -Url: http://www.darwinsys.com/file/ -Version: 5.32 -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