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
|
|
|
#
|
2020-05-04 15:53:02 +02:00
|
|
|
# Copyright (c) 2020 SUSE LLC
|
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.
|
|
|
|
|
2019-05-27 11:37:06 +02:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2006-12-19 00:15:53 +01:00
|
|
|
#
|
|
|
|
|
2011-10-02 16:37:56 +02:00
|
|
|
|
2013-02-19 10:07:29 +01:00
|
|
|
%define somajor 1
|
|
|
|
%define libname libmagic%{somajor}
|
|
|
|
|
2006-12-19 00:15:53 +01:00
|
|
|
Name: file
|
2019-10-28 11:06:08 +01:00
|
|
|
BuildRequires: bash >= 4.0
|
2011-10-02 16:37:56 +02:00
|
|
|
BuildRequires: libtool
|
2012-03-23 15:41:17 +01:00
|
|
|
BuildRequires: zlib-devel
|
2020-01-15 10:20:20 +01:00
|
|
|
BuildRequires: pkgconfig(bzip2)
|
|
|
|
BuildRequires: pkgconfig(liblzma)
|
2019-12-20 15:01:13 +01:00
|
|
|
BuildRequires: pkgconfig(libseccomp)
|
2019-12-17 10:59:56 +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
|
2020-06-17 17:16:08 +02:00
|
|
|
Version: 5.39
|
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
|
2019-10-14 15:42:39 +02:00
|
|
|
Source0: 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
|
2018-08-13 13:42:53 +02:00
|
|
|
Source4: ftp://ftp.astron.com/pub/file/file-%{version}.tar.gz.asc
|
|
|
|
Source5: file.keyring
|
2019-12-17 10:59:56 +01:00
|
|
|
Patch: file-5.38.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
|
2014-05-12 10:47:59 +02:00
|
|
|
Patch37: file-secure_getenv.patch
|
2016-10-25 09:03:35 +02:00
|
|
|
Patch39: file-5.28-btrfs-image.dif
|
2020-01-12 17:03:11 +01:00
|
|
|
Patch40: file-5.38-allow-readlinkat.dif
|
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.
|
|
|
|
|
2016-04-19 16:08:46 +02:00
|
|
|
%package magic
|
2017-10-12 13:26:15 +02:00
|
|
|
Summary: Database for libmagic to help identify files
|
2013-11-05 12:21:24 +01:00
|
|
|
Group: Productivity/File utilities
|
2016-04-19 16:08:46 +02:00
|
|
|
Obsoletes: libmagic-data < %{version}
|
|
|
|
Provides: libmagic-data = %{version}
|
2016-08-24 17:13:36 +02:00
|
|
|
BuildArch: noarch
|
2012-10-30 14:31:55 +01:00
|
|
|
|
2016-04-19 16:08:46 +02:00
|
|
|
%description 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
|
2017-10-12 13:26:15 +02:00
|
|
|
Summary: Library for heuristic file type identification
|
2013-11-05 12:21:24 +01:00
|
|
|
Group: System/Libraries
|
2016-04-19 16:08:46 +02:00
|
|
|
Provides: file:%{_libdir}/libmagic.so.%{somajor}
|
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
|
|
|
|
|
2016-04-19 16:08:46 +02:00
|
|
|
%package devel
|
2017-10-12 13:26:15 +02:00
|
|
|
Summary: Development files for libmagic, a library to determine file types
|
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
|
|
|
|
2016-04-19 16:08:46 +02:00
|
|
|
%description devel
|
2006-12-19 00:15:53 +01:00
|
|
|
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
|
2020-06-17 17:16:08 +02:00
|
|
|
%patch12 -p1 -b .opt
|
2007-08-29 22:26:43 +02:00
|
|
|
%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
|
2014-05-12 10:47:59 +02:00
|
|
|
%patch37 -p1 -b .getenv
|
2016-11-24 11:45:15 +01:00
|
|
|
%patch39 -p1 -b .btrfs
|
2020-01-12 17:03:11 +01:00
|
|
|
%patch40 -p1 -b .readlinkat
|
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
|
2019-12-20 15:04:56 +01:00
|
|
|
export CFLAGS="%{optflags} -DHOWMANY=69632 -fPIE $(pkg-config libseccomp --cflags)"
|
2020-01-07 12:24:32 +01:00
|
|
|
%configure --disable-silent-rules --datadir=%{_miscdir} \
|
|
|
|
--disable-static \
|
2020-01-15 10:20:20 +01:00
|
|
|
--disable-libseccomp \
|
2020-01-07 12:41:37 +01:00
|
|
|
--enable-fsect-man5
|
2017-10-12 13:26:15 +02:00
|
|
|
make %{?_smp_mflags} pkgdatadir='$(datadir)' LDFLAGS="-pie"
|
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
|
2016-04-19 16:08:46 +02:00
|
|
|
# Does not build
|
|
|
|
%if %{with decore}
|
|
|
|
install -s dcore %{buildroot}%{_bindir}
|
|
|
|
%endif
|
2019-10-28 11:06:08 +01:00
|
|
|
|
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
|
2019-10-28 11:06:08 +01:00
|
|
|
%{buildroot}%{_bindir}/file -m %{buildroot}%{_miscdir}/magic %{buildroot}%{_bindir}/file
|
|
|
|
shopt -s globstar
|
|
|
|
for dir in %{_bindir} /%{_lib} %{_libdir} ; do
|
|
|
|
echo $dir/** | \
|
2016-04-20 10:01:20 +02:00
|
|
|
xargs %{buildroot}%{_bindir}/file -m %{buildroot}%{_miscdir}/magic
|
2019-10-28 11:06:08 +01:00
|
|
|
done
|
2007-12-06 00:11:22 +01:00
|
|
|
unset LD_LIBRARY_PATH
|
2017-10-12 13:26:15 +02: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
|
2016-04-19 16:08:46 +02:00
|
|
|
%defattr (-,root,root)
|
2006-12-19 00:15:53 +01:00
|
|
|
%{_libdir}/lib*.so.*
|
2012-10-30 14:31:55 +01:00
|
|
|
|
2016-04-19 16:08:46 +02:00
|
|
|
%files magic
|
|
|
|
%defattr (-,root,root)
|
2012-10-30 14:31:55 +01:00
|
|
|
%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
|
2016-04-19 16:08:46 +02:00
|
|
|
%defattr (-,root,root)
|
|
|
|
%if %{with decore}
|
|
|
|
%attr(755,root,root) %{_bindir}/dcore
|
|
|
|
%endif
|
2012-10-30 14:31:55 +01:00
|
|
|
%attr(755,root,root) %{_bindir}/file
|
|
|
|
%doc %{_mandir}/man1/file.1.gz
|
2018-02-27 10:47:58 +01:00
|
|
|
%license COPYING
|
|
|
|
%doc AUTHORS NEWS ChangeLog
|
2006-12-19 00:15:53 +01:00
|
|
|
|
2016-04-19 16:08:46 +02:00
|
|
|
%files devel
|
|
|
|
%defattr (-,root,root)
|
2006-12-19 00:15:53 +01:00
|
|
|
%{_libdir}/lib*.so
|
2007-12-06 00:11:22 +01:00
|
|
|
%{_includedir}/magic.h
|
2020-06-17 17:16:08 +02:00
|
|
|
%{_libdir}/pkgconfig/libmagic.pc
|
2012-08-22 16:36:44 +02:00
|
|
|
%doc %{_mandir}/man3/libmagic.3.gz
|
2018-02-27 10:47:58 +01:00
|
|
|
%license COPYING
|
|
|
|
%doc README AUTHORS NEWS ChangeLog
|
2006-12-19 00:15:53 +01:00
|
|
|
|
2007-03-07 01:46:08 +01:00
|
|
|
%changelog
|