> > > + [ %{buildroot} == / ] || rm -rf %{buildroot}/usr/man
> >
> > This is basically redundant
>
> It's actually wrong. The idea is to build the package into an empty
> directory.
There is '[ %{buildroot} == / ] || rm -rf %{buildroot}' few lines up,
isn't there? The idea behind the extra rm suggested by Ron Grant was to
get rid of %{buildroot}/usr/man/man1/growisofs.1 installed at 'make
prefix=%{buildroot}%{_prefix} install' moment, which is not actually
necessary.
> ... a test for usr/share/man is not a totally clean thing,
> you'd have to check this in %{prefix},
That's exactly what I checked for, as it is %{prefix} that is passed
down. In either case I've arranged for another argument to be passed by
rpm down to make install, manprefix to be specific. Now(*) RPM builders
will get manual page installed whereever corresponding %{_mandir} points
to, while those who appreciate old Unix traditions - in
/usr/local/man:-)
(*) "Now" means that drop-in dvd+rw-tools.spec and Makefile.m4
replacements are attached to this letter for those who wish to build an
RPM package.
Cheers. A.
Summary: Toolchain for mastering recordable DVD media
Name: dvd+rw-tools
Version: 5.12.4.7.4
Release: 2
License: GPL
Group: Applications/Multimedia
Source:
http://fy.chalmers.se/~appro/linux/DVD+RW/tools/dvd+rw-tools-%{version}.tar.gz
URL: http://fy.chalmers.se/~appro/linux/DVD+RW/
Requires: mkisofs >= 1.10
BuildRoot: %{_tmppath}/%{name}-root
BuildRequires: kernel-headers wget
%description
Collection of tools to master DVD+RW/+R/-R/-RW media. For further
information see http://fy.chalmers.se/~appro/linux/DVD+RW/.
%prep
%setup -q
%build
make
[ -f index.html ] || wget -nd http://fy.chalmers.se/~appro/linux/DVD+RW/
%install
[ %{buildroot} == / ] || rm -rf %{buildroot}
cd %{_builddir}/%{name}-%{version}
make prefix=%{buildroot}%{_prefix} manprefix=%{buildroot}%{_mandir} install
mkdir -p %{buildroot}%{_docdir}/%{name}-%{version}-%{release}
cp -a index.html %{buildroot}%{_docdir}/%{name}-%{version}-%{release}
%clean
[ %{buildroot} == / ] || rm -rf %{buildroot}
%files
%defattr(-,root,root)
%{_prefix}/bin/*
%doc %{_docdir}/%{name}-%{version}-%{release}
%doc %{_mandir}/man1/*
%changelog
* Sat Sep 6 2003 Andy Polyakov <[EMAIL PROTECTED]>
- RPM build fix-ups, no version change;
* Fri Aug 31 2003 Andy Polyakov <[EMAIL PROTECTED]>
- growisofs 5.12: [major] issue with MODE SENSE/SELECT on SANYO
derivatives, such as Optorite, is addressed;
- Linux can't open(2) a socket by /dev/fd/N, replace it with dup(2);
- more relaxed command line option parsing and simultaneously a
zealous check to make sure that no mkisofs options are passed
along with -[ZM] /dev/cdrom=image;
- report I/O error if input stream was less than 64K;
- -M /dev/cdrom=/dev/zero didn't relocate the lead-out in DVD-RW
Restricted Overwrite;
* Fri Aug 15 2003 Andy Polyakov <[EMAIL PROTECTED]>
- single Pioneer DVR-x06 user reported that very small fraction of
his recordings get terminted with "LONG WRITE IN PROGRESS," even
though growisofs explicitly reserves for this condition... It
turned out that at those rare occasions unit reported a lot of free
buffer space, which growisofs treated as error condition. It's not
clear if it's firmware deficiency, but growisofs reserves even for
this apparently rare condition now.
- dvd+rw-format 4.7: when formatting DVD+RW, Pioneer DVR-x06 remained
unaccessible for over 2 minutes after dvd+rw-format exited and user
was frustrated to poll the unit himself, now dvd+rw-format does it for
user;
* Sun Aug 3 2003 Andy Polyakov <[EMAIL PROTECTED]>
- growisofs 5.11: authorship statement in -version output;
- make speed_factor floating point and print "Current Write Speed"
factor for informational purposes;
- Pioneer DVR-x06 exhibited degraded performance when recording DVD+;
- Pioneer DVR-x06 failed to complete DVD+ recording gracefully;
- alter set-root-uid behaviour under Linux from "PAM-junky" to more
conservative one;
- dvd+rw-format 4.6: -force to ignore error from READ DISC INFORMATION;
- -force was failing under FreeBSD with 'unable to unmount';
- undocumented -gui flag to ease progress indicator parsing for
GUI front-ends;
* Fri Jul 14 2003 Andy Polyakov <[EMAIL PROTECTED]>
- dvd+rw-format 4.5: increase timeout for OPC, NEC multi-format
derivatives might require more time to fulfill the OPC procedure;
- growisofs 5.10: increase timeout for OPC, NEC multi-format
derivatives might require more time to fulfill the OPC procedure;
- extended syntax for -use-the-force-luke option, it's now possible
to engage DVD-R[W] dummy mode by -use-the-force-luke=[tty,]dummy
for example, where "tty" substitutes for the original non-extended
option meaning, see the source for more easter eggs;
- FreeBSD: compile-time option to pass -M /dev/fd/0 to mkisofs to
make life easier for those who mount devfs, but not fdescfs;
- eliminate potential race conditions;
- avoid end-less loop if no media was in upon tray load;
- interpret value of MKISOFS environment variable as absolute path
to mkisofs binary;
- to facilitate for GUI front-ends return different exit codes, most
notably exit value of 128|errno denotes a fatal error upon program
startup [messages worth popping up in a separate modal dialog
perhaps?], errno - fatal error during recording and 1 - warnings
at exit;
- to facilitate for GUI front-ends auto-format blank DVD+RW media;
- Linux: fix for failure to copy volume descriptors when DVD-RW
Restricted Overwrite procedure is applied to patched kernel;
- FreeBSD: growisofs didn't close tray upon startup nor did the rest
of the tools work with open tray;
- bark at -o option and terminate execution, the "problem" was that
users seem to misspell -overburn once in a while, in which case it
was passed down to mkisofs and an iso-image was dumped to current
working directory instead of media;
- generalize -M /dev/cdrom=file.iso option, but if file.iso is not
/dev/zero, insist on sane -C argument to be passed prior -M and
double-verify the track starting address;
* Tue Jun 20 2003 Andy Polyakov <[EMAIL PROTECTED]>
- growisofs 5.9: some [SONY] firmwares make it impossible to tell
apart minimally and fully blanked media, so we need a way to engage
DAO manually [in DVD-RW]... let's treat multiple -dvd-compat options
as "cry" for DAO;
- refuse to finalize even DVD-R media with -M flag (advise to fill
it up with -M /dev/cdrom=/dev/zero too), apparently DVD-units
[or is it just SONY?] also "misplace" legacy lead-out in the same
manner as DVD+units;
- oops! DAO hung at >4MB buffer because of sign overflow;
- couple of human-readable error messages in poor_mans_pwrite64;
- work around Plextor firmware deficiency which [also] manifests as
end-less loop upon startup;
* Wed Jun 14 2003 Andy Polyakov <[EMAIL PROTECTED]>
- growisofs 5.8: elder Ricoh firmwares seem to report events
differently, which triggered growisofs and dvd+rw-format to
end-less loop at startup [event handling was introduced in 5.6
for debugging purposes];
- int ioctl_fd is transformed to void *ioctl_handle to facilitate
port to FreeBSD;
- FreeBSD support contributed by Matthew Dillon;
- volume descriptors from second session were discarded in
Restricted Overwrite since 5.6;
* Sun Jun 8 2003 Andy Polyakov <[EMAIL PROTECTED]>
- growisofs 5.7: Solaris 2.x USB workaround;
- 15 min timeout for FLUSH CACHE in DVD-RW DAO;
- revalidate recording speed;
- load media upon start-up (Linux used to auto-close tray upon open,
but not the others, which is why this functionality is added so
late);
- dvd+rw-mediainfo: DVD-R[W] MediaID should be printed now;
* Sat May 31 2003 Andy Polyakov <[EMAIL PROTECTED]>
- Solaris support is merged;
* Mon May 26 2003 Andy Polyakov <[EMAIL PROTECTED]>
- growisofs 5.6: unconditional exit in set-root-uid assistant, mostly
for aesthetic reasons;
- support for DVD-RW DAO recordings (whenever Pioneer-ish Quick
Format is not an option, DAO should fill in for it, as it's the
only recording strategy applicable after *minimal* blanking
procedure);
- support for SG_IO pass-through interface, or in other words
support for Linux 2>=5;
- 'growisofs -M /dev/cdrom=/dev/zero', this is basically a counter-
intuitive kludge assigned to fill up multi-session write-once
media for better compatibility with DVD-ROM/-Video units, to keep
it mountable [in the burner unit] volume descriptors from previous
session are copied to the new session;
- disable -dvd-compat with -M option and DVD+R, advice to fill up
the media as above instead;
- postpone Write Page setup all the way till after dry_run check;
- if recording to write-once media is terminated by external event,
leave the session opened, so that the recording can be resumed
(though no promises about final results are made, it's just that
leaving it open makes more sense than to close the session);
- ask unit to perform OPC if READ DISC INFORMATION doesn't return
any OPC descriptors;
- get rid of redundant Quick Grow in Restricted Overwrite;
- dvd+rw-formwat 4.4: support for -force=full in DVD-RW context;
- ask unit to perform OPC if READ DISC INFORMATION doesn't return
any OPC descriptors;
- new dvd+rw-mediainfo utility for debugging purposes;
* Thu May 1 2003 Andy Polyakov <[EMAIL PROTECTED]>
- growisofs 5.5: fix for ENOENT at unmount, I should have called myself
with execlp, not execl;
- security: chdir to / in set-root-uid assistant;
- use /proc/mounts instead of MOUNTED (a.k.a. /etc/mtab) in Linux
umount code;
- changed to 'all' target in Makefile to keep NetBSD people happy;
* Sun Apr 20 2003 Andy Polyakov <[EMAIL PROTECTED]>
- growisofs 5.4: setup_fds is introduced to assist ports to another
platforms;
- set-root-uid assistant code directly at entry point (see main());
- OpenBSD/NetBSD port added;
* Thu Mar 27 2003 Andy Polyakov <[EMAIL PROTECTED]>
- growisofs 5.4: split first write to avoid "empty DMA table?" in
kernel log;
- dvd+rw-format 4.3: natural command-line restrictions;
* Thu Mar 20 2003 Andy Polyakov <[EMAIL PROTECTED]>
- growisofs 5.3: refuse to burn if session starts close to or beyond
the 4GB limit (due to limitation of Linux isofs implementation).
- media reload is moved to growisofs from dvd+rw-format.
- dry_run check is postponed all the way till the first write.
* Sat Mar 15 2003 Andy Polyakov <[EMAIL PROTECTED]>
- growisofs 5.3/dvd+rw-format 4.2: support for DVD-RW Quick Format,
upon release tested with Pioneer DVR-x05.
- bug in DVD+RW overburn protection code fixed.
* Thu Feb 27 2003 Andy Polyakov <[EMAIL PROTECTED]>
- growisofs 5.2: brown-bag bug in "LONG WRITE IN PROGRESS" handling
code fixed.
* Mon Feb 1 2003 Andy Polyakov <[EMAIL PROTECTED]>
- code to protect against overburns.
- progress indicator to display recording velocity.
- re-make it work under Linux 2.2 kernel.
* Tue Jan 14 2003 Andy Polyakov <[EMAIL PROTECTED]>
- growisofs 5.1: support for DVD-R[W] writing speed control.
- dvd+rw-booktype 4: see the source.
* Tue Nov 26 2002 Andy Polyakov <[EMAIL PROTECTED]>
- growisofs 5.0: support for DVD-R[W].
- dvd+rw-format 4.0: support for DVD-RW.
- growisofs 4.2: workaround for broken DVD+R firmwares (didn't make
public by itself).
* Thu Nov 4 2002 Andy Polyakov <[EMAIL PROTECTED]>
- Minor growisofs update. Uninitialized errno at exit when
-Z /dev/scd0=image.iso is used.
* Thu Nov 3 2002 Andy Polyakov <[EMAIL PROTECTED]>
- Initial packaging. Package version is derived from growisofs,
dvd+rw-format and dvd+rw-booktype version. 4.0.3.0.3 means
growisofs 4.0, dvd+rw-format 3.0 dvd+rw-booktype 3.
# OBS! M4 processed!
`
CHAIN=growisofs dvd+rw-format dvd+rw-booktype dvd+rw-mediainfo
dvd+rw-tools: $(CHAIN)
WARN=#-Wall # developers are welcomed to build with `make WARN=-Wall'
'
ifelse(OS,NetBSD,`define(`OS',`BSD')')
ifelse(OS,OpenBSD,`define(`OS',`BSD')')
ifelse(OS,FreeBSD,`define(`OS',`BSD')LDLIBS=-lcam')
ifelse(OS,BSD,`
#
# OpenBSD/NetBSD/FreeBSD section
#
CC ?=gcc
CFLAGS +=$(WARN) -O2
CXX ?=g++
CXXFLAGS+=$(WARN) -O2 -fno-exceptions
.SUFFIXES: .c .cpp .o
.c.o:
$(CC) $(CFLAGS) -c -o $@ $<
.cpp.o:
$(CXX) $(CXXFLAGS) -c -o $@ $<
.o: # try to please both BSD vv&vv GNU make at the same time...
$(CXX) $(CXXFLAGS) -o $@ $> $^ $(LDFLAGS) $(LDLIBS)
# yes, default is set-root-uid, `make BIN_MODE=0755 install' to override...
BIN_MODE?=04755
install: dvd+rw-tools
install -o root -m $(BIN_MODE) $(CHAIN) /usr/local/bin
install -o root -m 0644 growisofs.1 /usr/local/man/man1
')
ifelse(OS,SunOS,`
#
# Solaris section
#
.SUFFIXES: .c .cpp .o
# check for WorkShop C++
syscmd(`(CC -flags) > /dev/null 2>&1')
ifelse(sysval,0,`
CC =cc
CFLAGS =-O -xstrconst -w
CXX =CC
CXXFLAGS=-O -features=no%except,conststrings -w
',`
CC =gcc
CFLAGS =$(WARN) -02
GXX =g++
CXXFLAGS=$(WARN) -O2 -fno-exceptions
')
LDLIBS=-lvolmgt
.c.o:
$(CC) $(CFLAGS) -c -o $@ $<
.cpp.o:
$(CXX) $(CXXFLAGS) -c -o $@ $<
%: %.o
$(CXX) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS)
install: dvd+rw-tools
install -o root -m 04755 $(CHAIN) /usr/local/bin
install -o root -m 0644 growisofs.1 /usr/local/man/man1
')
changequote([, ])
ifelse(OS,Linux,[
#
# Linux section
#
CC =gcc
CFLAGS +=$(WARN) -O2
CXX =g++
CXXFLAGS+=$(WARN) -O2 -fno-exceptions
LINK.o=$(LINK.cc)
prefix?=/usr/local
manprefix?=$(shell case $(prefix) in (*/usr/?*) echo $(prefix)/man ;; (*) echo
$(prefix)/share/man ;; esac)
bin_mode?=0755 # yes, default is *no* set-uid
minus_o:=$(shell [[ `id -u` == 0 ]] && echo "-o root")
install: dvd+rw-tools
[[ -d $(prefix)/bin ]] || mkdir -p $(prefix)/bin
install $(minus_o) -m $(bin_mode) $(CHAIN) $(prefix)/bin
[[ -d $(manprefix)/man1 ]] || mkdir -p $(manprefix)/man1
install $(minus_o) -m 0644 growisofs.1 $(manprefix)/man1
])
# common section
[
growisofs: growisofs_mmc.o growisofs.o
growisofs.o: growisofs.c
growisofs_mmc.o: growisofs_mmc.cpp transport.hxx
dvd+rw-format: dvd+rw-format.o
dvd+rw-format.o: dvd+rw-format.cpp transport.hxx
dvd+rw-mediainfo: dvd+rw-mediainfo.o
dvd+rw-mediainfo.o: dvd+rw-mediainfo.cpp transport.hxx
dvd+rw-booktype: dvd+rw-booktype.o
dvd+rw-booktype.o: dvd+rw-booktype.cpp transport.hxx
rpl8: rpl8.o
rpl8.o: rpl8.cpp transport.hxx
+rpl8: rpl8
#so that I can invoke `make +rpl8' to build rpl8...
]