File p7zip.spec of Package p7zip

#
# spec file for package p7zip (Version 9.04)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild


Name:           p7zip
BuildRequires:  gcc-c++
License:        LGPL v2.1 or later
Group:          Productivity/Archiving/Compression
AutoReqProv:    on
Version:        9.04
Release:        1
Summary:        7-zip file compression program
Url:            http://p7zip.sourceforge.net/
Source:         http://switch.dl.sourceforge.net/sourceforge/%{name}/%{name}_%{version}_src_all.tar.bz2
Patch0:         p7zip-9.04-install.patch
Patch1:         p7zip-9.04-gcc_missing_include.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
p7zip is a quick port of 7z.exe and 7za.exe (command line version of
7zip, see www.7-zip.org) for Unix. 7-Zip is a file archiver with
highest compression ratio. Since 4.10, p7zip (like 7-zip) supports
little-endian and big-endian machines.



Authors:
--------
    Igor Pavlov <ipavlov@users.sourceforge.net>
    my space <myspace@users.sourceforge.net>

%prep
%setup -q -n %{name}_%{version}
%patch0 -p1
%patch1 -p1
%ifarch x86_64 ppc64 s390x
cp makefile.linux_amd64 makefile.machine
%else
cp makefile.linux_x86_ppc_alpha_gcc_4.X makefile.machine
%endif
perl -pi -e 's/ -s / /' makefile.machine
perl -pi -e 's/(\$\(LOCAL_FLAGS\))/'"$RPM_OPT_FLAGS"' \\\n\t$1/' makefile.machine

%build
%{__make} %{?jobs:-j%jobs} all2

%install
%{__mkdir_p} $RPM_BUILD_ROOT/%{_bindir}
%{__mkdir_p} $RPM_BUILD_ROOT%{_mandir}/man1
./install.sh \
	%{_bindir} \
	%{_libdir}/%{name} \
	%{_mandir} \
        %{_defaultdocdir}/%{name} \
        %{buildroot}
# fix permissions in DOCS dir
#chmod -R u+w %{buildroot}/%{_defaultdocdir}/%{name}/DOCS
# fix build root in scripts:
#rm -f $RPM_BUILD_ROOT/%{_bindir}/7za
#cat > $RPM_BUILD_ROOT/%{_bindir}/7za <<-EOT
#	#!/bin/bash
#	exec %{_libdir}/%{name}/7za "\$@"
#EOT
#chmod a+x $RPM_BUILD_ROOT/%{_bindir}/7za
#rm -f $RPM_BUILD_ROOT/%{_bindir}/7z
#cat > $RPM_BUILD_ROOT/%{_bindir}/7z <<-EOT
#	#!/bin/bash
#	exec %{_libdir}/%{name}/7z "\$@"
#EOT
#chmod a+x $RPM_BUILD_ROOT/%{_bindir}/7z

%check
%{__make} test
%{__make} test_7z

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%dir %{_libdir}/%{name}
%dir %{_libdir}/%{name}/Codecs
#%dir %{_libdir}/%{name}/Formats
%{_libdir}/%{name}/[0-9a-z]*
%{_libdir}/%{name}/Codecs/*
#%{_libdir}/%{name}/Formats/*
%{_bindir}/7z
%{_bindir}/7za
%doc %{_defaultdocdir}/%{name}
%{_mandir}/man1/*

%changelog
openSUSE Build Service is sponsored by