File star.spec of Package star

# spec file for package star
# Copyright (c) 2012 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

Name:           star
BuildRequires:  autoconf
BuildRequires:  e2fsprogs-devel
BuildRequires:  libacl-devel
BuildRequires:  libselinux-devel
%ifarch ppc64
BuildRequires:  libtool
Provides:       rmt
Version:        1.5final
Release:        0
%define upver 1.5
Source1:        README-FIRST
Source2:        tests.tar.bz2
Patch0:         star-configuration.diff
Patch2:         star-no_fsync.diff
Patch5:         rmt-move.diff
Patch6:         star-selinux.patch
Patch7:         star-lock.diff
Patch8:         star-getline.diff
Patch9:         star-fexecve.diff
Patch10:        star-1.5.1-bufferoverflow.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Summary:        POSIX.1-2001-Compliant Tar Implementation
License:        CDDL-1.0
Group:          Productivity/Archiving/Backup

Star is a tar like archiver. TAR stands for Tape ARchiver. Star is the
fastest known implementation of a tar archiver.


- FIFO to keep the tape streaming.

- remote tape support.

- accurate sparse files (if the OS supports it).

- pattern matcher to archive and extract a subset of files.

- user tailorable interface for comparing tar archives against file

- path names up to 1024 Bytes may be archived.

- stores and restores all 3 file times (even creation time). With
POSIX.1-2001 the times are in nanosecond granularity.

    Joerg Schilling <>

#%setup -b 2 -n tests
#%setup -b 0 -n star-1.5
%setup -q -T -b 2 -n tests -b 0 -n star-1.5
%patch0 -p1
%patch2 -p1
%patch5 -p1
%patch10 -p1

# bugzilla#134113: incompatible license and unused: SKH: removed
# upstream
# rm include/unls.h
# Autoconf does not handle inline comments correctly: Split comments and
# variables into separate lines.
mv conf/ conf/
sed -e 's|\(#.*\)\(/\*.*\*/\)|\2\n\1|g' \
	conf/ >conf/
#ln -sf i586-linux-gcc.rul RULES/i586-linux-cc.rul
#ln -s i586-linux-cc.rul RULES/x86_64-linux-cc.rul
ln -s i586-linux-cc.rul RULES/s390x-linux-cc.rul
ln -s i586-linux-cc.rul RULES/ppc64-linux-cc.rul
#ln -s i586-linux-gcc.rul RULES/x86_64-linux-gcc.rul
ln -s i586-linux-gcc.rul RULES/s390x-linux-gcc.rul
ln -s i586-linux-gcc.rul RULES/ppc64-linux-gcc.rul
ln -s armv4l-linux-gcc.rul RULES/armv5tel-linux-gcc.rul
ln -s armv4l-linux-gcc.rul RULES/armv7l-linux-gcc.rul
cd conf
%ifarch ppc64
cp /usr/share/libtool/config/config.* .
%define star_cflags $RPM_OPT_FLAGS -g -W -Wall -Wpointer-arith -Wformat-security
cp %{SOURCE1} .
make all MAKEPROG=gmake MANDIR=share/man COPTX="%{star_cflags}" CPPOPTX="-DNO_FSYNC"

make install MAKEPROG=gmake INS_BASE=$RPM_BUILD_ROOT/usr MANDIR=share/man \
		COPTX="%{star_cflags}" CPPOPTX="-DNO_FSYNC"
mkdir -p $RPM_BUILD_ROOT/etc/default
mkdir $RPM_BUILD_ROOT/sbin
install -m 644 rmt/rmt.dfl $RPM_BUILD_ROOT/etc/default/rmt
mv $RPM_BUILD_ROOT/usr/etc/default/{rmt,star} $RPM_BUILD_ROOT/etc/default
#mv $RPM_BUILD_ROOT/usr/bin/star_fat $RPM_BUILD_ROOT/usr/bin/star
mkdir -p $RPM_BUILD_ROOT/%{_docdir}/{star,rmt}
mv $RPM_BUILD_ROOT/usr/share/doc/star/* $RPM_BUILD_ROOT/%{_docdir}/star
mv $RPM_BUILD_ROOT/usr/share/doc/rmt/* $RPM_BUILD_ROOT/%{_docdir}/rmt
# if we put these as files-to-install in %doc in the filelist, docdir is 
# deleted and recreated. it's either all in %install or all in %files
install AN* BUILD COMPILE INSTALL PORTING README Changelog CDDL.Schily.txt CDDL.Sun.txt README.* TODO $RPM_BUILD_ROOT/%{_docdir}/star/
rm -f $RPM_BUILD_ROOT/usr/bin/ustar
rm -f $RPM_BUILD_ROOT/usr/bin/tar
ln -sf ./star $RPM_BUILD_ROOT/usr/bin/ustar
rm -rf $RPM_BUILD_ROOT/%{_prefix}/{lib,include,bin/mt} \
       $RPM_BUILD_ROOT%{_mandir}/man[35] \
       $RPM_BUILD_ROOT%{_mandir}/man1/{gnutar,scpio,smt,spax,suntar}.1 \
# Run test suite?
   [ -r /proc/config.gz ] \
   && eval "$(zcat /proc/config.gz \
	| sed -e 's/^# \(.*\) is not set/\1=n/')"
    if [ "$CONFIG_EXT2_FS" == y -a \
	 "$CONFIG_EXT2_FS_POSIX_ACL"  == y -a \
	 "$CONFIG_EXT2_FS_XATTR_USER" == y ] ; then
	cd %_builddir/tests
	export PATH=$RPM_BUILD_ROOT/usr/bin:$PATH
	echo "Test suite skipped: requires a kernel with the " \
mv $RPM_BUILD_ROOT/usr/sbin/rmt $RPM_BUILD_ROOT/sbin
ln -sf ../sbin/rmt $RPM_BUILD_ROOT/etc/rmt


%defattr(-, root, root)
%dir %{_docdir}/star
%docdir %{_docdir}/star
%attr(644,root,root) %{_docdir}/star/*
%dir %{_docdir}/rmt
%docdir %{_docdir}/rmt
%attr(644,root,root) %{_docdir}/rmt/*
%config(noreplace) %attr(644, root, root) /etc/default/rmt
%config(noreplace) %attr(644, root, root) /etc/default/star