File cdrtools.spec of Package cdrtools

# spec file for package cdrtools

Name:           cdrtools
Version:        to_be_filled_by_service
%define sversion 3.01
Release:        1
Summary:        Tools for recording CD/DVD/BluRay media

License:        CDDL, GPL, Other License(s), see package
Group:          Productivity/Multimedia/CD/Record
Source1:        cdrecord.easy
Source3:        cdrecord.paranoid
Source100:      cdrtools.rpmlintrc
# Please note: Joerg Schilling (the author) does not like us applying patches to
# his sources. We will try to honor this request if possible.
# -Marcus Meissner <>
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

BuildRequires:  alsa-devel
BuildRequires:  fdupes
BuildRequires:  file-devel
BuildRequires:  gcc-c++
BuildRequires:  libcap-devel
BuildRequires:  libstdc++-devel
Requires:       cdda2wav = %{version}-%{release}
Requires:       cdrecord = %{version}-%{release}
Requires:       mkisofs = %{version}-%{release}
Requires:       permissions
Provides:       schily-cdrtools = %{version}-%{release}
Obsoletes:      schily-cdrtools < %{version}-%{release}
Provides:       cdrkit-cdrtools-compat = %{version}
Obsoletes:      cdrkit-cdrtools-compat < %{version}

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.
This package replaces cdrkit-cdrtools-compat.

%package devel
Summary:        Development files for cdrtools
Group:          Development/Libraries/Other
Requires:       cdrtools = %{version}

%description devel
Cdrtools is a set of command line programs that allows to record CD/DVD/BluRay
This development package contains static libraries and header files.
Build from clean sources without patches.

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

%description -n btcflash
Btcflash is used to read update the Firmware for a BTC DRW1008 DVD+/-RW
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-Audio Grabbing tool
Group:          Productivity/Multimedia/CD/Grabbers
# cdda2wav and icedax have some binaries and man pages with identical names
Provides:      icedax = %{version}
Obsoletes:     icedax < %{version}

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

Build from clean sources without patches.

%package -n cdrecord
Summary:        A CD/DVD/BD recording program
Group:          Productivity/Multimedia/CD/Record
Requires(post): permissions
Provides:       wodim = %{version}
Obsoletes:      wodim < %{version}

%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

Build from clean sources without patches.

%package -n mkisofs
Summary:        A program to generate an ISO-9660/JOLIET/HFS/UDF hybrid filesystem
Group:          Productivity/Multimedia/CD/Record
Requires:       zisofs-tools
# mkisofs and genisoimage have some binaries and man pages with identical names
Provides:       genisoimage = %{version}
Obsoletes:      genisoimage < %{version}

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

Build from clean sources without patches.

%setup -q -n %{name}-%{sversion}

make 'COPTX=-g -finput-charset=ISO-8859-1' LDOPTX=-g %{?_smp_mflags}

make 'INS_BASE=%{_prefix}' 'DESTDIR=%{buildroot}' install

mkdir -p "%{buildroot}%{_sysconfdir}/permissions.d/"
install -pm 0644 \
 '%{S:1}' '%{S:2}' '%{S:3}' '%{buildroot}%{_sysconfdir}/permissions.d/.'

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/ %{buildroot}%{_bindir}/
install -pm 0755 cdda2wav/ %{buildroot}%{_bindir}/
install -pm 0755 cdda2wav/pitchplay %{buildroot}%{_bindir}/
install -pm 0755 cdda2wav/readmult %{buildroot}%{_bindir}/
install -pm 0755 cdda2wav/ %{buildroot}%{_bindir}/
install -pm 0755 mkisofs/ %{buildroot}%{_bindir}/

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

# 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}

rm -Rf -- '%{buildroot}'

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

%post -n cdrecord
%if 0%{?set_permissions:1} > 0
    %{set_permissions cdrecord}

%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 devel
%doc CDDL.Schily.txt COPYING GPL-2.0.txt LGPL-2.1.txt
%dir %{_libdir}/profiled
%doc %{_mandir}/man5/makefiles.5%{ext_man}
%doc %{_mandir}/man5/makerules.5%{ext_man}

%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
%doc %{_mandir}/man1/cdda2mp3.1%{ext_man}
%doc %{_mandir}/man1/cdda2ogg.1%{ext_man}
%doc %{_mandir}/man1/cdda2wav.1%{ext_man}

%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/
%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/ cdrecord/README.verify cdrecord/README.volmgt
%doc rscsi/default-rscsi.sample
%config %{_sysconfdir}/default/cdrecord
%config %{_sysconfdir}/default/rscsi
%config %{_sysconfdir}/permissions.d/cdrecord.*
%if 0%{?suse_version} == 1110
%verify(not mode) %attr(0755,root,root) %{_bindir}/cdrecord
%verify(not mode) %attr(0711,root,root) %{_bindir}/cdrecord
%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}