LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File cdrtools.spec of Package cdrtools (Project multimedia:apps)

# spec file for package cdrtools
# Copyright (c) 2014 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/

Name:           cdrtools
Version:        3.01~a23
Release:        0
# ^This really is a prerelease and thus sorts before 3.01
%define sversion 3.01
Summary:        Tools for recording CD/DVD/BluRay media
License:        CDDL-1.0 and GPL-2.0 and GPL-2.0+ and BSD-2-Clause and BSD-3-Clause and HPND and ISC
Group:          Productivity/Multimedia/CD/Record
Url:            http://cdrecord.berlios.de/private/cdrecord.html

#Freecode-URL:	http://freecode.com/projects/cdrtools
#DL-URL:	ftp://ftp.berlios.de/pub/cdrecord/
Source:         ftp://ftp.berlios.de/pub/cdrecord/alpha/cdrtools-3.01a23.tar.bz2
Source1:        cdrecord.easy
Source2:        cdrecord.secure
Source3:        cdrecord.paranoid
Source4:        cdda2wav.easy
Source5:        cdda2wav.secure
Source6:        cdda2wav.paranoid
Source7:        pre_checkin.sh
# Please honor Jörg Schilling's (the author) request for an "Upstream First"
# policy on patches, to ensure your patch really does the right thing and not
# just the thing you *thought* it does.
# —Jan Engelhardt <jengelh@inai.de>
Patch1:         gcc48wa.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

BuildRequires:  fdupes
BuildRequires:  libcap-devel
BuildRequires:  libscg-devel
BuildRequires:  libschily-devel
BuildRequires:  makedepend
# Requiring version-release is nessecary for this rpm to pull in the latest cdrtools.
Requires:       cdda2wav = %{version}-%{release}
Requires:       cdrecord = %{version}-%{release}
Requires:       mkisofs = %{version}-%{release}
Provides:       schily-cdrtools = %{version}
Obsoletes:      schily-cdrtools < %{version}
Conflicts:      cdrkit-cdrtools-compat

%define with_caps 0
%if 0%{?with_caps}
%define caps_cdda2wav %caps(cap_dac_override,cap_sys_admin,cap_sys_nice,cap_net_bind_service,cap_sys_rawio=ep)
%define caps_cdrecord %caps(cap_sys_resource,cap_dac_override,cap_sys_admin,cap_sys_nice,cap_net_bind_service,cap_ipc_lock,cap_sys_rawio=ep)
%define caps_readcd   %caps(cap_dac_override,cap_sys_admin,cap_net_bind_service,cap_sys_rawio=ep)
%define caps_cdda2wav %nil
%define caps_cdrecord %nil
%define caps_readcd   %nil

Cdrtools is a set of command line programs for writing to
CD/DVD/BluRay media. It will install the original cdrtools binaries.
This is the original version from Joerg Schilling. Built from clean
sources without patches.

%package -n btcflash
Summary:        Firmware flash utility for BTC DRW1008 DVD+/-RW recorder
License:        CDDL-1.0
Group:          Hardware/Other

%description -n btcflash
Btcflash is used to read update the Firmware for a BTC DRW1008
DVD+/-RW recorder. Be very careful when writing firmware as this
program does not check for the correctness of the target device.
Build from clean sources without patches.

%package -n cdda2wav
Summary:        A CD Digital Audio Extraction tool
License:        CDDL-1.0
Group:          Productivity/Multimedia/CD/Grabbers
%if %with_caps
Requires(post): permissions

%description -n cdda2wav
cdda2wav can retrieve CDDA audio tracks from CDROM drives that are
capable of reading audio data digitally to the host via SCSI.

%package -n cdrecord
Summary:        A CD/DVD/BD recording program
License:        CDDL-1.0
Group:          Productivity/Multimedia/CD/Record
%if %with_caps
Requires(post): permissions

%description -n cdrecord
cdrecord is a program to record data or audio Compact Discs on an
Orange Book CD recorder, to write DVD media on a DVD recorder or to
write BluRay media on a BluRay recorder.

%package -n mkisofs
Summary:        A program to generate an ISO-9660/JOLIET/HFS/UDF hybrid filesystem
License:        GPL-2.0
Group:          Productivity/Multimedia/CD/Record
Requires:       zisofs-tools

%description -n mkisofs
mkisofs is effectively a pre-mastering program to generate an
ISO-9660/JOLIET/HFS/UDF hybrid filesystem.

%setup -q -n %{name}-%{sversion}
%patch -P 1 -p1

# We want to prefer the files from /usr/include, but gcc blatantly ignores
# -I arguments pointing to system paths. (CFLAGS=-I/usr/include is therefore
# out of the question.)
rm -Rf include/schily/*.h libscg/scg/*.h
cp -a "%_includedir/schily"/*.h include/schily/
cp -a "%_includedir/scg"/*.h libscg/scg/

# (this is a noninteractive build; nobody will read the warnings
# or care about the pause, so use GMAKE_NOWARN.)
# To enable verbosity, use with CC=cc LDCC=cc DYNLD=cc.
# Note that specifying -fPIE/-pie here conflicts with the generation
# of shared objects, which is why we build those separately
# in schily-libs.spec instead.
# Not fully parallel safe, so stick to default.
gmake GMAKE_NOWARN=true RUNPATH="" \
	CCCC=cc LDCC="cc -L%_libdir" DYNLD=cc \
	COPTX="%optflags -fno-strict-aliasing -fno-omit-frame-pointer \
		-fPIE -ggdb -finput-charset=ISO-8859-1" \
	LDOPTX="-pie -Wl,-pie -ggdb" RUNPATH=""

gmake GMAKE_NOWARN=true RUNPATH="" \
	DESTDIR="$b" INS_BASE="%_prefix" install %{?_smp_mflags}

# Devel files not used and/or already provided by libschily-devel, libscg-devel
rm -Rf "$b/%_includedir" "$b/%_prefix/lib"/*.a "$b/%_prefix/lib/profiled" \
	"$b/%_mandir/man5"/makefiles.5* \

%if %with_caps
mkdir -p "%{buildroot}%{_sysconfdir}/permissions.d/"
install -pm 0644 "%_sourcedir"/{cdrecord,cdda2wav}.{easy,secure,paranoid} \

cd "%{buildroot}%{_prefix}"
[[ -d "./%{_lib}" ]] || mv -T ./lib "./%{_lib}"
cd -

# Needed by cdda2wav (see cdda2wav.c)
ln -sf cdda2wav %{buildroot}%{_bindir}/list_audio_tracks

# Remove documentation (will be added in /usr/share/doc/packages/*)
rm -rf %{buildroot}%{_datadir}/doc/*

# Install additional programs
install -pm 0755 cdda2wav/cdda2mp3.new %{buildroot}%{_bindir}/
install -pm 0755 cdda2wav/inf2cdtext.pl %{buildroot}%{_bindir}/
install -pm 0755 cdda2wav/pitchplay %{buildroot}%{_bindir}/
install -pm 0755 cdda2wav/readmult %{buildroot}%{_bindir}/
install -pm 0755 cdda2wav/tracknames.pl %{buildroot}%{_bindir}/
install -pm 0755 mkisofs/hdisk.pl %{buildroot}%{_bindir}/

# Fix perl path
perl -pi -e 's#/usr/local/bin/perl#/usr/bin/perl#g' %{buildroot}%{_bindir}/tracknames.pl

# Rename in order to not conflict with mkisofs/README in rpm doc section
mv mkisofs/diag/README mkisofs/diag/README.diag

%fdupes -s %{buildroot}%{_mandir}
%fdupes -s %{buildroot}%{_sysconfdir}

%if %with_caps && 0%{?suse_version} >= 1120
%verifyscript -n cdrecord
%{verify_permissions -e %{_bindir}/cdrecord -e %{_bindir}/readcd}

%verifyscript -n cdda2wav
%{verify_permissions -e %{_bindir}/cdda2wav}


%if %with_caps
%post -n cdrecord
%if 0%{?set_permissions:1} > 0
     %set_permissions %{_bindir}/cdrecord %{_bindir}/readcd

%if %with_caps
%post -n cdda2wav
%if 0%{?set_permissions:1} > 0
     %set_permissions %{_bindir}/cdda2wav

%doc ABOUT AN* CDDL.Schily.txt COPYING Changelog Changelog.1 GPL-2.0.txt
%doc LGPL-2.1.txt README.linux-shm READMEs/README.linux

%files -n btcflash
%doc CDDL.Schily.txt COPYING
%doc %{_mandir}/man1/btcflash.1%{ext_man}

%files -n cdda2wav
%doc CDDL.Schily.txt
%doc cdda2wav/Changelog cdda2wav/FAQ cdda2wav/Frontends cdda2wav/HOWTOUSE
%doc cdda2wav/NEEDED cdda2wav/README cdda2wav/THANKS cdda2wav/TODO
%doc cdda2wav/tracknames.txt
%doc libparanoia/README.paranoia
%attr(0755,root,root) %caps_cdda2wav %verify(not mode caps) %{_bindir}/cdda2wav
%doc %{_mandir}/man1/cdda2mp3.1%{ext_man}
%doc %{_mandir}/man1/cdda2ogg.1%{ext_man}
%doc %{_mandir}/man1/cdda2wav.1%{ext_man}
%if %with_caps
%config %_sysconfdir/permissions.d/cdda2wav.*

%files -n cdrecord
%doc CDDL.Schily.txt START
%doc cdrecord/COPYING cdrecord/README cdrecord/README.ATAPI
%doc cdrecord/README.DiskT@2 cdrecord/README.WORM cdrecord/README.audio
%doc cdrecord/README.cdplus cdrecord/README.cdrw cdrecord/README.cdtext
%doc cdrecord/README.clone cdrecord/README.copy cdrecord/README.multi
%doc cdrecord/README.parallel cdrecord/README.raw cdrecord/README.rscsi
%doc cdrecord/README.sony cdrecord/README.verify cdrecord/README.volmgt
%doc rscsi/default-rscsi.sample
%config %{_sysconfdir}/default/cdrecord
%config %{_sysconfdir}/default/rscsi
%if %with_caps
%config %{_sysconfdir}/permissions.d/cdrecord.*
%verify(not mode caps) %caps_cdrecord %attr(0755,root,root) %{_bindir}/cdrecord
%verify(not mode caps) %caps_readcd %attr(0755,root,root) %{_bindir}/readcd
%doc %{_mandir}/man1/cdrecord.1%{ext_man}
%doc %{_mandir}/man1/readcd.1%{ext_man}
%doc %{_mandir}/man1/rscsi.1%{ext_man}
%doc %{_mandir}/man1/scgcheck.1%{ext_man}
%doc %{_mandir}/man1/scgskeleton.1%{ext_man}

%files -n mkisofs
%doc CDDL.Schily.txt GPL-2.0.txt
%doc mkisofs/COPYING mkisofs/ChangeLog mkisofs/ChangeLog.mkhybrid
%doc mkisofs/README mkisofs/README.* mkisofs/RELEASE mkisofs/TODO
%doc mkisofs/diag/README.diag
%doc %{_mandir}/man8/devdump.8%{ext_man}
%doc %{_mandir}/man8/isodebug.8%{ext_man}
%doc %{_mandir}/man8/isodump.8%{ext_man}
%doc %{_mandir}/man8/isoinfo.8%{ext_man}
%doc %{_mandir}/man8/isovfy.8%{ext_man}
%doc %{_mandir}/man8/mkhybrid.8%{ext_man}
%doc %{_mandir}/man8/mkisofs.8%{ext_man}