don't build python-magic in favour of python-magic stand-alone distribution [release 5.25-2mamba;Sun Dec 13 2015]

This commit is contained in:
Silvan Calarco 2024-01-05 22:17:22 +01:00
parent 067d6678bf
commit b9021d9d2c

View File

@ -1,7 +1,7 @@
%define pymagic_version 0.1 %define pymagic_version 0.1
Name: file Name: file
Version: 5.25 Version: 5.25
Release: 1mamba Release: 2mamba
Summary: An utility for determining file types Summary: An utility for determining file types
Group: Applications/File Group: Applications/File
Vendor: openmamba Vendor: openmamba
@ -21,9 +21,6 @@ Patch7: file-5.04-zmachine-magic-update.patch
License: BSD License: BSD
## AUTOBUILDREQ-BEGIN ## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel BuildRequires: glibc-devel
%if "%{stage1}" != "1"
BuildRequires: libpython-devel
%endif
BuildRequires: libz-devel BuildRequires: libz-devel
## AUTOBUILDREQ-END ## AUTOBUILDREQ-END
Requires: libmagic = %{?epoch:%epoch:}%{version}-%{release} Requires: libmagic = %{?epoch:%epoch:}%{version}-%{release}
@ -88,10 +85,10 @@ This package contains the Python bindings to allow access to the libmagic API.
#%patch6 -p1 #%patch6 -p1
#%patch7 -p1 #%patch7 -p1
for p in $(find . -name "*.py"); do #for p in $(find . -name "*.py"); do
sed -i 's|#!/usr/local/bin/python2.1|#!%{__python}|' $p # sed -i 's|#!/usr/local/bin/python2.1|#!%{__python}|' $p
sed -i 's|#!/usr/local/bin/python|#!%{__python}|' $p # sed -i 's|#!/usr/local/bin/python|#!%{__python}|' $p
done #done
iconv -f iso-8859-1 -t utf-8 < doc/libmagic.man > doc/libmagic.man_ iconv -f iso-8859-1 -t utf-8 < doc/libmagic.man > doc/libmagic.man_
touch -r doc/libmagic.man doc/libmagic.man_ touch -r doc/libmagic.man doc/libmagic.man_
@ -101,8 +98,8 @@ mv doc/libmagic.man_ doc/libmagic.man
%configure --enable-fsect-man5 %configure --enable-fsect-man5
%make %make
cd python #cd python
CFLAGS="%{optflags}" %{__python} setup.py build #CFLAGS="%{optflags}" %{__python} setup.py build
%install %install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" [ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
@ -116,10 +113,10 @@ ln -s misc/magic %{buildroot}%{_datadir}/magic
#ln -s file/magic.mime %{buildroot}%{_datadir}/magic.mime #ln -s file/magic.mime %{buildroot}%{_datadir}/magic.mime
ln -s ../magic %{buildroot}%{_datadir}/file/magic ln -s ../magic %{buildroot}%{_datadir}/file/magic
%if "%{stage1}" != "1" #%if "%{stage1}" != "1"
cd python #cd python
%{__python} setup.py install -O1 --skip-build --root %{buildroot} #%{__python} setup.py install -O1 --skip-build --root %{buildroot}
%endif #%endif
%clean %clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" [ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
@ -151,15 +148,18 @@ cd python
%{_libdir}/libmagic.so %{_libdir}/libmagic.so
%{_mandir}/man3/* %{_mandir}/man3/*
%if "%{stage1}" != "1" #%if "%{stage1}" != "1"
%files -n python-magic #%files -n python-magic
%defattr(-,root,root) #%defattr(-,root,root)
%{python_sitelib}/Magic_file_extensions-*-py%{python_version}.egg-info #%{python_sitelib}/Magic_file_extensions-*-py%{python_version}.egg-info
%{python_sitelib}/magic.py* #%{python_sitelib}/magic.py*
%doc python/README COPYING python/example.py #%doc python/README COPYING python/example.py
%endif #%endif
%changelog %changelog
* Sun Dec 13 2015 Silvan Calarco <silvan.calarco@mambasoft.it> 5.25-2mamba
- don't build python-magic in favour of python-magic stand-alone distribution
* Thu Sep 17 2015 Automatic Build System <autodist@mambasoft.it> 5.25-1mamba * Thu Sep 17 2015 Automatic Build System <autodist@mambasoft.it> 5.25-1mamba
- automatic version update by autodist - automatic version update by autodist