]> git.pld-linux.org Git - packages/python-magic_ahupp.git/blame - python-magic_ahupp.spec
rebuild with python 3.10
[packages/python-magic_ahupp.git] / python-magic_ahupp.spec
CommitLineData
594e088e
JB
1# NOTE: original package name is python-magic, but it would conflict with
2# python*-magic packages built from file.spec.
3# Also, we rename magic.py to magic_ahupp.py to avoid import name conflict.
4#
5# Conditional build:
6%bcond_with tests # unit tests (broken, magic._pyc_ file is missing in sources)
7%bcond_without python2 # CPython 2.x module
8%bcond_without python3 # CPython 3.x module
9
10Summary: File type identification using libmagic
11Summary(pl.UTF-8): Identyfikacja typu pliku przy użyciu libmagic
12Name: python-magic_ahupp
13Version: 0.4.15
eaa2312e 14Release: 4
594e088e
JB
15License: MIT
16Group: Libraries/Python
17#Source0Download: https://pypi.org/simple/python-magic/
18Source0: https://files.pythonhosted.org/packages/source/p/python-magic/python-magic-%{version}.tar.gz
19# Source0-md5: e384c95a47218f66c6501cd6dd45ff59
20URL: http://github.com/ahupp/python-magic
21%if %{with tests}
22BuildRequires: libmagic
23%endif
24%if %{with python2}
25BuildRequires: python-modules >= 1:2.7
26BuildRequires: python-setuptools
27%endif
28%if %{with python3}
29BuildRequires: python3-modules >= 1:3.6
30BuildRequires: python3-setuptools
31%endif
32BuildRequires: rpm-pythonprov
33BuildRequires: rpmbuild(macros) >= 1.714
34Requires: libmagic
35Requires: python-modules >= 1:2.7
36BuildArch: noarch
37BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38
39%description
40This module uses ctypes to access the libmagic file type
41identification library. It makes use of the local magic database and
42supports both textual and MIME-type output.
43
44%description -l pl.UTF-8
45Ten moduł wykorzystuje ctypes do dostępu do biblioteki identyfikacji
46typów plików libmagic. Wykorzystuje lokalną bazę danych wartości
47magicznych i obsługuje wyjście zarówno w postaci tekstu, jak i typów
48MIME.
49
50%package -n python3-magic_ahupp
51Summary: File type identification using libmagic
52Summary(pl.UTF-8): Identyfikacja typu pliku przy użyciu libmagic
53Group: Libraries/Python
54Requires: libmagic
55Requires: python3-modules >= 1:3.6
56
57%description -n python3-magic_ahupp
58This module uses ctypes to access the libmagic file type
59identification library. It makes use of the local magic database and
60supports both textual and MIME-type output.
61
62%description -n python3-magic_ahupp -l pl.UTF-8
63Ten moduł wykorzystuje ctypes do dostępu do biblioteki identyfikacji
64typów plików libmagic. Wykorzystuje lokalną bazę danych wartości
65magicznych i obsługuje wyjście zarówno w postaci tekstu, jak i typów
66MIME.
67
68%prep
69%setup -q -n python-magic-%{version}
70
71%build
72%if %{with python2}
73%py_build
74
75%if %{with tests}
76LC_ALL=C.UTF-8 %{__python} -m unittest discover -s test
77%endif
78%endif
79
80%if %{with python3}
81%py3_build
82
83%if %{with tests}
84LC_ALL=C.UTF-8 %{__python3} -m unittest discover -s test
85%endif
86%endif
87
88%install
89rm -rf $RPM_BUILD_ROOT
90
91%if %{with python2}
92%py_install
93
94%{__rm} $RPM_BUILD_ROOT%{py_sitescriptdir}/magic.py[co]
95%{__mv} $RPM_BUILD_ROOT%{py_sitescriptdir}/{magic,magic_ahupp}.py
96%py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
97%py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
98%py_postclean
99%endif
100
101%if %{with python3}
102%py3_install
103
104%{__rm} $RPM_BUILD_ROOT%{py3_sitescriptdir}/__pycache__/*.py[co]
105%{__mv} $RPM_BUILD_ROOT%{py3_sitescriptdir}/{magic,magic_ahupp}.py
106%py3_comp $RPM_BUILD_ROOT%{py3_sitescriptdir}
107%py3_ocomp $RPM_BUILD_ROOT%{py3_sitescriptdir}
108%endif
109
110%clean
111rm -rf $RPM_BUILD_ROOT
112
113%if %{with python2}
114%files
115%defattr(644,root,root,755)
116%doc LICENSE
117%{py_sitescriptdir}/magic_ahupp.py[co]
118%{py_sitescriptdir}/python_magic-%{version}-py*.egg-info
119%endif
120
121%if %{with python3}
122%files -n python3-magic_ahupp
123%defattr(644,root,root,755)
124%doc LICENSE
125%{py3_sitescriptdir}/magic_ahupp.py
126%{py3_sitescriptdir}/__pycache__/magic_ahupp.cpython-*.py[co]
127%{py3_sitescriptdir}/python_magic-%{version}-py*.egg-info
128%endif
This page took 0.084752 seconds and 4 git commands to generate.