--- cam-1.05.orig/Makefile +++ cam-1.05/Makefile @@ -11,7 +11,7 @@ INSTALL = install BINDIR = $(PREFIX)/bin MANFILE= cam.1 -MANDIR = $(PREFIX)/man/man1 +MANDIR = $(PREFIX)/share/man/man1 EFILE = cam XEFILE = xcam OBJS = cam.o screens.o sounds.o --- cam-1.05.orig/cam.c +++ cam-1.05/cam.c @@ -27,6 +27,8 @@ #include "cam.h" jmp_buf env; +#include + int main (int argc, char *argv[]) { --- cam-1.05.orig/sounds.c +++ cam-1.05/sounds.c @@ -144,6 +144,27 @@ return 99; } +/* determine default save file name. caller must free the space allocated. */ + +#define DEFAULT_RCFILE "/.camrc" +#define NO_HOME_FILE "/dev/null" + +char * +get_default_filename (void) +{ + char *q, *SAVE_FILE; + q = getenv ("HOME"); + if (q) { + SAVE_FILE = malloc (strlen (q) + strlen(DEFAULT_RCFILE) + 1); + strcpy (SAVE_FILE, q); + strcat (SAVE_FILE, DEFAULT_RCFILE); + } else { + SAVE_FILE = malloc (strlen (NO_HOME_FILE) + 1); + strcpy (SAVE_FILE, NO_HOME_FILE); + } + return SAVE_FILE; +} + /* sets sound given from command line */ void set_sound (int argc, char *argv[]) @@ -151,14 +172,11 @@ int ii, vol_left, vol_right, dummy, pos; int argc_count = 1, arg_code; FILE *save_file; - char *SAVE_FILE, *q; + char *SAVE_FILE; int device; int left, right; - q = getenv ("HOME"); - SAVE_FILE = malloc (strlen (q) + 8); - strcpy (SAVE_FILE, q); - strcat (SAVE_FILE, "/.camrc"); + SAVE_FILE = get_default_filename(); init_sound (); do @@ -483,7 +501,7 @@ int locked = FALSE; FILE *save_file; int dev_nr = 0; - char *SAVE_FILE, *q; + char *SAVE_FILE; int *volume; int X_rest = LPOS; int dev_nrs; @@ -491,10 +509,7 @@ int vol_left, vol_right; int dev_nr_tmp; - q = getenv ("HOME"); - SAVE_FILE = malloc (strlen (q) + 8); - strcpy (SAVE_FILE, q); - strcat (SAVE_FILE, "/.camrc"); + SAVE_FILE = get_default_filename(); init_sound (); init_sliders (); @@ -913,6 +928,11 @@ endwin (); dev_count = 0; longjmp (env, 2); + break; + case 12: + endwin (); + refresh (); + break; } if ((ch != 27) && (ch != 'Q') && (ch != 'q')) { --- cam-1.05.orig/screens.c +++ cam-1.05/screens.c @@ -25,6 +25,7 @@ #include "cam.h" #include +#include extern jmp_buf env; extern int dev_count; @@ -59,7 +60,7 @@ attrset (COLOR_PAIR (COLOR_SCREEN) | A_BOLD); sprintf (dummy, "%*cCAM %s.%s for Linux%*c", left, ' ', VERSION_HIGH, VERSION_LOW, right, ' '); mvaddstr (0, 0, dummy); - sprintf (dummy, " Cpu's Audio Mixer %s.%s%*cauthor : Jan 'TWP' VANDENBERGHE (c)1994-1996 ", VERSION_HIGH, VERSION_LOW, (int)COLS - 20 - 45 - strlen (VERSION_HIGH) - strlen (VERSION_LOW), ' '); + sprintf (dummy, " Cpu's Audio Mixer %s.%s%*cauthor : Jan 'TWP' VANDENBERGHE (c)1994-1996 ", VERSION_HIGH, VERSION_LOW, (int)(COLS - 20 - 45 - strlen (VERSION_HIGH) - strlen (VERSION_LOW)), ' '); mvaddstr (LINES - 1, 0, dummy); attrset (A_NORMAL | A_BOLD); mvaddstr (LINES - 2, 4, "Press 'h' for help"); @@ -228,7 +229,6 @@ void init_screen (void) { - FILE *tf = fopen ("/tmp/cam", "a"); stdscr = initscr (); if ((COLS < 80) || (LINES < 25)) { @@ -236,8 +236,12 @@ fprintf (stderr, "The screensize has to be minimum 80x25\n"); exit (1); } - fprintf (tf, "C=%u,L=%u\n", COLS, LINES); - fclose (tf); + if (COLS > 171) + { + finish (0); + fprintf (stderr, "The screen width has to be maximum 171\n"); + exit (1); + } make_colors (); curs_set (0); } --- cam-1.05.orig/cam.1 +++ cam-1.05/cam.1 @@ -153,7 +153,7 @@ \fI-h, -?, --help\fP displays help .PP -\fBNOTE\fP: x and y are in range from 1 to 20. Higher or lower numbers are +\fBNOTE\fP: x and y are in range from 1 to 100. Higher or lower numbers are ignored. .SH BUGS None known as yet. --- cam-1.05.orig/debian/changelog +++ cam-1.05/debian/changelog @@ -0,0 +1,155 @@ +cam (1.05-8) unstable; urgency=low + + * Removed reference to font for xcam in package description, + because xcam isn't included in the package due to conflict + with sane package (closes: #159416) + * Improved author information in /usr/share/doc/cam/copyright + * Cleaned up compiler warnings in screens.c and main.c + + -- Hamish Moffatt Tue, 12 Apr 2005 00:15:42 +1000 + +cam (1.05-7) unstable; urgency=low + + * Handle $HOME not existing without segfaulting (closes: #164221) + * General cleanup for sarge + + -- Hamish Moffatt Sun, 15 Aug 2004 16:03:53 +1000 + +cam (1.05-6) unstable; urgency=low + + * Added refresh support; just press ^L to refresh the screen + as in standard curses programs (closes: #48958) + + -- Hamish Moffatt Sun, 24 Feb 2002 21:59:43 +1100 + +cam (1.05-5) unstable; urgency=low + + * Added build-deps for libncurses-dev and debhelper (closes: #70189) + + -- Hamish Moffatt Tue, 7 Nov 2000 17:52:55 +1100 + +cam (1.05-4) frozen unstable; urgency=low + + * Fixed minimum screen size message (actually 80x25, not 80x24) + * Added maximum screen width check to work around hard coded + buffer lengths in screen.c draw_slider() function (closes: #57663) + + -- Hamish Moffatt Fri, 11 Feb 2000 21:03:22 +1100 + +cam (1.05-3) unstable; urgency=low + + * Modified menu entry to open a suitable xterm window + when used within X11 (fixes:#45922) + * Now FHS compliant + + -- Hamish Moffatt Mon, 11 Oct 1999 18:09:39 +1000 + +cam (1.05-2) unstable; urgency=low + + * Removed some annoying debugging code (bug#44101) + + -- Hamish Moffatt Fri, 10 Sep 1999 23:15:00 +1000 + +cam (1.05-1) unstable; urgency=low + + * New upstream release (incorporates all of Debian's bug fixes) + * Corrected flaw in the manual page (bug#41896) + + -- Hamish Moffatt Sat, 14 Aug 1999 15:32:00 +1000 + +cam (1.04-1) unstable; urgency=low + + * New upstream release (from a new upstream maintainer) + * Applied patch from the upstream author to allow compilation on + standard kernels (otherwise 2.2.x-ac is needed) + + -- Hamish Moffatt Sun, 27 Jun 1999 00:56:00 +1000 + +cam (1.02-11) frozen; urgency=low + + * Rebuilt to fix the __register_frame_info problem + * Fixed bugs in the manual page (fixes #30249) + + -- Hamish Moffatt Sun, 13 Dec 1998 14:22:00 +1100 + +cam (1.02-10) frozen; urgency=low + + * Rebuilt with libncurses4 + + -- Hamish Moffatt Wed, 04 Nov 1998 10:47:00 +1000 + +cam (1.02-9) unstable; urgency=low + + * Upload with source to include Paul Slootman's fixes + + -- Hamish Moffatt Sat, 10 Oct 1998 10:54:00 +1000 + +cam (1.02-8.1) unstable; urgency=low + + * non-maintainer upload (binary-only) for Alpha + * minor couple of fixes for compiling without warnings + + -- Paul Slootman Mon, 7 Sep 1998 21:23:26 +0200 + +cam (1.02-8) unstable; urgency=low + + * Fixed command line parsing (closes bug#24526); omitting a required + parameter after one of the command switches would cause cam + to segmentation fault + + -- Hamish Moffatt Sun, 16 Aug 1998 00:29:00 +1000 + +cam (1.02-7) unstable; urgency=low + + * Updated old FSF address in copyright file + + -- Hamish Moffatt Wed, 18 Feb 1998 01:39:00 +1100 + +cam (1.02-6) unstable; urgency=low + + * Removed xcam script, because it wasn't very useful, required + non-standard fonts (which it didn't provide), and it conflicts + with the sane package (fixes #16787 against cam and + #16786 against sane) + + -- Hamish Moffatt Fri, 8 Jan 1998 19:16:00 +1100 + +cam (1.02-5) unstable; urgency=low + + * Added symlink to undocumented(7) for xcam(1) + + -- Hamish Moffatt Sun, 28 Dec 1997 12:29:45 +1100 + +cam (1.02-4) unstable; urgency=low + + * Incorrect curses shutdown could cause terminal problems afterwards + on some shells (fixes #16277) + * Changed source package to use debhelper instead of debmake + + -- Hamish Moffatt Fri, 26 Dec 1997 23:48:45 +1100 + +cam (1.02-0bo1) unstable; urgency=low + + * Compiled for libc5 + + -- Hamish Moffatt Sun, 7 Dec 1997 20:00:45 +1100 + +cam (1.02-3) unstable; urgency=low + + * Changed architecture back to any. + + -- Hamish Moffatt Sat, 25 Nov 1997 18:09:45 +1000 + +cam (1.02-2) unstable; urgency=low + + * Changed to policy version 2.3.0.1. + * Changed architecture any to i386. + + -- Hamish Moffatt Sat, 25 Nov 1997 18:09:45 +1000 + +cam (1.02-1) unstable; urgency=low + + * Initial release + + -- Hamish Moffatt Sat, 12 Jul 1997 18:09:45 +1000 + --- cam-1.05.orig/debian/control +++ cam-1.05/debian/control @@ -0,0 +1,13 @@ +Source: cam +Section: sound +Priority: optional +Maintainer: Hamish Moffatt +Standards-Version: 3.6.1 +Build-Depends: debhelper (>= 4), libncurses-dev + +Package: cam +Architecture: any +Depends: ${shlibs:Depends} +Description: Cpu's Audio Mixer for Linux + An audio mixer for Linux, based originally on aumix. + Supports both OSS/Free and OSS/Linux (but not ALSA without emulation). --- cam-1.05.orig/debian/copyright +++ cam-1.05/debian/copyright @@ -0,0 +1,21 @@ +This is the Debian GNU/Linux package of cam. +This package was put together from sources obtained at: + sunsite.unc.edu:/pub/Linux/apps/sound/mixers/cam-1.02.tgz +by Hamish Moffatt + +cam was originally written by jvdbergh@uia.ua.ac.be (Jan VANDENBERGHE) +with later development work by stas@esc.kharkov.com (Stanislav Voronyi). +Copyright 1994-1996 Jan 'TWP' VANDENBERGHE. + +This program is free software; you may 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, or (at your option) +any later version. + +This 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. + +A copy of the GNU General Public License is available as +/usr/share/common-licenses/GPL in the Debian GNU/Linux distribution. --- cam-1.05.orig/debian/rules +++ cam-1.05/debian/rules @@ -0,0 +1,42 @@ +#!/usr/bin/make -f + +build: + dh_testdir + make cam CFLAGS="-O2 -Wall" + touch build + +clean: + dh_testdir + -rm -f build + -make clean_all + -rm -f `find . -name "*~"` + dh_clean + +binary-indep: build +# nothing else to do + +binary-arch: build + dh_clean + dh_installdirs + make install PREFIX=`pwd`/debian/cam/usr + + dh_installdocs README + dh_installmenu + dh_installmanpages + dh_installchangelogs + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_makeshlibs + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch + +checkroot: + dh_testdir + dh_testroot + --- cam-1.05.orig/debian/cam.dirs +++ cam-1.05/debian/cam.dirs @@ -0,0 +1,4 @@ +usr/bin +usr/share/man/man1 +usr/lib/menu +usr/share/doc/cam --- cam-1.05.orig/debian/cam.menu +++ cam-1.05/debian/cam.menu @@ -0,0 +1,8 @@ +?package(cam):needs="X11" section="Apps/Sound" \ + title="cam" longtitle="Cpu's Audio Mixer" \ + description="An audio mixer" \ + command="/usr/bin/X11/xterm -font vga -geometry 80x25 -bg black -fg gray -e /usr/bin/cam" +?package(cam):needs="text" section="Apps/Sound" \ + title="cam" longtitle="Cpu's Audio Mixer" \ + description="An audio mixer" \ + command="/usr/bin/cam" --- cam-1.05.orig/debian/compat +++ cam-1.05/debian/compat @@ -0,0 +1 @@ +4