summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'media-radio')
-rw-r--r--media-radio/unixcw/ChangeLog14
-rw-r--r--media-radio/unixcw/files/unixcw-2.3--as-needed.patch16
-rw-r--r--media-radio/unixcw/files/unixcw-2.3-audio.patch147
-rw-r--r--media-radio/unixcw/files/unixcw-2.3-config.patch114
-rw-r--r--media-radio/unixcw/files/unixcw-2.3-destdir.patch16
-rw-r--r--media-radio/unixcw/files/unixcw-2.3-fPIC.patch60
-rw-r--r--media-radio/unixcw/files/unixcw-2.3-gcc43.patch22
-rw-r--r--media-radio/unixcw/files/unixcw-2.3-ldflags.patch41
-rw-r--r--media-radio/unixcw/files/unixcw-2.3-parallel-make.patch39
-rw-r--r--media-radio/unixcw/metadata.xml20
-rw-r--r--media-radio/unixcw/unixcw-2.3-r6.ebuild73
11 files changed, 562 insertions, 0 deletions
diff --git a/media-radio/unixcw/ChangeLog b/media-radio/unixcw/ChangeLog
new file mode 100644
index 000000000000..bb07df6a4eec
--- /dev/null
+++ b/media-radio/unixcw/ChangeLog
@@ -0,0 +1,14 @@
+# ChangeLog for media-radio/unixcw
+# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/media-radio/unixcw/ChangeLog,v 1.1 2010/09/12 10:07:30 tomjbe Exp $
+
+*unixcw-2.3-r6 (12 Sep 2010)
+
+ 12 Sep 2010; Thomas Beierlein <tomjbe@gentoo.org> +unixcw-2.3-r6.ebuild,
+ +files/unixcw-2.3--as-needed.patch, +files/unixcw-2.3-audio.patch,
+ +files/unixcw-2.3-config.patch, +files/unixcw-2.3-destdir.patch,
+ +files/unixcw-2.3-fPIC.patch, +files/unixcw-2.3-gcc43.patch,
+ +files/unixcw-2.3-ldflags.patch, +files/unixcw-2.3-parallel-make.patch,
+ +metadata.xml:
+ Initial portage version, moved from sunrise. Bug #220027
+
diff --git a/media-radio/unixcw/files/unixcw-2.3--as-needed.patch b/media-radio/unixcw/files/unixcw-2.3--as-needed.patch
new file mode 100644
index 000000000000..ae96329b85e3
--- /dev/null
+++ b/media-radio/unixcw/files/unixcw-2.3--as-needed.patch
@@ -0,0 +1,16 @@
+--- src/cwlib/Makefile.orig 2009-07-21 06:34:13.000000000 +0000
++++ src/cwlib/Makefile 2009-07-21 06:34:39.000000000 +0000
+@@ -43,11 +43,11 @@
+ libcw.so.0.0.0: cwlib.o
+ if [ "$(CC_LINKS_SO)" = "yes" ]; then \
+ $(CC) -shared -Wl,-soname,libcw.so.0 \
+- -o libcw.so.0.0.0 cwlib.o; \
++ -o libcw.so.0.0.0 cwlib.o -lm; \
+ else \
+ if [ "$(LD_LINKS_SO)" = "yes" ]; then \
+ $(LD) -G -Wl,-soname,libcw.so.0 \
+- -o libcw.so.0.0.0 cwlib.o; \
++ -o libcw.so.0.0.0 cwlib.o -lm; \
+ fi \
+ fi
+
diff --git a/media-radio/unixcw/files/unixcw-2.3-audio.patch b/media-radio/unixcw/files/unixcw-2.3-audio.patch
new file mode 100644
index 000000000000..944cd91ccdc6
--- /dev/null
+++ b/media-radio/unixcw/files/unixcw-2.3-audio.patch
@@ -0,0 +1,147 @@
+diff -ur unixcw-2.3.orig/src/cw/cw.c unixcw-2.3/src/cw/cw.c
+--- unixcw-2.3.orig/src/cw/cw.c 2006-06-18 23:58:46.000000000 +0200
++++ unixcw-2.3/src/cw/cw.c 2010-02-03 14:46:58.000000000 +0100
+@@ -922,5 +922,9 @@
+
+ /* Await final tone completion before exiting. */
+ cw_wait_for_tone_queue ();
++
++ /* Reset to ensure that the mixer volume gets restored. */
++ cw_complete_reset();
++
+ return EXIT_SUCCESS;
+ }
+Only in unixcw-2.3/src/cw: cw.o
+Only in unixcw-2.3/src/cwcp: cwcp
+diff -ur unixcw-2.3.orig/src/cwcp/cwcp.c unixcw-2.3/src/cwcp/cwcp.c
+--- unixcw-2.3.orig/src/cwcp/cwcp.c 2006-06-22 05:50:05.000000000 +0200
++++ unixcw-2.3/src/cwcp/cwcp.c 2010-02-03 14:48:31.000000000 +0100
+@@ -1625,6 +1625,9 @@
+ /* Attempt to wrestle the screen back from curses. */
+ interface_destroy ();
+
++ /* Reset to ensure that the mixer volumes gets restored */
++ cw_complete_reset();
++
+ /* Show the signal caught, and exit. */
+ fprintf (stderr, _("\nCaught signal %d, exiting...\n"), signal_number);
+ exit (EXIT_SUCCESS);
+@@ -1685,5 +1688,9 @@
+ /* Clean up and return. */
+ interface_destroy ();
+ cw_wait_for_tone_queue ();
++
++ /* Reset to ensure that the mixer volumes gets restored */
++ cw_complete_reset();
++
+ return EXIT_SUCCESS;
+ }
+diff -ur unixcw-2.3.orig/src/cwlib/cwlib.c unixcw-2.3/src/cwlib/cwlib.c
+--- unixcw-2.3.orig/src/cwlib/cwlib.c 2006-06-23 03:54:01.000000000 +0200
++++ unixcw-2.3/src/cwlib/cwlib.c 2010-02-04 19:36:32.000000000 +0100
+@@ -2138,12 +2138,33 @@
+ {
+ int read_volume, mixer, device_mask;
+
+- /* Try to use the main /dev/audio device for ioctls first. */
+- if (ioctl (cw_sound_descriptor,
+- MIXER_READ (SOUND_MIXER_PCM), &read_volume) == 0)
++ /* Try to use the main /dev/audio device for ioctls first.
++ * Check the available mixer channels for the audio file.
++ */
++ if (ioctl (cw_sound_descriptor, SOUND_MIXER_READ_DEVMASK, &device_mask) != -1)
+ {
+- *volume = read_volume;
+- return RC_SUCCESS;
++ /* Could read device_mask, so check availabel channels */
++ if (device_mask & SOUND_MASK_PCM)
++ /* First try PCM channel, ... */
++ {
++ if (ioctl (cw_sound_descriptor,
++ MIXER_READ (SOUND_MIXER_PCM), &read_volume) == 0)
++ {
++ *volume = read_volume;
++ return RC_SUCCESS;
++ }
++ }
++
++ if (device_mask & SOUND_MASK_VOLUME)
++ /* then master volume */
++ {
++ if (ioctl (cw_sound_descriptor,
++ MIXER_READ (SOUND_MIXER_VOLUME), &read_volume) == 0)
++ {
++ *volume = read_volume;
++ return RC_SUCCESS;
++ }
++ }
+ }
+
+ /* Volume not found; try the mixer PCM channel volume instead. */
+@@ -2215,13 +2236,35 @@
+ cw_set_sound_pcm_volume_internal (int volume)
+ {
+ int mixer, device_mask;
++ /* Try the mixer PCM channel volume instead. */
++ /* Try to use the main /dev/audio device for ioctls first.
++ * Check the available mixer channels for the audio file.
++ */
++ if (ioctl (cw_sound_descriptor, SOUND_MIXER_READ_DEVMASK, &device_mask) != -1)
++ {
++ /* Could read device_mask, so check availabel channels */
++ if (device_mask & SOUND_MASK_PCM)
++ /* First try PCM channel, ... */
++ {
++ if (ioctl (cw_sound_descriptor,
++ MIXER_WRITE (SOUND_MIXER_PCM), &volume) == 0)
++ {
++ return RC_SUCCESS;
++ }
++ }
++
++ if (device_mask & SOUND_MASK_VOLUME)
++ /* then master volume */
++ {
++ if (ioctl (cw_sound_descriptor,
++ MIXER_WRITE (SOUND_MIXER_VOLUME), &volume) == 0)
++ {
++ return RC_SUCCESS;
++ }
++ }
++ }
+
+- /* Try to use the main /dev/audio device for ioctls first. */
+- if (ioctl (cw_sound_descriptor,
+- MIXER_WRITE (SOUND_MIXER_PCM), &volume) == 0)
+- return RC_SUCCESS;
+
+- /* Try the mixer PCM channel volume instead. */
+ mixer = open (cw_mixer_device, O_RDWR | O_NONBLOCK);
+ if (mixer == -1)
+ {
+diff -ur unixcw-2.3.orig/src/xcwcp/application.cc unixcw-2.3/src/xcwcp/application.cc
+--- unixcw-2.3.orig/src/xcwcp/application.cc 2006-06-22 08:22:36.000000000 +0200
++++ unixcw-2.3/src/xcwcp/application.cc 2010-02-09 14:12:24.000000000 +0100
+@@ -498,6 +498,9 @@
+
+ // Done with the CW library sender for now.
+ cwlib_user_application_instance = NULL;
++
++ /* Reset to ensure that the mixer volumes gets restored */
++ cw_complete_reset();
+
+ file_menu_->setItemEnabled (file_start_id_, true);
+ file_menu_->setItemEnabled (file_stop_id_, false);
+diff -ur unixcw-2.3.orig/src/xcwcp/main.cc unixcw-2.3/src/xcwcp/main.cc
+--- unixcw-2.3.orig/src/xcwcp/main.cc 2006-06-18 23:39:34.000000000 +0200
++++ unixcw-2.3/src/xcwcp/main.cc 2010-02-09 14:06:17.000000000 +0100
+@@ -370,6 +370,9 @@
+ void
+ signal_handler (int signal_number)
+ {
++ /* Reset to ensure that the mixer volumes gets restored */
++ cw_complete_reset();
++
+ std::clog << _("Caught signal ") << signal_number
+ << _(", exiting...") << std::endl;
+ exit (EXIT_SUCCESS);
diff --git a/media-radio/unixcw/files/unixcw-2.3-config.patch b/media-radio/unixcw/files/unixcw-2.3-config.patch
new file mode 100644
index 000000000000..81dce4f082c7
--- /dev/null
+++ b/media-radio/unixcw/files/unixcw-2.3-config.patch
@@ -0,0 +1,114 @@
+--- configure.ac.orig 2010-01-27 20:00:28.000000000 +0100
++++ configure.ac 2010-01-27 20:05:41.000000000 +0100
+@@ -46,8 +46,24 @@
+ AC_SUBST(GZIP)
+ AC_SUBST(LDCONFIG)
+
++AC_MSG_CHECKING(--enable-ncurses argument)
++AC_ARG_ENABLE(ncurses,
++ [ --enable-ncurses Include curses based Morse code Tutor],
++ [enable_ncurses=$enableval],
++ [enable_ncurses="no"])
++AC_MSG_RESULT($enable_ncurses)
++
++AC_MSG_CHECKING(--enable-qt4 argument)
++AC_ARG_ENABLE(qt4,
++ [ --enable-qt4 Include QT based Morse code Tutor],
++ [enable_qt=$enableval],
++ [enable_qt="no"])
++AC_MSG_RESULT($enable_qt)
++
++if test "$enable_ncurses" = 'yes'; then
+ # Checks for libraries.
+ AC_CHECK_LIB(curses, initscr)
++fi
+
+ # Checks for header files, and refuse to go on if no KIOCSOUND is available.
+ AC_HEADER_STDC
+@@ -92,49 +108,40 @@
+ # Decide on which subdirectories to build; substitute into SUBDIRS. Build
+ # cwcp if curses is available, and xcwcp if Qt is available.
+ SUBDIRS="cwlib cwutils cw cwgen"
++
++if test "$enable_ncurses" = 'yes'; then
+ # Simple test for curses based on prior library check.
+ if test $ac_cv_lib_curses_initscr = 'yes' ; then
+ SUBDIRS="$SUBDIRS cwcp"
+ else
+ AC_MSG_WARN([Cannot find libcurses - unable to build cwcp])
+ fi
++fi
+
+-# Look for $QTDIR. If found, then look for moc, either on $PATH, or
+-# in $QTDIR/bin.
+-MOC_EARLIEST=3
+-if test -n "$QTDIR" ; then
+- AC_PATH_PROG(QTMOC, moc, , $QTDIR/bin:$PATH)
+- if test -n "$QTMOC" ; then
+- MOC_VERSION="`$QTMOC -v 2>&1 | sed -e 's;.*(Qt ;;' -e 's;).*;;'`"
+- if test -n "$MOC_VERSION" ; then
+- MOC_MAJOR="`echo $MOC_VERSION | sed -e 's;\..*;;'`"
+- expr "$MOC_MAJOR" + 0 >/dev/null 2>/dev/null
+- status=$?
+- if test -n "$MOC_MAJOR" -a $status -eq 0 ; then
+- if test "$MOC_MAJOR" -ge $MOC_EARLIEST ; then
+- SUBDIRS="$SUBDIRS xcwcp"
+- AC_SUBST(QTDIR)
+- AC_SUBST(QTMOC)
+- else
+- AC_MSG_WARN([Found 'moc' $MOC_VERSION - unable to build xcwcp])
+- AC_MSG_WARN([Hint: xcwcp requires 'moc' version >= $MOC_EARLIEST])
+- fi
+- else
+- AC_MSG_WARN([Cannot find 'moc' version - unable to build xcwcp])
+- AC_MSG_WARN([Hint: ensure 'moc' is in QTDIR/bin on your PATH])
+- fi
+- else
+- AC_MSG_WARN([Cannot find 'moc' version - unable to build xcwcp])
+- AC_MSG_WARN([Hint: ensure 'moc' is in QTDIR/bin on your PATH])
+- fi
+- else
+- AC_MSG_WARN([Cannot find 'moc' - unable to build xcwcp])
+- AC_MSG_WARN([Hint: ensure 'moc' is in QTDIR/bin on your PATH])
+- fi
++if test "$enable_qt4" = 'yes'; then
++ dnl Look for Qt4 libs
++ PKG_CHECK_MODULES([QT4], ["QtCore QtGui Qt3Support"], [
++ AC_SUBST(QT4_CFLAGS)
++ AC_SUBST(QT4_LIBS)
++ ], [
++ AC_MSG_ERROR([Qt4 libs not found])
++ ])
++ dnl Look for moc, either on $PATH or in $QTDIR/bin
++ AC_PATH_PROG(QTMOC, moc, , $PATH:$QTDIR/bin)
++ if test -n "$QTMOC" ; then
++ dnl if libs and moc found
++ SUBDIRS="$SUBDIRS xcwcp"
++ AC_DEFINE([WANT_QT4], 1, [Want Qt4])
++ echo "enabling Qt4 support"
++ else
++ AC_MSG_ERROR([Cannot find 'moc'])
++ AC_DEFINE([WANT_QT4], 0, [No Qt4])
++ fi
+ else
+- AC_MSG_WARN([Cannot find libqt - unable to build xcwcp])
+- AC_MSG_WARN([Hint: try setting a value for the QTDIR variable])
++ AC_DEFINE([WANT_QT4], 0, [No Qt4])
++ echo "disabling Qt4 support"
+ fi
++
+ AC_SUBST(SUBDIRS)
+
+ # Add -Wall, -W, -pedantic, and other paranoia to gcc command flags, and -Wall
+--- Makefile.inc.in.orig 2010-01-27 20:11:31.000000000 +0100
++++ Makefile.inc.in 2010-01-27 20:10:28.000000000 +0100
+@@ -37,7 +37,8 @@
+ AC_LD_LINKS_SO = @LD_LINKS_SO@
+ AC_LD = @LD@
+ AC_LN_S = @LN_S@
+-
++AC_QT4_LIBS = @QT4_LIBS@
++AC_QT4_CFLAGS = @QT4_CFLAGS@
+ # Portability values.
+ INSTALL = @INSTALL@
+ INSTALL_PROGRAM = @INSTALL_PROGRAM@
diff --git a/media-radio/unixcw/files/unixcw-2.3-destdir.patch b/media-radio/unixcw/files/unixcw-2.3-destdir.patch
new file mode 100644
index 000000000000..195b66505fe5
--- /dev/null
+++ b/media-radio/unixcw/files/unixcw-2.3-destdir.patch
@@ -0,0 +1,16 @@
+--- Makefile.inc.in.org 2008-05-01 09:49:18.000000000 +0200
++++ Makefile.inc.in 2008-05-01 09:49:40.000000000 +0200
+@@ -42,9 +42,10 @@
+ INSTALL = @INSTALL@
+ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+ INSTALL_DATA = @INSTALL_DATA@
+-prefix = @prefix@
++prefix = $(DESTDIR)@prefix@
+ exec_prefix = @exec_prefix@
+ includedir = @includedir@
+ bindir = @bindir@
+-mandir = @mandir@
++mandir = $(DESTDIR)@mandir@
+-libdir = @libdir@
++libdir = $(DESTDIR)@libdir@
++datarootdir = @datarootdir@
diff --git a/media-radio/unixcw/files/unixcw-2.3-fPIC.patch b/media-radio/unixcw/files/unixcw-2.3-fPIC.patch
new file mode 100644
index 000000000000..67e68bfec590
--- /dev/null
+++ b/media-radio/unixcw/files/unixcw-2.3-fPIC.patch
@@ -0,0 +1,60 @@
+--- configure.ac.orig 2009-09-08 22:27:33.000000000 +0200
++++ configure.ac 2009-09-08 22:28:14.000000000 +0200
+@@ -212,7 +212,7 @@
+ cat >conftest.c <<-EOF
+ int so_test() { return 0; }
+ EOF
+- $CC -c conftest.c >/dev/null 2>/dev/null
++ $CC $CFLAG_PIC -c conftest.c >/dev/null 2>/dev/null
+ $CC -shared -o conftest.so conftest.o >/dev/null 2>/dev/null
+ rm -f conftest.c conftest.o
+ if test -f conftest.so ; then
+@@ -239,7 +239,7 @@
+ cat >conftest.c <<-EOF
+ int so_test() { return 0; }
+ EOF
+- $CC -c conftest.c >/dev/null 2>/dev/null
++ $CC $CFLAG_PIC -c conftest.c >/dev/null 2>/dev/null
+ $LD -G -o conftest.so conftest.o >/dev/null 2>/dev/null
+ rm -f conftest.c conftest.o
+ if test -f conftest.so ; then
+--- src/cwlib/Makefile.orig 2009-09-08 22:53:31.000000000 +0200
++++ src/cwlib/Makefile 2009-09-08 22:59:31.000000000 +0200
+@@ -19,7 +19,8 @@
+
+ include ../../Makefile.inc
+ CC = $(AC_CC)
+-CFLAGS = $(AC_CFLAGS) $(AC_CFLAG_PIC) $(AC_DEFS)
++CFLAGS = $(AC_CFLAGS) $(AC_DEFS)
++CFLAGS_SL = $(AC_CFLAGS) $(AC_CFLAG_PIC) $(AC_DEFS)
+ AWK = $(AC_AWK)
+ RANLIB = $(AC_RANLIB)
+ LD = $(AC_LD)
+@@ -40,14 +41,14 @@
+ rm -f libcw.a; ar -cr libcw.a cwlib.o
+ $(RANLIB) libcw.a
+
+-libcw.so.0.0.0: cwlib.o
++libcw.so.0.0.0: cwlib_sl.o
+ if [ "$(CC_LINKS_SO)" = "yes" ]; then \
+ $(CC) $(LDFLAGS) -shared -Wl,-soname,libcw.so.0 \
+- -o libcw.so.0.0.0 cwlib.o -lm; \
++ -o libcw.so.0.0.0 cwlib_sl.o -lm; \
+ else \
+ if [ "$(LD_LINKS_SO)" = "yes" ]; then \
+ $(LD) $(LDFLAGS) -G -Wl,-soname,libcw.so.0 \
+- -o libcw.so.0.0.0 cwlib.o -lm; \
++ -o libcw.so.0.0.0 cwlib_sl.o -lm; \
+ fi \
+ fi
+
+@@ -78,6 +79,9 @@
+ # Define dependencies related to header/include files.
+ cwlib.o: Makefile cwlib.h
+
++cwlib_sl.o: Makefile cwlib.h
++ $(CC) $(CFLAGS_SL) -c -o cwlib_sl.o cwlib.c
++
+ cwlibtest.o: Makefile cwlib.h
+
+ # Install targets.
diff --git a/media-radio/unixcw/files/unixcw-2.3-gcc43.patch b/media-radio/unixcw/files/unixcw-2.3-gcc43.patch
new file mode 100644
index 000000000000..85c31e08f4e9
--- /dev/null
+++ b/media-radio/unixcw/files/unixcw-2.3-gcc43.patch
@@ -0,0 +1,22 @@
+diff -u src/xcwcp.orig/receiver.cc src/xcwcp/receiver.cc
+--- src/xcwcp.orig/receiver.cc 2010-08-30 19:35:45.000000000 +0200
++++ src/xcwcp/receiver.cc 2010-08-30 19:36:05.000000000 +0200
+@@ -19,6 +19,7 @@
+
+ #include "../config.h"
+
++#include <cstdio>
+ #include <cstdlib>
+ #include <cerrno>
+ #include <string>
+diff -u src/xcwcp.orig/sender.cc src/xcwcp/sender.cc
+--- src/xcwcp.orig/sender.cc 2010-08-30 19:35:45.000000000 +0200
++++ src/xcwcp/sender.cc 2010-08-30 19:36:22.000000000 +0200
+@@ -19,6 +19,7 @@
+
+ #include "../config.h"
+
++#include <cstdio>
+ #include <cstdlib>
+ #include <string>
+ #include <deque>
diff --git a/media-radio/unixcw/files/unixcw-2.3-ldflags.patch b/media-radio/unixcw/files/unixcw-2.3-ldflags.patch
new file mode 100644
index 000000000000..bbd1c7402dbb
--- /dev/null
+++ b/media-radio/unixcw/files/unixcw-2.3-ldflags.patch
@@ -0,0 +1,41 @@
+diff -u -r src.orig/cw/Makefile src/cw/Makefile
+--- src.orig/cw/Makefile 2009-07-21 15:08:34.000000000 +0200
++++ src/cw/Makefile 2009-07-21 15:09:16.000000000 +0200
+@@ -34,7 +34,7 @@
+ cw.o: cw.c ../cwlib/cwlib.h
+
+ cw: cw.o
+- $(CC) -o $@ cw.o ../cwutils/i18n.o ../cwutils/cmdline.o \
++ $(CC) $(LDFLAGS) -o $@ cw.o ../cwutils/i18n.o ../cwutils/cmdline.o \
+ ../cwutils/memory.o $(LIBS) -lm
+
+ # Install targets.
+diff -u -r src.orig/cwgen/Makefile src/cwgen/Makefile
+--- src.orig/cwgen/Makefile 2009-07-21 15:08:34.000000000 +0200
++++ src/cwgen/Makefile 2009-07-21 15:09:34.000000000 +0200
+@@ -32,7 +32,7 @@
+ cwgen.o: cwgen.c
+
+ cwgen: cwgen.o
+- $(CC) -o $@ cwgen.o ../cwutils/i18n.o ../cwutils/cmdline.o \
++ $(CC) $(LDFLAGS) -o $@ cwgen.o ../cwutils/i18n.o ../cwutils/cmdline.o \
+ ../cwutils/memory.o
+
+ # Install targets.
+diff -u -r src.orig/cwlib/Makefile src/cwlib/Makefile
+--- src.orig/cwlib/Makefile 2009-07-21 15:14:58.000000000 +0200
++++ src/cwlib/Makefile 2009-07-21 15:15:25.000000000 +0200
+@@ -42,11 +42,11 @@
+
+ libcw.so.0.0.0: cwlib.o
+ if [ "$(CC_LINKS_SO)" = "yes" ]; then \
+- $(CC) -shared -Wl,-soname,libcw.so.0 \
++ $(CC) $(LDFLAGS) -shared -Wl,-soname,libcw.so.0 \
+ -o libcw.so.0.0.0 cwlib.o -lm; \
+ else \
+ if [ "$(LD_LINKS_SO)" = "yes" ]; then \
+- $(LD) -G -Wl,-soname,libcw.so.0 \
++ $(LD) $(LDFLAGS) -G -Wl,-soname,libcw.so.0 \
+ -o libcw.so.0.0.0 cwlib.o -lm; \
+ fi \
+ fi
diff --git a/media-radio/unixcw/files/unixcw-2.3-parallel-make.patch b/media-radio/unixcw/files/unixcw-2.3-parallel-make.patch
new file mode 100644
index 000000000000..555c85406d58
--- /dev/null
+++ b/media-radio/unixcw/files/unixcw-2.3-parallel-make.patch
@@ -0,0 +1,39 @@
+--- Makefile.orig 2009-07-20 19:35:23.000000000 +0200
++++ Makefile 2009-07-20 19:35:31.000000000 +0200
+@@ -35,11 +35,11 @@
+
+ # Targets that do nothing other than descend.
+ all install install-strip uninstall clean TAGS info dvi check:
+- $(DESCEND)
++ +$(DESCEND)
+
+ # Targets that do just a little more than this.
+ distclean mostlyclean:
+- $(DESCEND)
++ +$(DESCEND)
+ rm -f $(DIST).tar $(DIST).tar.gz $(DIST).tgz
+ rm -f Makefile.inc src/config.h src/config.h.in~
+ rm -f config.status config.cache config.log
+--- src/Makefile.orig 2009-07-20 19:34:45.000000000 +0200
++++ src/Makefile 2009-07-20 19:34:56.000000000 +0200
+@@ -33,7 +33,7 @@
+
+ # All targets do nothing other than descend.
+ all install install-strip uninstall clean TAGS info dvi check:
+- $(DESCEND)
++ +$(DESCEND)
+
+ distclean mostlyclean maintainer-clean:
+- $(DESCEND)
++ +$(DESCEND)
+--- src/cwlib/Makefile.orig 2009-09-08 14:07:37.000000000 +0200
++++ src/cwlib/Makefile 2009-09-08 14:10:05.000000000 +0200
+@@ -65,7 +65,7 @@
+ rm -f signatures functions
+
+ # Build the unit test.
+-cwlibtest: cwlibtest.o
++cwlibtest: cwlibtest.o libcw.a libcw.so.0.0.0
+ $(CC) -o cwlibtest cwlibtest.o -L. -lcw -lm
+
+ # Build the pkgconfig metadata file.
diff --git a/media-radio/unixcw/metadata.xml b/media-radio/unixcw/metadata.xml
new file mode 100644
index 000000000000..07b6d573045a
--- /dev/null
+++ b/media-radio/unixcw/metadata.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>no-herd</herd>
+ <maintainer>
+ <email>tomjbe@gentoo.org</email>
+ <name>Thomas Beierlein</name>
+ </maintainer>
+ <longdescription>unixcw is package of libraries and programs that fit
+ together to form a morse code tutor program. It provides the general
+ purpose 'libcw' library with functions to generate Morse code
+ characters and a frontend program 'cw' to convert text strings to
+ morse code output via soundcard or console speaker. It further provides
+ a set of Morse Code tutor programs (see USE flag description).
+ </longdescription>
+ <use>
+ <flag name='ncurses'>Enables building the curses based morse code tutor
+ program 'cwcp'.</flag>
+ </use>
+</pkgmetadata>
diff --git a/media-radio/unixcw/unixcw-2.3-r6.ebuild b/media-radio/unixcw/unixcw-2.3-r6.ebuild
new file mode 100644
index 000000000000..da094f7347ca
--- /dev/null
+++ b/media-radio/unixcw/unixcw-2.3-r6.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-radio/unixcw/unixcw-2.3-r6.ebuild,v 1.1 2010/09/12 10:07:30 tomjbe Exp $
+
+EAPI=2
+
+inherit autotools eutils multilib
+
+DESCRIPTION="A package of programs that fit together to form a morse code tutor program."
+HOMEPAGE="http://radio.linux.org.au/?sectpat=morse"
+SRC_URI="ftp://metalab.unc.edu/pub/Linux/apps/ham/morse/${P}.tgz
+ qt4? ( mirror://gentoo/unixcw-2.3-qt3to4.patch.gz )"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="ncurses suid qt4"
+
+RDEPEND="ncurses? ( sys-libs/ncurses )
+ qt4? ( x11-libs/qt-gui:4[qt3support] )"
+DEPEND="${RDEPEND}
+ dev-util/pkgconfig"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-destdir.patch \
+ "${FILESDIR}"/${P}-config.patch \
+ "${FILESDIR}"/${P}-parallel-make.patch \
+ "${FILESDIR}"/${P}--as-needed.patch \
+ "${FILESDIR}"/${P}-ldflags.patch \
+ "${FILESDIR}"/${P}-fPIC.patch \
+ "${FILESDIR}"/${P}-audio.patch \
+ "${FILESDIR}"/${P}-gcc43.patch
+ if use qt4 ; then
+ epatch "${DISTDIR}"/${P}-qt3to4.patch.gz
+ fi
+ eautoreconf
+}
+
+src_configure() {
+ econf --libdir=/usr/$(get_libdir) \
+ $(use_enable ncurses) \
+ $(use_enable qt4)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed"
+ dodoc README || die "dodoc failed"
+ if ! use suid ; then
+ fperms 711 /usr/bin/cw || die "fperms failed"
+ if use ncurses ; then
+ fperms 711 /usr/bin/cwcp || die "fperms failed"
+ fi
+ if use qt4 ; then
+ fperms 711 /usr/bin/xcwcp || die "fperms failed"
+ fi
+ fi
+}
+
+pkg_postinst() {
+ if use suid ; then
+ ewarn "You have choosen to install 'cw', 'cwcp' and 'xcwcp' setuid"
+ ewarn "by setting USE=suid."
+ ewarn "Be aware that this is a security risk and not recommended."
+ ewarn ""
+ ewarn "These files do only need root access if you want to use the"
+ ewarn "PC speaker for morse sidetone output. You can alternativly"
+ ewarn "drop USE=suid and use sudo."
+ else
+ elog "Be aware that 'cw', 'cwcp' and 'xcwcp' needs root access if"
+ elog "you want to use the PC speaker for morse sidetone output."
+ elog "You can call the programs via sudo for that (see 'man sudo')."
+ fi
+}