]> git.pld-linux.org Git - packages/file.git/blobdiff - file.spec
fix build without python3
[packages/file.git] / file.spec
index 705ff719f931174f1121dec808075d3e7c1c1ce9..be597d9d2c2490a8d5a9d8538d68c2d1e3126175 100644 (file)
--- a/file.spec
+++ b/file.spec
@@ -1,9 +1,9 @@
 #
 # 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ů
@@ -29,12 +29,12 @@ Summary(uk.UTF-8):  Утиліта для визначення типів фай
 Summary(zh_CN.UTF-8):  判定文件类型的工具。
 Summary(zh_TW.UTF-8):  用於決定檔案類型的一個工具程式。
 Name:          file
-Version:       5.20
-Release:       2
+Version:       5.39
+Release:       4
 License:       distributable
 Group:         Applications/File
 Source0:       ftp://ftp.astron.com/pub/file/%{name}-%{version}.tar.gz
-# Source0-md5: 5d5e13eb3e0e13839da869a31790faf2
+# Source0-md5: 1c450306053622803a25647d88f80f25
 Source1:       http://ftp1.pld-linux.org/people/glen/%{name}-non-english-man-pages.tar.bz2
 # Source1-md5: 6a45bcaefd19b94db36a1b2b7c5b806b
 Source2:       %{name}-zisofs.magic
@@ -43,20 +43,25 @@ Source4:    %{name}-magic.mime-gen.awk
 Patch0:                %{name}-selinux.patch
 Patch1:                searchpath.patch
 Patch2:                automake.patch
-Patch3:                %{name}-perl.patch
+Patch3:                %{name}-gettext-no-random-translations.patch
+Patch4:                name-use-count.patch
+Patch5:                wasm.patch
 URL:           http://www.darwinsys.com/file/
 BuildRequires: autoconf >= 2.50
 BuildRequires: automake
+BuildRequires: libseccomp-devel
 BuildRequires: libtool >= 2:2.0
-BuildRequires: rpmbuild(macros) >= 1.453
+BuildRequires: rpmbuild(macros) >= 1.751
 %if %{with python2}
 BuildRequires: python-devel
 BuildRequires: python-modules
+BuildRequires: python-setuptools
 BuildRequires: rpm-pythonprov
 %endif
 %if %{with python3}
 BuildRequires: python3-devel
 BuildRequires: python3-modules
+BuildRequires: python3-setuptools
 BuildRequires: rpm-pythonprov
 %endif
 BuildRequires: zlib-devel
@@ -270,8 +275,10 @@ Wiązania Pythona 3 do biblioteki libmagic.
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
+%patch4 -p1
+%patch5 -p1
 
-%if "%{cc_version}" < "3.4"
+%if "%{_ver_lt '%{cc_version}' '3.4'}" == "1"
 %{__sed} -i -e 's,-Wextra,,' configure.ac
 %endif
 
@@ -286,11 +293,14 @@ cp -a python py3
 
 %build
 %{__libtoolize}
-%{__aclocal}
-%{__autoheader}
+%{__aclocal} -I m4
 %{__autoconf}
+%{__autoheader}
 %{__automake}
 %configure \
+%ifnarch %{x8664}
+       --disable-libseccomp \
+%endif
        --disable-silent-rules \
        --enable-fsect-man5 \
        %{?with_static_libs:--enable-static}
@@ -299,12 +309,12 @@ cp -a python py3
 
 %if %{with python2}
 cd python
-%{__python} setup.py build
+%py_build
 cd ..
 %endif
 %if %{with python3}
 cd py3
-%{__python3} setup.py build
+%py3_build
 cd ..
 %endif
 
@@ -319,25 +329,20 @@ install -d $RPM_BUILD_ROOT/%{_lib}
 %{__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
 
 %if %{with python2}
 cd python
-%{__python} setup.py install \
-       --optimize=2 \
-       --root=$RPM_BUILD_ROOT
+%py_install
 cd ..
 %py_postclean
 %endif
 
 %if %{with python3}
 cd py3
-%{__python3} setup.py install \
-       --optimize=2 \
-       --skip-build \
-       --root=$RPM_BUILD_ROOT
+%py3_install
 cd ..
 %endif
 
@@ -395,6 +400,7 @@ fi
 %attr(755,root,root) %{_libdir}/libmagic.so
 %{_libdir}/libmagic.la
 %{_includedir}/magic.h
+%{_pkgconfigdir}/libmagic.pc
 %{_mandir}/man3/libmagic.3*
 
 %if %{with static_libs}
@@ -406,18 +412,16 @@ fi
 %if %{with python3}
 %files -n python-magic
 %defattr(644,root,root,755)
-%doc python/README python/example.py
-%if "%{py_ver}" > "2.4"
-%{py_sitescriptdir}/Magic_file_extensions-*.egg-info
-%endif
+%doc python/README.md python/example.py
 %{py_sitescriptdir}/magic.py[co]
+%{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 python/example.py
+%doc python/README.md python/example.py
 %{py3_sitescriptdir}/magic.py
 %{py3_sitescriptdir}/__pycache__/magic.*.py[co]
-%{py3_sitescriptdir}/Magic_file_extensions-*.egg-info
+%{py3_sitescriptdir}/file_magic-*-py*.egg-info
 %endif
This page took 0.031154 seconds and 4 git commands to generate.