2006-12-19 00:15:53 +01:00
|
|
|
#
|
2011-06-30 13:08:33 +02:00
|
|
|
# spec file for package file
|
2006-12-19 00:15:53 +01:00
|
|
|
#
|
2016-01-21 12:51:33 +01:00
|
|
|
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
|
2006-12-19 00:15:53 +01:00
|
|
|
#
|
2008-08-21 18:07:05 +02:00
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2006-12-19 00:15:53 +01:00
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
2011-10-02 16:37:56 +02:00
|
|
|
|
2013-02-19 10:07:29 +01:00
|
|
|
%define somajor 1
|
|
|
|
%define libname libmagic%{somajor}
|
|
|
|
|
2016-02-18 12:51:37 +01:00
|
|
|
%define python python
|
|
|
|
|
2006-12-19 00:15:53 +01:00
|
|
|
Name: file
|
2012-03-23 15:41:17 +01:00
|
|
|
BuildRequires: findutils
|
2011-10-02 16:37:56 +02:00
|
|
|
BuildRequires: libtool
|
2012-03-23 15:41:17 +01:00
|
|
|
BuildRequires: zlib-devel
|
2007-12-06 00:11:22 +01:00
|
|
|
Url: http://www.darwinsys.com/file/
|
2008-11-02 15:40:05 +01:00
|
|
|
# bug437293
|
|
|
|
%ifarch ppc64
|
|
|
|
Obsoletes: file-64bit
|
|
|
|
%endif
|
|
|
|
#
|
2008-04-20 20:36:09 +02:00
|
|
|
# Set Version also in python-magic.spec
|
2016-04-18 15:32:24 +02:00
|
|
|
Version: 5.26
|
2012-03-23 15:41:17 +01:00
|
|
|
Release: 0
|
2006-12-19 00:15:53 +01:00
|
|
|
Summary: A Tool to Determine File Types
|
2012-03-23 15:41:17 +01:00
|
|
|
License: BSD-2-Clause
|
|
|
|
Group: Productivity/File utilities
|
2011-08-23 16:56:34 +02:00
|
|
|
Source: ftp://ftp.astron.com/pub/file/file-%{version}.tar.gz
|
2009-12-16 08:52:53 +01:00
|
|
|
Source2: baselibs.conf
|
2014-08-18 19:05:56 +02:00
|
|
|
Source3: file-rpmlintrc
|
2016-04-18 15:32:24 +02:00
|
|
|
Patch: file-5.26.dif
|
2014-06-25 11:07:53 +02:00
|
|
|
Patch1: file-5.19-misc.dif
|
2008-04-14 19:32:36 +02:00
|
|
|
Patch4: file-4.24-autoconf.dif
|
2013-03-22 11:16:05 +01:00
|
|
|
Patch5: file-5.14-tex.dif
|
2007-03-22 12:06:16 +01:00
|
|
|
Patch7: file-4.20-ssd.dif
|
|
|
|
Patch8: file-4.20-xen.dif
|
2015-01-20 09:00:50 +01:00
|
|
|
Patch9: file-5.22-elf.dif
|
2014-06-25 11:07:53 +02:00
|
|
|
Patch10: file-5.19-printf.dif
|
2013-01-22 17:19:33 +01:00
|
|
|
Patch11: file-5.12-zip.dif
|
2014-02-18 11:22:22 +01:00
|
|
|
Patch12: file-5.17-option.dif
|
2007-08-29 22:26:43 +02:00
|
|
|
Patch13: file-4.21-scribus.dif
|
2007-12-06 00:11:22 +01:00
|
|
|
Patch15: file-4.21-xcursor.dif
|
2014-06-25 11:07:53 +02:00
|
|
|
Patch22: file-5.19-cromfs.dif
|
2014-03-28 11:32:53 +01:00
|
|
|
Patch25: file-5.18-javacheck.dif
|
2014-06-25 11:07:53 +02:00
|
|
|
Patch26: file-5.19-solv.dif
|
|
|
|
Patch27: file-5.19-zip2.0.dif
|
|
|
|
Patch31: file-5.19-biorad.dif
|
|
|
|
Patch32: file-5.19-clicfs.dif
|
2013-12-02 12:33:34 +01:00
|
|
|
Patch33: file-5.16-ocloexec.patch
|
2015-06-11 17:29:52 +02:00
|
|
|
Patch34: file-5.23-endian.patch
|
2015-07-14 13:52:47 +02:00
|
|
|
Patch35: file-5.24-nitpick.dif
|
2013-10-01 12:43:52 +02:00
|
|
|
Patch36: file-5.15-clear-invalid.patch
|
2014-05-12 10:47:59 +02:00
|
|
|
Patch37: file-secure_getenv.patch
|
2016-04-18 15:32:24 +02:00
|
|
|
Patch38: file-5.26-version.patch
|
2006-12-19 00:15:53 +01:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2007-12-06 00:11:22 +01:00
|
|
|
%global _sysconfdir /etc
|
|
|
|
%global _miscdir %{_datadir}/misc
|
2006-12-19 00:15:53 +01:00
|
|
|
|
|
|
|
%description
|
|
|
|
With the file command, you can obtain information on the file type of a
|
|
|
|
specified file. File type recognition is controlled by the file
|
|
|
|
/etc/magic, which contains the classification criteria. This command is
|
|
|
|
used by apsfilter to permit automatic printing of different file types.
|
|
|
|
|
2013-01-23 09:41:15 +01:00
|
|
|
%package -n file-magic
|
2012-10-30 14:31:55 +01:00
|
|
|
Summary: The magic files for libmagic to use
|
2013-11-05 12:21:24 +01:00
|
|
|
Group: Productivity/File utilities
|
2013-02-19 10:07:29 +01:00
|
|
|
Obsoletes: libmagic-data
|
2012-10-30 14:31:55 +01:00
|
|
|
|
2013-01-23 09:41:15 +01:00
|
|
|
%description -n file-magic
|
2012-10-30 14:31:55 +01:00
|
|
|
This package contains the basic magic files that libmagic reads and uses
|
|
|
|
to estimate a file's type.
|
|
|
|
|
2013-02-19 10:07:29 +01:00
|
|
|
%package -n %libname
|
2012-10-30 14:31:55 +01:00
|
|
|
Summary: Library with file's functionality
|
2013-11-05 12:21:24 +01:00
|
|
|
Group: System/Libraries
|
2013-01-23 09:41:15 +01:00
|
|
|
Requires: file-magic = %{version}
|
2012-10-30 14:31:55 +01:00
|
|
|
|
2013-02-19 10:07:29 +01:00
|
|
|
%description -n %libname
|
2012-10-30 14:31:55 +01:00
|
|
|
This library reads magic files and detects file types. Used by file command
|
|
|
|
|
2006-12-19 00:15:53 +01:00
|
|
|
%package -n file-devel
|
|
|
|
Summary: Include Files and Libraries mandatory for Development
|
2013-11-05 12:21:24 +01:00
|
|
|
Group: Development/Libraries/C and C++
|
2006-12-19 00:15:53 +01:00
|
|
|
Provides: file:/usr/include/magic.h
|
2013-02-19 10:07:29 +01:00
|
|
|
Requires: %libname = %{version}
|
2012-03-23 15:41:17 +01:00
|
|
|
Requires: glibc-devel
|
2011-10-02 16:37:56 +02:00
|
|
|
|
2006-12-19 00:15:53 +01:00
|
|
|
%description -n file-devel
|
|
|
|
This package contains all necessary include files and libraries needed
|
|
|
|
to develop applications that require the magic "file" interface.
|
|
|
|
|
|
|
|
%prep
|
2008-01-29 01:36:02 +01:00
|
|
|
%setup -q -n file-%{version}
|
2006-12-19 00:15:53 +01:00
|
|
|
%patch1 -p0 -b .misc
|
|
|
|
%patch4 -p0 -b .conf
|
|
|
|
%patch5 -p0 -b .tex
|
2007-03-22 12:06:16 +01:00
|
|
|
%patch7 -p0 -b .ssd
|
|
|
|
%patch8 -p0 -b .xen
|
|
|
|
%patch9 -p0 -b .elf
|
|
|
|
%patch10 -p0 -b .prtf
|
2011-07-18 12:03:46 +02:00
|
|
|
%patch11 -p0 -b .zip
|
2007-08-29 22:26:43 +02:00
|
|
|
%patch12 -p0 -b .opt
|
|
|
|
%patch13 -p0 -b .scri
|
2007-12-06 00:11:22 +01:00
|
|
|
%patch15 -p0 -b .xcur
|
2008-04-14 19:32:36 +02:00
|
|
|
%patch22 -p0 -b .cromfs
|
2008-08-21 18:07:05 +02:00
|
|
|
%patch25 -p0 -b .javacheck
|
2008-11-28 14:59:05 +01:00
|
|
|
%patch26 -p0 -b .solv
|
2009-05-15 22:42:44 +02:00
|
|
|
%patch27 -p0 -b .zip2.0
|
2010-11-24 13:22:14 +01:00
|
|
|
%patch31 -p0 -b .biorad
|
2011-06-14 19:53:47 +02:00
|
|
|
%patch32 -p0 -b .clicfs
|
2012-01-16 15:23:30 +01:00
|
|
|
%patch33 -p0 -b .clexe
|
2012-09-18 13:01:25 +02:00
|
|
|
%patch34 -p0 -b .endian
|
|
|
|
%patch35 -p0 -b .nitpick
|
2013-10-01 12:43:52 +02:00
|
|
|
%patch36 -p1 -b .clear
|
2014-05-12 10:47:59 +02:00
|
|
|
%patch37 -p1 -b .getenv
|
2016-04-18 15:32:24 +02:00
|
|
|
%patch38 -p1 -b .php
|
2011-08-23 16:56:34 +02:00
|
|
|
%patch -b .0
|
2013-02-22 11:23:45 +01:00
|
|
|
test -s src/magic.h.in || cp -p src/magic.h src/magic.h.in
|
2016-04-18 15:32:24 +02:00
|
|
|
rm -fv src/magic.h
|
2013-02-22 11:23:45 +01:00
|
|
|
|
2006-12-19 00:15:53 +01:00
|
|
|
%build
|
|
|
|
export LANG=POSIX
|
|
|
|
export LC_ALL=POSIX
|
|
|
|
rm -f Magdir/*,v Magdir/*~
|
|
|
|
rm -f ltcf-c.sh ltconfig ltmain.sh
|
2009-01-29 23:06:12 +01:00
|
|
|
autoreconf -fiv
|
2014-12-22 08:33:19 +01:00
|
|
|
CFLAGS="$RPM_OPT_FLAGS -DHOWMANY=69632 -fPIE"
|
2011-11-05 21:03:46 +01:00
|
|
|
%configure --disable-silent-rules --datadir=%{_miscdir} --disable-static --with-pic --enable-fsect-man5
|
2014-12-22 08:33:19 +01:00
|
|
|
%{__make} %{?_smp_mflags} pkgdatadir='$(datadir)' LDFLAGS="-pie"
|
2008-01-29 01:36:02 +01:00
|
|
|
%if 0%{?build_python_bindings:1}
|
2007-12-06 00:11:22 +01:00
|
|
|
pushd python
|
2016-02-18 12:51:37 +01:00
|
|
|
%python setup.py build
|
2007-12-06 00:11:22 +01:00
|
|
|
popd
|
|
|
|
%endif
|
2006-12-19 00:15:53 +01:00
|
|
|
|
|
|
|
%install
|
|
|
|
export LANG=POSIX
|
|
|
|
export LC_ALL=POSIX
|
2007-12-06 00:11:22 +01:00
|
|
|
mkdir %{buildroot}/etc
|
|
|
|
make DESTDIR=%{buildroot} install pkgdatadir='$(datadir)'
|
|
|
|
rm -vf %{buildroot}%{_sysconfdir}/magic
|
|
|
|
echo '# Localstuff: file(1) magic(5) for locally observed files' > %{buildroot}%{_sysconfdir}/magic
|
|
|
|
echo '# global magic file is %{_miscdir}/magic(.mgc)' >> %{buildroot}%{_sysconfdir}/magic
|
2012-08-22 16:36:44 +02:00
|
|
|
%{nil install -s dcore %{buildroot}%{_bindir}}
|
2007-12-06 00:11:22 +01:00
|
|
|
# Check out that the binary does not bail out:
|
|
|
|
LD_LIBRARY_PATH=%{buildroot}%{_libdir}
|
|
|
|
export LD_LIBRARY_PATH
|
|
|
|
find %{buildroot}%{_bindir}/file %{_bindir}/ /%{_lib}/ %{_libdir}/ | \
|
2016-04-18 15:32:24 +02:00
|
|
|
grep -v tests/data/bom.py | \
|
2007-12-06 00:11:22 +01:00
|
|
|
xargs %{buildroot}%{_bindir}/file -m %{buildroot}%{_miscdir}/magic
|
|
|
|
unset LD_LIBRARY_PATH
|
2009-01-29 23:06:12 +01:00
|
|
|
%{__rm} -f %{buildroot}%{_libdir}/*.la
|
2007-12-06 00:11:22 +01:00
|
|
|
|
2013-02-19 10:07:29 +01:00
|
|
|
%post -n %libname -p /sbin/ldconfig
|
2007-12-06 00:11:22 +01:00
|
|
|
|
2013-02-19 10:07:29 +01:00
|
|
|
%postun -n %libname -p /sbin/ldconfig
|
2006-12-19 00:15:53 +01:00
|
|
|
|
2013-02-19 10:07:29 +01:00
|
|
|
%files -n %libname
|
2006-12-19 00:15:53 +01:00
|
|
|
%defattr (644,root,root,755)
|
|
|
|
%{_libdir}/lib*.so.*
|
2012-10-30 14:31:55 +01:00
|
|
|
|
2013-01-23 09:41:15 +01:00
|
|
|
%files -n file-magic
|
2012-10-30 14:31:55 +01:00
|
|
|
%defattr (644,root,root,755)
|
|
|
|
%config(noreplace) %{_sysconfdir}/magic
|
2007-12-06 00:11:22 +01:00
|
|
|
%{_miscdir}/magic
|
|
|
|
%{_miscdir}/magic.mgc
|
2012-08-22 16:36:44 +02:00
|
|
|
%doc %{_mandir}/man5/magic.5.gz
|
2012-10-30 14:31:55 +01:00
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr (644,root,root,755)
|
|
|
|
%{nil %{_bindir}/dcore}
|
|
|
|
%attr(755,root,root) %{_bindir}/file
|
|
|
|
%doc %{_mandir}/man1/file.1.gz
|
2012-09-18 13:01:25 +02:00
|
|
|
%doc COPYING AUTHORS NEWS ChangeLog
|
2006-12-19 00:15:53 +01:00
|
|
|
|
|
|
|
%files -n file-devel
|
|
|
|
%defattr (644,root,root,755)
|
|
|
|
%{_libdir}/lib*.so
|
2007-12-06 00:11:22 +01:00
|
|
|
%{_includedir}/magic.h
|
2012-08-22 16:36:44 +02:00
|
|
|
%doc %{_mandir}/man3/libmagic.3.gz
|
|
|
|
%doc README COPYING AUTHORS NEWS ChangeLog
|
2006-12-19 00:15:53 +01:00
|
|
|
|
2007-03-07 01:46:08 +01:00
|
|
|
%changelog
|