add media-radio/hamfax

This commit is contained in:
Florian Tham
2017-07-18 15:09:12 +02:00
parent 2146ca4629
commit 107e7da0b9
3 changed files with 91 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
AUX fix_broken_logging.patch 969 SHA256 b8e8661ae5debc49d5ac86fa9a6e1f64ca4a2dd72010ebb715a651bf635e6748 SHA512 a210c1d12a848c21f78974a57eb545a13b3271b343f74474263d6a0df7809a017c5479959c555e844b7a658fa351d24504621d74edb8d75302d734bebf4601aa WHIRLPOOL 2fb3e5e916a7f335905ac260a7a06113c2d657e48e67bd5fe08418fe9c24752aae99627fb3df8e010c0dae8ba17de5bfe0d95dc04622fbc3d1b03736400cbbfc
EBUILD hamfax-9999.ebuild 598 SHA256 4b260f0ba22fa65f1024e69f4f27bb07527403c0e747a6cc4dbefbb9cce1cd0c SHA512 6964d847996647ff018a2ce6305e8fa1ce72fe61ae3bc80ae5715412a364a1a4947a748d49fa27e3423dc397494b62bfe0db0d4f1d675356d1840981f17513d6 WHIRLPOOL 149799db2a11556684cf123aa907378275179f3bdea6f2b93989ebac86c1cdf39d6cca86c5500f3638a3792f613858d2ca355494c1244c722f9d07f6064c1083

View File

@@ -0,0 +1,55 @@
diff --git a/lib/log.c b/lib/log.c
index b9c1867..b58070a 100644
--- a/lib/log.c
+++ b/lib/log.c
@@ -23,41 +23,14 @@
#include <time.h>
#include "config.h"
-#ifdef HAVE_LIBHAMLIB
-#include <hamlib/rig.h>
-#endif
-
static FILE *log_file;
-#ifdef HAVE_LIBHAMLIB
-/**
- * The default setting for hamlib is logging to stderr. Adjust it to our log,
- * or use /dev/null to redirect the hamlib log.
- */
-static void set_hamlib_log()
-{
- if (log_file) {
- rig_set_debug_file(log_file);
-
- } else {
- FILE *dev_null;
-
- dev_null = fopen("/dev/null", "w");
- if (dev_null)
- rig_set_debug_file(dev_null);
- }
-}
-#else
-static inline void set_hamlib_log(FILE *) { }
-#endif
-
int log_open(const char *file)
{
log_file = fopen(file, "a");
if (!log_file)
return errno;
- set_hamlib_log();
return 0;
}
@@ -85,8 +58,6 @@ int log_open_argv(int argc, char **argv)
if (open && !filename)
log_file = stderr;
- set_hamlib_log();
-
return 0;
}

View File

@@ -0,0 +1,34 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit git-r3 autotools
DESCRIPTION="Send and receive radio fax"
HOMEPAGE="http://hamfax.sourceforge.net/"
SRC_URI=""
EGIT_REPO_URI="git://git.code.sf.net/p/hamfax/code"
KEYWORDS=""
LICENSE="GPL-2"
SLOT="0/${PV}"
IUSE=""
RDEPEND=""
DEPEND=""
REQUIRED_USE=""
src_prepare() {
[[ ${PV} == "9999" ]] && eautoreconf
eapply ${FILESDIR}/fix_broken_logging.patch
eapply_user
}
src_install() {
dobin hamfax
doman doc/hamfax.1
dodoc AUTHORS COPYING ChangeLog NEWS README TODO
}