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
This commit is contained in:
Marcus Meissner 2017-10-07 10:37:20 +00:00 committed by Git OBS Bridge
parent 17761f57c8
commit 69d839ca78
6 changed files with 40 additions and 96 deletions

View File

@ -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 Wed Sep 13 10:35:43 UTC 2017 - werner@suse.de

View File

@ -19,8 +19,6 @@
%define somajor 1 %define somajor 1
%define libname libmagic%{somajor} %define libname libmagic%{somajor}
%define python python
Name: file Name: file
BuildRequires: findutils BuildRequires: findutils
BuildRequires: libtool BuildRequires: libtool
@ -145,11 +143,6 @@ autoreconf -fiv
CFLAGS="$RPM_OPT_FLAGS -DHOWMANY=69632 -fPIE" CFLAGS="$RPM_OPT_FLAGS -DHOWMANY=69632 -fPIE"
%configure --disable-silent-rules --datadir=%{_miscdir} --disable-static --with-pic --enable-fsect-man5 %configure --disable-silent-rules --datadir=%{_miscdir} --disable-static --with-pic --enable-fsect-man5
%{__make} %{?_smp_mflags} pkgdatadir='$(datadir)' LDFLAGS="-pie" %{__make} %{?_smp_mflags} pkgdatadir='$(datadir)' LDFLAGS="-pie"
%if 0%{?build_python_bindings:1}
pushd python
%python setup.py build
popd
%endif
%install %install
export LANG=POSIX export LANG=POSIX

View File

@ -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 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. - Split off from file.

View File

@ -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 Name: python-magic
%define build_python_bindings 1 BuildRequires: %{python_module setuptools}
BuildRequires: findutils BuildRequires: findutils
BuildRequires: libtool BuildRequires: libtool
BuildRequires: python-devel BuildRequires: python-rpm-macros
BuildRequires: python-setuptools
BuildRequires: zlib-devel BuildRequires: zlib-devel
Url: http://www.darwinsys.com/file/ Url: http://www.darwinsys.com/file/
Version: 5.32 Version: 5.32
@ -34,27 +34,35 @@ Summary: Python module to use libmagic
License: BSD-3-Clause and BSD-4-Clause License: BSD-3-Clause and BSD-4-Clause
Group: Development/Languages/Python Group: Development/Languages/Python
Source99: file.spec Source99: file.spec
%{expand:%(sed -n -e '/^Source:/,/^BuildRoot:/p' <%_sourcedir/file.spec)} %{expand:%(sed -n -e '/^Source:/,/^BuildRoot:/p' <%{_sourcedir}/file.spec)}
Requires: %libname Requires: libmagic1
%global _sysconfdir /etc Provides: python-file-magic = %{file_magic_version}
%global _miscdir %{_datadir}/misc %global _miscdir %{_datadir}/misc
%description %python_subpackages
%description
This package contains the python binding that require the magic "file" This package contains the python binding that require the magic "file"
interface. interface.
%prep %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 %install
pushd python pushd python
%python setup.py install --root=%{buildroot} \ %python_install
--prefix=%{_prefix} \
--record-rpm=../python_files
popd popd
%files -f python_files %files %{python_files}
%defattr(-,root,root) %defattr(-,root,root)
%doc python/README python/example.py %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 %changelog

View File

@ -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.

View File

@ -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