#
# Conditional build:
-%bcond_without python2 # don't build python-magic module for Python 2.x
-%bcond_without python3 # don't build python-magic module for Python 3.x
-%bcond_without static_libs # don't build static libraries
-%bcond_without tests # don't perform "make check"
+%bcond_without python2 # CPython 2.x python-magic module
+%bcond_without python3 # CPython 3.x python-magic module
+%bcond_without static_libs # static library
+%bcond_without tests # unit tests
Summary: A utility for determining file types
Summary(cs.UTF-8): Program pro zjišťování typu souborů
Summary(zh_TW.UTF-8): 用於決定檔案類型的一個工具程式。
Name: file
Version: 5.39
-Release: 3
+Release: 4
License: distributable
Group: Applications/File
Source0: ftp://ftp.astron.com/pub/file/%{name}-%{version}.tar.gz
Patch0: %{name}-selinux.patch
Patch1: searchpath.patch
Patch2: automake.patch
+Patch3: %{name}-gettext-no-random-translations.patch
Patch4: name-use-count.patch
Patch5: wasm.patch
URL: http://www.darwinsys.com/file/
BuildRequires: automake
BuildRequires: libseccomp-devel
BuildRequires: libtool >= 2:2.0
-BuildRequires: rpmbuild(macros) >= 1.710
+BuildRequires: rpmbuild(macros) >= 1.751
%if %{with python2}
BuildRequires: python-devel
BuildRequires: python-modules
%patch0 -p1
%patch1 -p1
%patch2 -p1
+%patch3 -p1
%patch4 -p1
%patch5 -p1
-%if "%(echo %{cc_version} | sed -e 's/^[0-9]\./0&/)" < "03.4"
+%if "%{_ver_lt '%{cc_version}' '3.4'}" == "1"
%{__sed} -i -e 's,-Wextra,,' configure.ac
%endif
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
-mv $RPM_BUILD_ROOT%{_libdir}/libmagic.so.* $RPM_BUILD_ROOT/%{_lib}
+%{__mv} $RPM_BUILD_ROOT%{_libdir}/libmagic.so.* $RPM_BUILD_ROOT/%{_lib}
ln -sf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/libmagic.so.*.*.*) \
$RPM_BUILD_ROOT%{_libdir}/libmagic.so
%{py_sitescriptdir}/file_magic-*-py*.egg-info
%endif
-%if %{with_python3}
+%if %{with python3}
%files -n python3-magic
%defattr(644,root,root,755)
%doc python/README.md python/example.py