X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=file.spec;h=0e2a9e5cb0afe725d9f86022a1883b48c3aa4518;hb=4c410d2ce8ac4ffb7b15cc73c66cffdeee86e0de;hp=8aa2b4e6edc5f6329fe7a8307cdf723b311ba4d7;hpb=a32a29be0c1c98106f22ae54cedda4e2c3b7170f;p=packages%2Ffile.git diff --git a/file.spec b/file.spec index 8aa2b4e..0e2a9e5 100644 --- a/file.spec +++ b/file.spec @@ -1,9 +1,10 @@ # # Conditional build: -%bcond_without python # don't build python-magic module +%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" -# + 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 @@ -28,35 +29,41 @@ Summary(uk.UTF-8): Утиліта для визначення типів фай Summary(zh_CN.UTF-8): 判定文件类型的工具。 Summary(zh_TW.UTF-8): 用於決定檔案類型的一個工具程式。 Name: file -Version: 5.04 -Release: 0.2 +Version: 5.36 +Release: 1 License: distributable Group: Applications/File Source0: ftp://ftp.astron.com/pub/file/%{name}-%{version}.tar.gz -# Source0-md5: accade81ff1cc774904b47c72c8aeea0 -Source1: http://www.mif.pg.gda.pl/homepages/ankry/man-PLD/%{name}-non-english-man-pages.tar.bz2 -# Source1-md5: c157a183b64156f8baafaefd9cbf04c1 +# Source0-md5: 5f10fb45bdaffd729a572e563783b78e +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 Source4: %{name}-magic.mime-gen.awk -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 -Patch7: %{name}-python.patch -Patch8: %{name}-dbase.patch +Patch0: %{name}-selinux.patch +Patch1: searchpath.patch +Patch2: automake.patch +Patch4: name-use-count.patch URL: http://www.darwinsys.com/file/ -BuildRequires: autoconf +BuildRequires: autoconf >= 2.50 BuildRequires: automake -BuildRequires: libtool -%if %{with python} -BuildRequires: python-devel >= 1:2.5 -BuildRequires: python-modules >= 1:2.5 +BuildRequires: libseccomp-devel +BuildRequires: libtool >= 2:2.0 +BuildRequires: rpmbuild(macros) >= 1.710 +%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 +Requires(pretrans): coreutils Requires: libmagic = %{version}-%{release} Conflicts: rpm-build < 4.4.1-9 Conflicts: xdelta < 1.0.0 @@ -204,6 +211,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. @@ -234,32 +242,51 @@ Biblioteka funkcji operujących na pliku bazy danych magic. Ten pakiet zawiera statyczną wersję biblioteki. %package -n python-magic -Summary: Python bindings for libmagic -Summary(pl.UTF-8): Wiązania Pythona dla libmagic +Summary: Python 2 bindings for libmagic +Summary(pl.UTF-8): Wiązania Pythona 2 do biblioteki libmagic Group: Libraries/Python Requires: libmagic = %{version}-%{release} -%pyrequires_eq python-libs +Requires: python-libs %description -n python-magic -Python bindings for libmagic. +Python 2 bindings for libmagic. %description -n python-magic -l pl.UTF-8 -Wiązania Pythona dla libmagic. +Wiązania Pythona 2 do biblioteki libmagic. + +%package -n python3-magic +Summary: Python 3 bindings for libmagic +Summary(pl.UTF-8): Wiązania Pythona 3 do biblioteki libmagic +Group: Libraries/Python +Requires: libmagic = %{version}-%{release} +Requires: python-libs + +%description -n python3-magic +Python 3 bindings for libmagic. + +%description -n python3-magic -l pl.UTF-8 +Wiązania Pythona 3 do biblioteki libmagic. %prep %setup -q %patch0 -p1 %patch1 -p1 %patch2 -p1 -%patch3 -p1 %patch4 -p1 -%patch5 -p1 -%patch6 -p1 -%patch7 -p1 -%patch8 -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,*~} +%if %{with python3} +cp -a python py3 +%endif + %build %{__libtoolize} %{__aclocal} @@ -267,14 +294,23 @@ rm -f magic/Magdir/{*.orig,*~} %{__autoconf} %{__automake} %configure \ +%ifnarch %{x8664} + --disable-libseccomp \ +%endif + --disable-silent-rules \ --enable-fsect-man5 \ - %{!?with_static_libs:--enable-static=no} + %{?with_static_libs:--enable-static} %{__make} -%if %{with python} +%if %{with python2} cd python -python setup.py build +%py_build +cd .. +%endif +%if %{with python3} +cd py3 +%py3_build cd .. %endif @@ -293,33 +329,25 @@ 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 python} +%if %{with python2} cd python -python setup.py install \ - --root=$RPM_BUILD_ROOT \ - --optimize=2 +%py_install cd .. +%py_postclean %endif -install -D magic/Localstuff $RPM_BUILD_ROOT%{_sysconfdir}/magic - -cat magic/Header magic/Magdir/* %{SOURCE2} %{SOURCE3} >$RPM_BUILD_ROOT%{_datadir}/misc/magic -awk -f %{SOURCE4} <$RPM_BUILD_ROOT%{_datadir}/misc/magic >$RPM_BUILD_ROOT%{_datadir}/misc/magic.mime - -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}/misc/magic -c -C +%if %{with python3} +cd py3 +%py3_install +cd .. +%endif +awk -f %{SOURCE4} < $RPM_BUILD_ROOT%{_datadir}/misc/magic > $RPM_BUILD_ROOT%{_datadir}/misc/magic.mime ln -s misc $RPM_BUILD_ROOT%{_datadir}/file -rm -f $RPM_BUILD_ROOT%{_mandir}/README.file-non-english-man-pages -rm -f $RPM_BUILD_ROOT%{_mandir}/file-magic4.diff +bzip2 -dc %{SOURCE1} | tar xf - -C $RPM_BUILD_ROOT%{_mandir} +%{__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 @@ -329,9 +357,9 @@ rm -rf $RPM_BUILD_ROOT %pretrans # it used to be directory -if [ -d %{_datadir}/file ]; then +if [ -d %{_datadir}/file -a ! -L %{_datadir}/file ]; then mv -b %{_datadir}/file{,.dir} - ln -s misc %{_datadir}/file + ln -sn misc %{_datadir}/file %banner -e %{name} <