2010-09-20 22:40:25 +00:00
|
|
|
#
|
2011-09-08 16:13:00 +00:00
|
|
|
# spec file for package perl-File-Unpack
|
2010-09-20 22:40:25 +00:00
|
|
|
#
|
2013-01-25 21:24:39 +00:00
|
|
|
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
2010-09-20 22:40:25 +00:00
|
|
|
#
|
2011-09-08 16:13:00 +00: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.
|
|
|
|
|
2010-09-20 22:40:25 +00:00
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
2011-09-08 16:13:00 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
Name: perl-File-Unpack
|
2013-07-29 19:02:54 +00:00
|
|
|
Version: 0.64
|
2011-09-08 16:13:00 +00:00
|
|
|
Release: 0%{?dist}
|
2012-01-25 20:07:27 +00:00
|
|
|
Summary: An strong archive file unpacker, based on mime-types
|
2012-08-23 18:50:04 +00:00
|
|
|
License: GPL-1.0+ or Artistic-1.0
|
|
|
|
Group: Development/Libraries/Perl
|
2011-09-08 16:13:00 +00:00
|
|
|
Source: http://search.cpan.org/CPAN/authors/id/J/JN/JNW/File-Unpack-%{version}.tar.gz
|
2012-01-25 20:07:27 +00:00
|
|
|
Url: http://github.com/jnweiger/perl-File-Unpack
|
2011-09-08 16:13:00 +00:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
|
|
|
|
BuildArch: noarch
|
|
|
|
|
2012-08-23 18:50:04 +00:00
|
|
|
BuildRequires: perl(Test::CheckManifest)
|
2011-09-08 16:13:00 +00:00
|
|
|
BuildRequires: perl(Test::More)
|
|
|
|
BuildRequires: perl(Test::Pod)
|
|
|
|
BuildRequires: perl(Test::Pod::Coverage)
|
|
|
|
|
|
|
|
BuildRequires: perl(Carp)
|
|
|
|
BuildRequires: perl(Cwd)
|
|
|
|
BuildRequires: perl(File::Compare)
|
|
|
|
BuildRequires: perl(File::LibMagic)
|
|
|
|
BuildRequires: perl(File::MimeInfo::Magic)
|
2012-08-23 18:50:04 +00:00
|
|
|
BuildRequires: perl(File::Path)
|
|
|
|
BuildRequires: perl(File::Temp)
|
2011-09-08 16:13:00 +00:00
|
|
|
|
2010-09-20 22:40:25 +00:00
|
|
|
%if 0%{?suse_version} > 1110
|
|
|
|
# SLES11 does does not have this:
|
2011-09-08 16:13:00 +00:00
|
|
|
BuildRequires: perl(Compress::Raw::Lzma)
|
2013-02-05 20:18:37 +00:00
|
|
|
# (provider perl-Compress-Raw-Zlib is obsoleted by installed perl)
|
|
|
|
BuildRequires: perl(Compress::Raw::Zlib) >= 2.024
|
2013-02-05 20:33:28 +00:00
|
|
|
%else
|
|
|
|
## almost all in ibs: provider perl obsoletes installed perl-macros
|
|
|
|
## but SLE_11_SP1 fails without it:
|
|
|
|
BuildRequires: perl-macros
|
2010-09-20 22:40:25 +00:00
|
|
|
%endif
|
2012-08-23 18:50:04 +00:00
|
|
|
BuildRequires: perl(BSD::Resource)
|
2011-09-08 16:13:00 +00:00
|
|
|
BuildRequires: perl(Compress::Raw::Bzip2)
|
|
|
|
BuildRequires: perl(Filesys::Statvfs)
|
|
|
|
BuildRequires: perl(IPC::Run)
|
2012-08-23 18:50:04 +00:00
|
|
|
BuildRequires: perl(JSON)
|
|
|
|
BuildRequires: perl(String::ShellQuote)
|
2011-09-08 16:13:00 +00:00
|
|
|
BuildRequires: perl(Text::Sprintf::Named)
|
2010-09-20 22:40:25 +00:00
|
|
|
# shared-mime-info is a dependency of perl-File-MimeInfo
|
|
|
|
# file is a dependency of perl-File-LibMagic
|
2012-08-23 18:50:04 +00:00
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRequires: file >= 5.03
|
2011-09-08 16:13:00 +00:00
|
|
|
BuildRequires: shared-mime-info >= 0.60
|
2010-09-20 22:40:25 +00:00
|
|
|
|
2011-09-08 16:13:00 +00:00
|
|
|
Requires: perl(Carp)
|
|
|
|
Requires: perl(Cwd)
|
|
|
|
Requires: perl(File::LibMagic)
|
|
|
|
Requires: perl(File::MimeInfo::Magic)
|
2012-08-23 18:50:04 +00:00
|
|
|
Requires: perl(File::Path)
|
|
|
|
Requires: perl(File::Temp)
|
2010-09-20 22:40:25 +00:00
|
|
|
|
|
|
|
%if 0%{?suse_version} >= 1110
|
|
|
|
# SLES11 does does not have this:
|
2011-09-08 16:13:00 +00:00
|
|
|
Requires: perl(Compress::Raw::Lzma)
|
2010-09-20 22:40:25 +00:00
|
|
|
%endif
|
2011-09-08 16:13:00 +00:00
|
|
|
Requires: perl(Compress::Raw::Bzip2)
|
|
|
|
Requires: perl(Compress::Raw::Zlib)
|
2010-09-24 16:24:04 +00:00
|
|
|
# 2.024 is provided by perl-5.12.1 in 11.3
|
2012-08-23 18:50:04 +00:00
|
|
|
Requires: file >= 5.03
|
|
|
|
Requires: shared-mime-info >= 0.60
|
2011-09-08 16:13:00 +00:00
|
|
|
Requires: perl(BSD::Resource)
|
2012-08-23 18:50:04 +00:00
|
|
|
Requires: perl(Compress::Raw::Zlib) >= 2.024
|
2011-09-08 16:13:00 +00:00
|
|
|
Requires: perl(Filesys::Statvfs)
|
|
|
|
Requires: perl(IPC::Run)
|
2012-08-23 18:50:04 +00:00
|
|
|
Requires: perl(JSON)
|
|
|
|
Requires: perl(String::ShellQuote)
|
2011-09-08 16:13:00 +00:00
|
|
|
Requires: perl(Text::Sprintf::Named)
|
2010-09-20 22:40:25 +00:00
|
|
|
|
|
|
|
## refer to Unpack.pm:@builtin_mime_handlers and to the helper subdirectory
|
|
|
|
## to see what we might need:
|
|
|
|
# grep '# Requires: ' Unpack.pm helper/*
|
|
|
|
|
|
|
|
%if 0%{?suse_version} > 1110
|
|
|
|
# 11.1 and SLES11 say: unresolvable: nothing provides xz
|
2011-09-08 16:13:00 +00:00
|
|
|
BuildRequires: xz
|
2012-01-29 21:30:30 +00:00
|
|
|
Requires: xz
|
2013-06-18 11:07:30 +00:00
|
|
|
%else
|
|
|
|
Recommends: xz
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if 0%{?suse_version} > 1230
|
2013-06-14 10:31:02 +00:00
|
|
|
BuildRequires: lzip
|
|
|
|
Requires: lzip
|
2012-01-29 21:30:30 +00:00
|
|
|
%else
|
2013-06-14 10:31:02 +00:00
|
|
|
Recommends: lzip
|
2010-09-20 22:40:25 +00:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%if 0%{?suse_version} > 1010
|
|
|
|
# SLES10 says: nothing provides poppler-tools
|
2011-09-08 16:13:00 +00:00
|
|
|
BuildRequires: poppler-tools
|
2012-01-29 21:30:30 +00:00
|
|
|
Requires: poppler-tools
|
|
|
|
%else
|
|
|
|
Recommends: poppler-tools
|
2010-09-20 22:40:25 +00:00
|
|
|
%endif
|
|
|
|
|
2012-01-29 21:30:30 +00:00
|
|
|
## The following BuildRequires is for testing existance only.
|
|
|
|
## If you cannot provide a package, you may remove it from both BuildRequires
|
|
|
|
## and Requires, and move it over to Recommends.
|
2012-08-23 18:50:04 +00:00
|
|
|
BuildRequires: binutils
|
|
|
|
BuildRequires: bzip2
|
|
|
|
BuildRequires: cabextract
|
|
|
|
BuildRequires: cpio
|
|
|
|
BuildRequires: genisoimage
|
|
|
|
BuildRequires: gzip
|
|
|
|
BuildRequires: p7zip
|
|
|
|
BuildRequires: rpm
|
|
|
|
BuildRequires: sharutils
|
|
|
|
BuildRequires: tar
|
|
|
|
BuildRequires: unzip
|
|
|
|
Requires: binutils
|
|
|
|
Requires: bzip2
|
|
|
|
Requires: cabextract
|
|
|
|
Requires: cpio
|
|
|
|
Requires: genisoimage
|
|
|
|
Requires: gzip
|
|
|
|
Requires: p7zip
|
|
|
|
Requires: rpm
|
|
|
|
Requires: sharutils
|
|
|
|
Requires: tar
|
|
|
|
Requires: unzip
|
2013-03-04 14:21:25 +00:00
|
|
|
Recommends: unrar poppler-tools xz upx antiword
|
2011-03-31 22:59:08 +00:00
|
|
|
|
|
|
|
%if 0%{?suse_version} < 1140
|
2011-09-08 16:13:00 +00:00
|
|
|
Requires: perl = %{perl_version}
|
2011-03-31 22:59:08 +00:00
|
|
|
%else
|
2011-01-17 16:08:39 +00:00
|
|
|
%{perl_requires}
|
2011-03-31 22:59:08 +00:00
|
|
|
%endif
|
2011-09-08 16:13:00 +00:00
|
|
|
Requires: file_unpack == %version
|
2010-09-20 22:40:25 +00:00
|
|
|
|
|
|
|
%description
|
2012-02-21 14:27:19 +00:00
|
|
|
File::Unpack is an unpacker for archives and files
|
2012-01-31 23:56:31 +00:00
|
|
|
(bz2/gz/zip/tar/cpio/iso/rpm/deb/cab/lzma/7z/rar/...). We call
|
2012-01-25 20:07:27 +00:00
|
|
|
it strong, because it is not fooled by file suffixes, or multiply wrapped packages.
|
2012-01-31 23:56:31 +00:00
|
|
|
It reliably detects mime-types and recursivly descends into each archive found
|
|
|
|
until it finally exposes all unpackable payload contents.
|
2012-01-25 20:07:27 +00:00
|
|
|
A precise logfile can be written, describing mimetypes and unpack actions.
|
2012-01-31 23:56:31 +00:00
|
|
|
Most of the known archive file formats are supported. Shell-script-style
|
|
|
|
plugins can be added to support additinal formats.
|
2010-09-20 22:40:25 +00:00
|
|
|
|
2011-03-28 20:25:33 +00:00
|
|
|
Authors:
|
|
|
|
--------
|
2012-01-31 23:56:31 +00:00
|
|
|
Jürgen Weigert <jw@suse.de>
|
2011-03-28 20:25:33 +00:00
|
|
|
|
|
|
|
%package -n file_unpack
|
|
|
|
Summary: Command line tool to unpack anything
|
|
|
|
Group: Productivity/Archiving/Compression
|
2012-08-23 18:50:04 +00:00
|
|
|
Requires: perl(File::Unpack) == %version
|
|
|
|
|
|
|
|
# BUGALERT: this package is implicitly noarch, although it contains an
|
|
|
|
# architecture dependand binary. If I try, I get this nonsense:
|
|
|
|
# error: line 161: Only noarch subpackages are supported
|
2011-03-28 20:25:33 +00:00
|
|
|
|
|
|
|
%description -n file_unpack
|
|
|
|
/usr/bin/file_unpack is a trivial command line frontend that
|
|
|
|
ships with the File::Unpack perl module.
|
|
|
|
|
|
|
|
Authors:
|
|
|
|
--------
|
|
|
|
Juergen Weigert <jw@suse.de>
|
2010-09-20 22:40:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n File-Unpack-%{version}
|
|
|
|
|
|
|
|
%build
|
2012-08-23 18:50:04 +00:00
|
|
|
|
|
|
|
if [ -f Build.PL ]; then
|
2010-09-20 22:40:25 +00:00
|
|
|
%{__perl} Build.PL --installdirs vendor
|
|
|
|
./Build build flags=%{?_smp_mflags}
|
|
|
|
else
|
2012-08-23 18:50:04 +00:00
|
|
|
%{__perl} Makefile.PL INSTALLDIRS=vendor
|
|
|
|
%{__make} %{?_smp_mflags}
|
2010-09-20 22:40:25 +00:00
|
|
|
fi
|
|
|
|
|
2012-08-23 18:50:04 +00:00
|
|
|
(cd contrib && %{__make} stringsx)
|
|
|
|
|
2010-09-20 22:40:25 +00:00
|
|
|
%install
|
|
|
|
if [ -f Build.PL ]; then
|
|
|
|
./Build pure_install --destdir %{buildroot}
|
|
|
|
else
|
|
|
|
%{__make} pure_install PERL_INSTALL_ROOT=%{buildroot}
|
|
|
|
fi
|
|
|
|
install -D file_unpack.pl $RPM_BUILD_ROOT/usr/bin/file_unpack
|
|
|
|
install -d $RPM_BUILD_ROOT/usr/share/File-Unpack/helper/
|
|
|
|
install helper/* $RPM_BUILD_ROOT/usr/share/File-Unpack/helper/
|
2011-03-28 22:17:30 +00:00
|
|
|
|
|
|
|
%fdupes $RPM_BUILD_ROOT/usr/share/File-Unpack/
|
|
|
|
|
2010-12-05 21:51:12 +00:00
|
|
|
ln -s /usr/bin/file_unpack $RPM_BUILD_ROOT/usr/bin/unpack_file
|
2010-09-20 22:40:25 +00:00
|
|
|
|
2011-03-29 11:13:36 +00:00
|
|
|
## CAUTION: a line beginning with . is a macro-expanded by nroff.
|
2011-03-31 22:59:08 +00:00
|
|
|
# echo .nf > file_unpack.1
|
|
|
|
# perl -Iblib/lib file_unpack.pl --help >> file_unpack.1 && true
|
|
|
|
# rm -rf file_unpack.1
|
|
|
|
|
|
|
|
cat <<EOF> file_unpack.pod
|
|
|
|
=pod
|
|
|
|
|
|
|
|
=head1 SYNOPSIS
|
|
|
|
EOF
|
|
|
|
perl file_unpack.pl --help >> file_unpack.pod && true
|
|
|
|
cat <<EOF1>> file_unpack.pod
|
|
|
|
=head1 REFERENCES
|
|
|
|
|
|
|
|
See also C<perldoc File::Unpack>
|
|
|
|
EOF1
|
2011-05-12 11:41:49 +00:00
|
|
|
pod2man file_unpack.pod > file_unpack.1
|
2011-03-31 22:59:08 +00:00
|
|
|
rm file_unpack.pod
|
|
|
|
echo file_unpack.1 >> MANIFEST
|
2011-09-08 16:13:00 +00:00
|
|
|
|
2011-03-28 22:17:30 +00:00
|
|
|
install -m0644 -D file_unpack.1 $RPM_BUILD_ROOT/%_mandir/man1/file_unpack.1
|
|
|
|
ln -s %_mandir/man1/file_unpack.1 $RPM_BUILD_ROOT/%_mandir/man1/unpack_file.1
|
2012-08-23 18:50:04 +00:00
|
|
|
install -m0755 -D contrib/stringsx $RPM_BUILD_ROOT/%_bindir/stringsx
|
|
|
|
rm contrib/stringsx # so that the Manifest in make check is not confused.
|
2011-03-28 22:17:30 +00:00
|
|
|
|
2010-09-20 22:40:25 +00:00
|
|
|
# FIXME: use ./Build install destdir=$RPM_BUILD_ROOT create_packlist=0
|
|
|
|
# maybe then we would not need to remove the .packlist files :-)
|
|
|
|
find %{buildroot} -type f -name .packlist -exec rm -f {} ';'
|
|
|
|
|
|
|
|
find %{buildroot} -depth -type d -exec rmdir {} 2>/dev/null ';'
|
|
|
|
|
|
|
|
%{_fixperms} %{buildroot}/*
|
|
|
|
%perl_process_packlist
|
|
|
|
%perl_gen_filelist
|
|
|
|
|
2012-01-24 19:13:16 +00:00
|
|
|
## seperate bin man from the main package
|
|
|
|
mv %{name}.files /tmp/%{name}.files
|
|
|
|
sed -ie '/\/man\?/d' /tmp/%{name}.files
|
|
|
|
sed -ie '/\/bin\//d' /tmp/%{name}.files
|
|
|
|
|
2010-09-20 22:40:25 +00:00
|
|
|
%check
|
|
|
|
export RELEASE_TESTING=1
|
|
|
|
# echo >> MANIFEST.SKIP
|
2011-03-29 11:13:36 +00:00
|
|
|
# echo >> MANIFEST.SKIP ^PERCENT{name}\.files\$
|
2010-09-20 22:40:25 +00:00
|
|
|
if [ -f Build.PL ]; then
|
|
|
|
./Build test
|
|
|
|
else
|
|
|
|
%{__make} test
|
|
|
|
fi
|
|
|
|
|
|
|
|
%clean
|
|
|
|
[ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && %{__rm} -rf $RPM_BUILD_ROOT
|
|
|
|
|
2012-01-24 19:13:16 +00:00
|
|
|
%files -f /tmp/%{name}.files
|
2010-09-20 22:40:25 +00:00
|
|
|
%defattr(-,root,root,-)
|
|
|
|
%doc README Changes
|
2012-01-24 19:13:16 +00:00
|
|
|
%dir /usr/share/File-Unpack
|
2010-09-20 22:40:25 +00:00
|
|
|
/usr/share/File-Unpack/*
|
2012-01-24 19:13:16 +00:00
|
|
|
%doc %_mandir/man3/*
|
2011-03-28 20:25:33 +00:00
|
|
|
|
|
|
|
%files -n file_unpack
|
|
|
|
%defattr(-,root,root)
|
2012-01-24 19:13:16 +00:00
|
|
|
/usr/bin/*
|
2011-03-28 22:17:30 +00:00
|
|
|
%doc %_mandir/man1/*
|
2010-09-20 22:40:25 +00:00
|
|
|
|
|
|
|
%changelog
|