--- setcd-1.5.orig/setcd.1 +++ setcd-1.5/setcd.1 @@ -22,7 +22,8 @@ cdrom device. There are a number of ways you can control the behaviour of your cdrom drive: should it try to close the tray upon mounting a cdrom when your happened to have left the tray open, or -should it eject the tray upon unmounting the cdrom? Should it lock the +should it eject the tray (or caddy) +upon unmounting the cdrom? Should it lock the door when some process uses the cdrom or not? Should the kernel try to ensure that there actually is a cd in the drive, and that it is of the right type (i.e., a data cd in case of a mount, or an audio cd in case @@ -171,13 +172,11 @@ .I 0 is interpreted as auto-selection: data cd's are read at maximum head-rate, while audio cd's are played at normal speed. There are a -few reasons for having the speed to be selectable. Badly pressed -cdroms may benefit from less-than-maximum head rate. Modern cdrom -drives can obtain very high head rates (up to 16 times audio speed is -common), but these drives tend to make an annoyingly loud noise. A -lower speed may reduce this. Finally, although the audio low-pass -filters probably aren't designed for it, more than real-time playback -of audio might be used for high-speed copying of audio tracks. +few reasons for having the speed to be selectable. Badly pressed +cdroms may benefit from less-than-maximum head rate. Modern cdrom +drives can obtain very high head rates, +but these drives tend to make an annoyingly loud noise. A +lower speed may reduce this. .SH HISTORY Traditionally, up to the 2.0 Linux kernel line, the behaviour of the @@ -197,13 +196,13 @@ The new cdrom interface level was actually inspired after writing a volume daemon that automatically mounts a cdrom at the location .RI /cdrom/ volume -upon insertion of the disc. I then found out that there was a need for +upon insertion of the disc. I then found out that there was a need for finding out the status of the drive without trying to read data, and that the uniformity of cdrom drivers was a mess. The volume daemon has not been finished yet, but progress has been made in convincing the Linux cdrom driver community to comply to the proposed standard. -.SH DIGNOSTICS +.SH DIAGNOSTICS Setting or clearing an option will result in a message indicating the new status of that option. Operations not supported by the underlying hardware, e.g., disc selection, will result in an error @@ -261,7 +260,7 @@ .SH AUTHOR .B Setcd -is written by David A. van Leeuwen , the author of +is written by David A. van Leeuwen , the author of the earlier mentioned new cdrom interface and the cm206 cdrom driver. .SH "SEE ALSO" --- setcd-1.5.orig/setcd.c +++ setcd-1.5/setcd.c @@ -1,5 +1,6 @@ /* Setcd.c: Set various flags to control the behaviour of your cdrom device. (c) 1997 David A. van Leeuwen + (c) 2004 Thomas Fritzsche $Id: setcd.c,v 1.4 1999/08/24 19:07:34 david Exp $ @@ -23,8 +24,9 @@ #include #include /* tolower */ #include /* lseek, read */ -#include /* strncmp */ +#include /* strncmp, memset */ #include /* ioctl */ +#include /* INT_MAX */ #include #ifndef CDC_CLOSE_TRAY /* moved into cdrom.h... */ #include @@ -248,7 +250,50 @@ if (set || clear || status) print_options(flags, set | clear | ~0 * status); if (speed>=0) { - if (ioctl(fd, CDROM_SELECT_SPEED, speed)<0) { + // patch to use SET STREAMING command + struct cdrom_generic_command cgc; + struct request_sense sense; + unsigned char buffer[28]; + unsigned long rw_size; + memset(&cgc, 0, sizeof(cgc)); + memset(&sense, 0, sizeof(sense)); + memset(&buffer, 0, sizeof(buffer)); + /* SET STREAMING command */ + cgc.cmd[0] = 0xb6; + /* 28 byte parameter list length */ + cgc.cmd[10] = 28; + cgc.sense = &sense; + cgc.buffer = buffer; + cgc.buflen = sizeof(buffer); + cgc.data_direction = CGC_DATA_WRITE; + cgc.quiet = 1; + if(speed == 0) { + /* set Restore Drive Defaults */ + buffer[0] = 4; + } + buffer[8] = 0xff; + buffer[9] = 0xff; + buffer[10] = 0xff; + buffer[11] = 0xff; + rw_size = 177 * speed; + /* read size */ + buffer[12] = (rw_size >> 24) & 0xff; + buffer[13] = (rw_size >> 16) & 0xff; + buffer[14] = (rw_size >> 8) & 0xff; + buffer[15] = rw_size & 0xff; + /* read time 1 sec. */ + buffer[18] = 0x03; + buffer[19] = 0xE8; + /* write size */ + buffer[20] = (rw_size >> 24) & 0xff; + buffer[21] = (rw_size >> 16) & 0xff; + buffer[22] = (rw_size >> 8) & 0xff; + buffer[23] = rw_size & 0xff; + /* write time 1 sec. */ + buffer[26] = 0x03; + buffer[27] = 0xE8; + if ((ioctl(fd, CDROM_SEND_PACKET, &cgc) != 0) + && (ioctl(fd, CDROM_SELECT_SPEED, speed) < 0)) { perror("can't set speed"); exit(-6); } else { --- setcd-1.5.orig/debian/dirs +++ setcd-1.5/debian/dirs @@ -0,0 +1,3 @@ +usr/bin +usr/share/doc/setcd +usr/share/man/man1 --- setcd-1.5.orig/debian/control +++ setcd-1.5/debian/control @@ -0,0 +1,22 @@ +Source: setcd +Section: utils +Priority: optional +Maintainer: LENART Janos +Build-Depends: debhelper (>= 5) +Standards-Version: 3.8.1 + +Package: setcd +Architecture: any +Depends: ${shlibs:Depends} +Description: Control the behaviour of your cdrom device + This program allows you to control the behaviour of your Linux cdrom + player. + . + You can control: auto close, auto eject, medium type checking and + tray/caddy locking. You can get information on the volume name of CD-ROMs + and other data, and you can set the speed of your drive and choose a + disc from a jukebox. + . + The source of this package may be an example for cdrom player program + developers that wish to exploit the features of the Linux cdrom + interface. --- setcd-1.5.orig/debian/compat +++ setcd-1.5/debian/compat @@ -0,0 +1 @@ +5 --- setcd-1.5.orig/debian/rules +++ setcd-1.5/debian/rules @@ -0,0 +1,50 @@ +#!/usr/bin/make -f + +# Uncomment this to compile with gcc-snapshot. +#export CC=/usr/lib/gcc-snapshot/bin/gcc +#export CXX=/usr/lib/gcc-snapshot/bin/g++ +#export CPP=/usr/lib/gcc-snapshot/bin/cpp + +package=setcd + +build: build-stamp +build-stamp: + dh_testdir + $(MAKE) CFLAGS=-O2 setcd + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp + $(MAKE) distclean + rm -rf *~ debian/setcd debian/*~ debian/files* + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + +binary-indep: build install + +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_install setcd /usr/bin/ + dh_installman setcd.1 + dh_link + dh_strip + dh_compress + dh_fixperms + dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-arch binary-arch +.PHONY: build clean binary-indep binary-arch binary install --- setcd-1.5.orig/debian/copyright +++ setcd-1.5/debian/copyright @@ -0,0 +1,26 @@ +Setcd. Set various flags to control the behaviour of your Linux cdrom device. +Copyright (c) 1997--2003 David A. van Leeuwen + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + USA + +You should have a copy of the GPL somewhere on your Linux system. On +Debian GNU/Linux you can find it in /usr/share/common-licenses/GPL. + +---David van Leeuwen + +This program is packaged by David van Leeuwen . + +Sources may be found at http://www.elseware.nl/linux/setcd/ . --- setcd-1.5.orig/debian/changelog +++ setcd-1.5/debian/changelog @@ -0,0 +1,150 @@ +setcd (1.5-6) unstable; urgency=low + + * Adopting the package. (closes: #406134) + * Now using the SET STREAMING command too. (closes: #367008) + + Code from: Thomas Fritzsche + + Patch from: Alexander Gattin + * Fixing some minor lintian warnings. + + -- LENART Janos Tue, 14 Apr 2009 07:10:24 +0200 + +setcd (1.5-5) unstable; urgency=low + + * QA upload. + * setcd.c: Include the header which defines the used INT_MAX + macro. This fixes a FTBFS with GCC 4.3. Thanks to Martin Michlmayr for the + bug report. (closes: #455321) + * Bumped Standards-Version from 3.7.2 to 3.7.3, no changes required. + * Updated debhelper compatibility level to V5, which is the current + recommended level and raised the build dependency to "debhelper (>= 5)". + * Renamed Build-depends to Build-Depends in debian/control. + + -- Frank S. Thomas Sat, 15 Dec 2007 10:12:54 +0100 + +setcd (1.5-4) unstable; urgency=low + + * QA upload. + * Set maintainer to QA Group; Orphaned: #406134 + * Remove substvars from .diff.gz + * Update debian/copyright + * Conforms with latest Standards Version 3.7.2 + + -- Michael Ablassmeier Mon, 22 Jan 2007 10:06:04 +0100 + +setcd (1.5-3) unstable; urgency=low + + * Changed name in control to match changelog name. Closes bugs marked + as NMU, but were in fact done by me me. Closes: #213514, #105190, #127325, + #190525, #125348, #170788 + * Refer to caddies as well as trays. (closes: #234337) + * Made description less irritating. (closes: #234334) + * Updated the manpage a bit. (closes: #234336) + + -- David A. van Leeuwen Sun, 29 Aug 2004 23:05:16 +0200 + +setcd (1.5-2) unstable; urgency=low + + * Changed section to utils, according to override file. + * Added debhelper explicitly in build-depends (sorry, i assumed it was a + standard build package). Closes: #213514 + + -- David A. van Leeuwen Wed, 1 Oct 2003 15:26:41 +0200 + +setcd (1.5-1) unstable; urgency=low + + * New upstream release. Should fix `debian-native upload' problem. No + actual changes in source code. Only in copyright, changelog. + * Up to standards-version 3.6.1. + * Changed over from debmake to debhelper. + * Chaged `debian/dirs' according to FSSTND + * Changed copyright file to include name of maintainer and source + location. (Closes: #170788) + * Appreciate great work of NMU workers! Hopefully really (Closes: + #127325, #190525, #125348) + * Inspected buildd logs of previous version, that actually seems OK, for + every arch other than Hurd (it is a linux-specific package---i wrote + the linux cdrom `uniform' driver myself!). So I'm going to close the + following bug. (Closes: #105190) + + -- David A. van Leeuwen Sun, 28 Sep 2003 22:10:12 +0200 + +setcd (1.4-2.1) unstable; urgency=low + + * NMU. + * Add Build-Depends on debmake. Closes: #190525. + * Fix capitalization and double word in description. + Closes: #125348, #127325. + + -- Daniel Schepler Tue, 19 Aug 2003 04:51:40 -0700 + +setcd (1.4-2) unstable; urgency=low + + * Remove empty postinst and prerm, solving bug#32761 + + -- David A. van Leeuwen Tue, 8 Feb 2000 22:59:03 +0100 + +setcd (1.4-1) unstable; urgency=low + + * Source changed, in order to fix Bug#43304, as suggested by Andreas + Degert + + -- David A. van Leeuwen Tue, 24 Aug 1999 21:24:27 +0200 + +setcd (1.3-3) unstable; urgency=low + + * Added #ifdef for CDS_MIXED, a 2.1.n define. Should help to build on + other architectures. + + -- David A. van Leeuwen Wed, 25 Nov 1998 23:02:04 +0100 + +setcd (1.3-2) unstable; urgency=low + + * Removed cdrom-standard.ps from doc, is found in kernel-doc-, + fixing arch / build dependency (Bug#29898). Included debstd in + debian/rules as well. + + -- David A. van Leeuwen Tue, 24 Nov 1998 21:51:31 +0100 + +setcd (1.3-1) unstable frozen; urgency=low + + * New `upstream' version + + -- David A. van Leeuwen Mon, 16 Nov 1998 23:30:22 +0100 + +setcd (1.2-3) unstable frozen; urgency=low + + * Implemented dpkg-shlibdeps instead of static dependency on libc, for + Bug#26793. + + -- David A. van Leeuwen Mon, 16 Nov 1998 23:14:53 +0100 + +setcd (1.2-2) unstable; urgency=low + + * Changed dependency in debian/control on libc6, solves bug#15591. + + -- David A. van Leeuwen Sat, 6 Dec 1997 09:06:23 +0100 + +setcd (1.2-1) unstable; urgency=low + + * Changed to upstream revision 1.2. + * Changed to libc6. + * Updated cdrom-standard.ps to most recent version. + + -- David A. van Leeuwen Wed, 19 Nov 1997 23:05:00 +0100 + +setcd (1.1-2) unstable; urgency=low + + * Made architecture `any' instead of `i386', solves bug 13693. I wish + there was a simple debian packaging HOWTO... + + * Added dependency on libc5, 5.4.33, which includes the new cdrom + error messages. + + -- David A. van Leeuwen Sat, 11 Oct 1997 12:17:15 +0200 + +setcd (1.1-1) unstable; urgency=low + + * This package is developed with Debian for Debian. Maybe we can + substract ordinary .tar.gz packages for inferior distributions. + + -- David van Leeuwen Sat, 22 Feb 1997 21:59:52 +0100 --- setcd-1.5.orig/debian/setcd.debhelper.log +++ setcd-1.5/debian/setcd.debhelper.log @@ -0,0 +1,120 @@ +dh_installdirs +dh_installchangelogs +dh_installdocs +dh_install +dh_installman +dh_link +dh_strip +dh_compress +dh_fixperms +dh_makeshlibs +dh_installdeb +dh_shlibdeps +dh_gencontrol +dh_md5sums +dh_builddeb +dh_installdirs +dh_installchangelogs +dh_installdocs +dh_install +dh_installman +dh_link +dh_strip +dh_compress +dh_fixperms +dh_makeshlibs +dh_installdeb +dh_shlibdeps +dh_gencontrol +dh_md5sums +dh_builddeb +dh_installdirs +dh_installchangelogs +dh_installdocs +dh_install +dh_installman +dh_link +dh_strip +dh_compress +dh_fixperms +dh_makeshlibs +dh_installdeb +dh_shlibdeps +dh_gencontrol +dh_md5sums +dh_builddeb +dh_installdirs +dh_installchangelogs +dh_installdocs +dh_install +dh_installman +dh_link +dh_strip +dh_compress +dh_fixperms +dh_makeshlibs +dh_installdeb +dh_shlibdeps +dh_gencontrol +dh_md5sums +dh_builddeb +dh_installdirs +dh_installchangelogs +dh_installdocs +dh_install +dh_installman +dh_link +dh_strip +dh_compress +dh_fixperms +dh_makeshlibs +dh_installdeb +dh_shlibdeps +dh_gencontrol +dh_md5sums +dh_builddeb +dh_installdirs +dh_installchangelogs +dh_installdocs +dh_install +dh_installman +dh_link +dh_strip +dh_compress +dh_fixperms +dh_makeshlibs +dh_installdeb +dh_shlibdeps +dh_gencontrol +dh_md5sums +dh_builddeb +dh_installdirs +dh_installchangelogs +dh_installdocs +dh_install +dh_installman +dh_link +dh_strip +dh_compress +dh_fixperms +dh_makeshlibs +dh_installdeb +dh_shlibdeps +dh_gencontrol +dh_md5sums +dh_builddeb +dh_installdirs +dh_installchangelogs +dh_installdocs +dh_install +dh_installman +dh_link +dh_strip +dh_compress +dh_fixperms +dh_makeshlibs +dh_installdeb +dh_shlibdeps +dh_gencontrol +dh_md5sums +dh_builddeb --- setcd-1.5.orig/debian/setcd.substvars +++ setcd-1.5/debian/setcd.substvars @@ -0,0 +1 @@ +shlibs:Depends=libc6 (>= 2.7-1)