]> git.pld-linux.org Git - packages/file.git/blobdiff - file.spec
up to 5.17
[packages/file.git] / file.spec
index 23f419fbc3ad5ea69b377037c64f785d4b0f2515..83abbd8a48b864daa06e24fc51a90d5cbc7baa12 100644 (file)
--- a/file.spec
+++ b/file.spec
@@ -2,7 +2,8 @@
 # Conditional build:
 %bcond_without python          # don't build python-magic module
 %bcond_without static_libs     # don't build static libraries
-#
+%bcond_without tests           # don't perform "make check"
+
 Summary:       A utility for determining file types
 Summary(cs.UTF-8):     Program pro zjišťování typu souborů
 Summary(da.UTF-8):     Et værktøj til bestemmelse af filtyper
@@ -27,31 +28,32 @@ Summary(uk.UTF-8):  Утиліта для визначення типів фай
 Summary(zh_CN.UTF-8):  判定文件类型的工具。
 Summary(zh_TW.UTF-8):  用於決定檔案類型的一個工具程式。
 Name:          file
-Version:       4.24
-Release:       2
+Version:       5.17
+Release:       1
 License:       distributable
 Group:         Applications/File
 Source0:       ftp://ftp.astron.com/pub/file/%{name}-%{version}.tar.gz
-# Source0-md5: 1efef03c9aac5515538f04cf3fc73eba
-Source1:       http://www.mif.pg.gda.pl/homepages/ankry/man-PLD/%{name}-non-english-man-pages.tar.bz2
-# Source1-md5: c157a183b64156f8baafaefd9cbf04c1
+# Source0-md5: e19c47e069ced7b01ccb4db402cc01d3
+Source1:       http://ftp1.pld-linux.org/people/glen/%{name}-non-english-man-pages.tar.bz2
+# Source1-md5: 6a45bcaefd19b94db36a1b2b7c5b806b
 Source2:       %{name}-zisofs.magic
 Source3:       %{name}-mscompress.magic
-Patch0:                %{name}-debian.patch
-Patch1:                %{name}-sparc.patch
-Patch2:                %{name}-lmagic.patch
-Patch3:                %{name}-greedy-dump.patch
-Patch4:                %{name}-selinux.patch
-Patch5:                %{name}-msdos.patch
-Patch6:                %{name}-fusecompress.patch
-BuildRequires: autoconf
+Source4:       %{name}-magic.mime-gen.awk
+Patch0:                %{name}-sparc.patch
+Patch1:                %{name}-selinux.patch
+Patch2:                searchpath.patch
+Patch3:                automake.patch
+URL:           http://www.darwinsys.com/file/
+BuildRequires: autoconf >= 2.50
 BuildRequires: automake
-BuildRequires: libtool
+BuildRequires: libtool >= 2:2.0
+BuildRequires: rpmbuild(macros) >= 1.453
 %if %{with python}
-BuildRequires: python-devel >= 1:2.5
-BuildRequires: python-modules >= 1:2.5
+BuildRequires: python-devel
+BuildRequires: python-modules
 BuildRequires: rpm-pythonprov
 %endif
+BuildRequires: zlib-devel
 Requires:      libmagic = %{version}-%{release}
 Conflicts:     rpm-build < 4.4.1-9
 Conflicts:     xdelta < 1.0.0
@@ -199,6 +201,7 @@ Summary:    Header files for libmagic library
 Summary(pl.UTF-8):     Pliki nagłówkowe biblioteki libmagic
 Group:         Development/Libraries
 Requires:      libmagic = %{version}-%{release}
+Requires:      zlib-devel
 
 %description -n libmagic-devel
 Library of functions which operate on magic database file.
@@ -247,9 +250,13 @@ Wiązania Pythona dla libmagic.
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
-%patch4 -p1
-%patch5 -p1
-%patch6 -p1
+
+%if "%{cc_version}" < "3.4"
+%{__sed} -i -e 's,-Wextra,,' configure.ac
+%endif
+
+cp -p %{SOURCE3} magic/Magdir/mscompress
+cp -p %{SOURCE2} magic/Magdir/zisofs
 
 rm -f magic/Magdir/{*.orig,*~}
 
@@ -260,17 +267,22 @@ rm -f magic/Magdir/{*.orig,*~}
 %{__autoconf}
 %{__automake}
 %configure \
+       --disable-silent-rules \
        --enable-fsect-man5 \
-       %{!?with_static_libs:--enable-static=no}
+       %{?with_static_libs:--enable-static}
 
 %{__make}
 
 %if %{with python}
 cd python
-python setup.py build
+%{__python} setup.py build
 cd ..
 %endif
 
+%if %{with tests}
+%{__make} check
+%endif
+
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT/%{_lib}
@@ -284,28 +296,19 @@ ln -sf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/libmagic.so.*.*.*) \
 
 %if %{with python}
 cd python
-python setup.py install \
+%{__python} setup.py install \
        --root=$RPM_BUILD_ROOT \
        --optimize=2
 cd ..
+%py_postclean
 %endif
 
-install -D magic/magic.local $RPM_BUILD_ROOT%{_sysconfdir}/magic
-
-cat magic/Magdir/* %{SOURCE2} %{SOURCE3} >$RPM_BUILD_ROOT%{_datadir}/file/magic
+awk -f %{SOURCE4} < $RPM_BUILD_ROOT%{_datadir}/misc/magic > $RPM_BUILD_ROOT%{_datadir}/misc/magic.mime
+ln -s misc $RPM_BUILD_ROOT%{_datadir}/file
 
 bzip2 -dc %{SOURCE1} | tar xf - -C $RPM_BUILD_ROOT%{_mandir}
-
-# somebody forgot about patching in tarball
-mv -f $RPM_BUILD_ROOT%{_mandir}/pt_BR/man{4,5}
-sed -e 's/MAGIC 4/MAGIC 5/' $RPM_BUILD_ROOT%{_mandir}/pt_BR/man5/magic.4 \
-       > $RPM_BUILD_ROOT%{_mandir}/pt_BR/man5/magic.5
-rm -f $RPM_BUILD_ROOT%{_mandir}/pt_BR/man5/magic.4
-
-src/file -m $RPM_BUILD_ROOT%{_datadir}/file/magic -c -C
-
-rm -f $RPM_BUILD_ROOT%{_mandir}/README.file-non-english-man-pages
-rm -f $RPM_BUILD_ROOT%{_mandir}/file-magic4.diff
+%{__rm} $RPM_BUILD_ROOT%{_mandir}/README.file-non-english-man-pages
+%{__rm} $RPM_BUILD_ROOT%{_mandir}/file-magic4.diff
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -313,11 +316,24 @@ rm -rf $RPM_BUILD_ROOT
 %post  -n libmagic -p /sbin/ldconfig
 %postun        -n libmagic -p /sbin/ldconfig
 
+%pretrans
+# it used to be directory
+if [ -d %{_datadir}/file -a ! -L %{_datadir}/file ]; then
+       mv -b %{_datadir}/file{,.dir}
+       ln -sn misc %{_datadir}/file
+%banner -e %{name} <<EOF
+Check %{_datadir}/file.dir for your own files and remove it when done.
+EOF
+fi
+
 %files
 %defattr(644,root,root,755)
 %doc ChangeLog COPYING README
 %attr(755,root,root) %{_bindir}/file
 %{_datadir}/file
+%{_datadir}/misc/magic
+%{_datadir}/misc/magic.mgc
+%{_datadir}/misc/magic.mime
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/magic
 %{_mandir}/man1/file.1*
 %{_mandir}/man5/magic.5*
@@ -352,6 +368,9 @@ rm -rf $RPM_BUILD_ROOT
 %if %{with python}
 %files -n python-magic
 %defattr(644,root,root,755)
-%attr(755,root,root) %{py_sitedir}/magic.so
-%{py_sitedir}/Magic_file_extensions-*.egg-info
+%doc python/README python/example.py
+%if "%{py_ver}" > "2.4"
+%{py_sitescriptdir}/Magic_file_extensions-*.egg-info
+%endif
+%{py_sitescriptdir}/magic.py[co]
 %endif
This page took 0.029509 seconds and 4 git commands to generate.