summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-print/mtink')
-rw-r--r--net-print/mtink/Manifest1
-rw-r--r--net-print/mtink/files/mtink-1.0.16-options.patch39
-rw-r--r--net-print/mtink/files/mtink-1.0.16-overflow.patch11
-rw-r--r--net-print/mtink/files/mtinkd.confd15
-rw-r--r--net-print/mtink/files/mtinkd.rc20
-rw-r--r--net-print/mtink/metadata.xml7
-rw-r--r--net-print/mtink/mtink-1.0.16-r1.ebuild77
7 files changed, 170 insertions, 0 deletions
diff --git a/net-print/mtink/Manifest b/net-print/mtink/Manifest
new file mode 100644
index 000000000000..5fdd9be523ab
--- /dev/null
+++ b/net-print/mtink/Manifest
@@ -0,0 +1 @@
+DIST mtink-1.0.16.tar.gz 916315 SHA256 187e8d145e818b4b56be203403f5fe28c02f899d30d92c58e82bcef311555ba2
diff --git a/net-print/mtink/files/mtink-1.0.16-options.patch b/net-print/mtink/files/mtink-1.0.16-options.patch
new file mode 100644
index 000000000000..c173a4c762c1
--- /dev/null
+++ b/net-print/mtink/files/mtink-1.0.16-options.patch
@@ -0,0 +1,39 @@
+diff -ruN mtink-1.0.16.orig/Makefile.ORG mtink-1.0.16/Makefile.ORG
+--- mtink-1.0.16.orig/Makefile.ORG 2007-08-28 12:52:30.000000000 +0200
++++ mtink-1.0.16/Makefile.ORG 2011-06-05 21:29:23.000000000 +0200
+@@ -4,7 +4,7 @@
+ setUid=1
+ gimpVersion=
+
+-DBG = -s -O
++DBG =
+
+ # comment this out for Solaris
+
+@@ -235,7 +235,7 @@
+
+ ttink: $(TTYOBJ) $(SRCDIR)/d4lib.h $(SRCDIR)/cmd.h $(SRCDIR)/mtink.h $(SRCDIR)/model.h $(SRCDIR)/version.h Makefile
+ @echo Link ttink
+- @$(CC) -o ttink $(TTYOBJ) $(CFLAGS) $(MTINK_CFLAGS) $(RDTIMEOUT) $(DEVICE) $(WRTIMEOUT) $(DEBUG) $(KERNEL_USB_BUG) $(MACOSLDFLG) -DWITH_X=0
++ @$(CC) -o ttink $(LDFLAGS) $(TTYOBJ) $(CFLAGS) $(MTINK_CFLAGS) $(RDTIMEOUT) $(DEVICE) $(WRTIMEOUT) $(DEBUG) $(KERNEL_USB_BUG) $(MACOSLDFLG) -DWITH_X=0
+
+ ############# PLUG-IN #######################
+ gimp-mtink: $(SRCDIR)/gimp-mtink.c Makefile
+@@ -257,7 +257,7 @@
+
+ mtinkd: $(SVR_OBJ) Makefile
+ @echo Link mtinkd
+- @$(CC) -o mtinkd $(SVR_OBJ) $(CFLAGS) $(MTINK_CFLAGS) $(MACOSLDFLG)
++ @$(CC) -o mtinkd $(LDFLAGS) $(SVR_OBJ) $(CFLAGS) $(MTINK_CFLAGS) $(MACOSLDFLG)
+
+ ########### Chooser ##############
+
+@@ -269,7 +269,7 @@
+
+ $(DETDIR)/askPrinter: $(DETDIR)/askPrinter.c
+ @echo Compile and link askPrinter.c
+- @$(CC) -o $(DETDIR)/askPrinter $(DETDIR)/askPrinter.c -I. -I$(DETDIR)
++ @$(CC) -o $(DETDIR)/askPrinter $(LDFLAGS) $(DETDIR)/askPrinter.c -I. -I$(DETDIR)
+
+ ########### utilities ######################
+
diff --git a/net-print/mtink/files/mtink-1.0.16-overflow.patch b/net-print/mtink/files/mtink-1.0.16-overflow.patch
new file mode 100644
index 000000000000..181ab0d789d4
--- /dev/null
+++ b/net-print/mtink/files/mtink-1.0.16-overflow.patch
@@ -0,0 +1,11 @@
+--- server/mtinkd.c.orig 2012-01-15 13:03:41.000000000 +0000
++++ server/mtinkd.c 2012-01-15 13:03:58.000000000 +0000
+@@ -244,7 +244,7 @@
+ /* look for pid into /var/run/mtink(<fifo> */
+ if ( (fp = fopen(runFile,"r")) )
+ {
+- if ( fgets(ibuf, sizeof(buf), fp) )
++ if ( fgets(ibuf, sizeof(ibuf), fp) )
+ {
+ if ( (pid = atoi(ibuf)) )
+ {
diff --git a/net-print/mtink/files/mtinkd.confd b/net-print/mtink/files/mtinkd.confd
new file mode 100644
index 000000000000..9facf032790d
--- /dev/null
+++ b/net-print/mtink/files/mtinkd.confd
@@ -0,0 +1,15 @@
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# define the device file, adapt this
+#DEV_FILE=/dev/lp0
+DEV_FILE=/dev/usb/lp0
+
+# Special options, adapt this
+# add name of printer
+NAME=
+
+# use the first line for USB printers, the second for parallel port printers
+SPEC="-name $NAME -usbbase /dev/usb/lp"
+#SPEC="-name $NAME"
diff --git a/net-print/mtink/files/mtinkd.rc b/net-print/mtink/files/mtinkd.rc
new file mode 100644
index 000000000000..f881017bf5cf
--- /dev/null
+++ b/net-print/mtink/files/mtinkd.rc
@@ -0,0 +1,20 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ use cups
+}
+
+start() {
+ ebegin "Starting mtinkd"
+ /usr/sbin/mtinkd start ${DEV_FILE} ${SPEC}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping mtinkd"
+ /usr/sbin/mtinkd stop ${DEV_FILE} ${SPEC}
+ eend $?
+}
diff --git a/net-print/mtink/metadata.xml b/net-print/mtink/metadata.xml
new file mode 100644
index 000000000000..403e2746cbe2
--- /dev/null
+++ b/net-print/mtink/metadata.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>printing</herd>
+<herd>proxy-maintainers</herd>
+<maintainer><email>SebastianLuther@gmx.de</email></maintainer>
+</pkgmetadata>
diff --git a/net-print/mtink/mtink-1.0.16-r1.ebuild b/net-print/mtink/mtink-1.0.16-r1.ebuild
new file mode 100644
index 000000000000..4aef896823df
--- /dev/null
+++ b/net-print/mtink/mtink-1.0.16-r1.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit eutils base
+
+DESCRIPTION="mtink is a status monitor and inkjet cartridge changer for some Epson printers"
+HOMEPAGE="http://xwtools.automatix.de/"
+SRC_URI="http://xwtools.automatix.de/files/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~ppc ~sparc x86"
+IUSE="cups doc X"
+
+DEPEND="X? ( x11-libs/libX11
+ x11-libs/libXpm
+ x11-libs/libXt
+ >=x11-libs/motif-2.3:0 )
+ cups? ( net-print/cups )
+ virtual/libusb:0"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}/${P}-options.patch"
+ "${FILESDIR}/${P}-overflow.patch"
+)
+
+src_configure() {
+ ./Configure || die
+}
+
+src_compile() {
+ local mytargets
+ mytargets="ttink detect/askPrinter mtinkd"
+
+ if use X; then
+ mytargets="${mytargets} mtink mtinkc";
+ fi
+
+ emake ${mytargets}
+}
+
+src_install() {
+ dobin ttink detect/askPrinter
+
+ if use X; then
+ dobin mtinkc mtink
+ fi
+
+ dosbin mtinkd
+
+ newinitd "${FILESDIR}"/mtinkd.rc mtinkd
+ newconfd "${FILESDIR}"/mtinkd.confd mtinkd
+
+ if use cups; then
+ exeinto /usr/lib/cups/backend
+ doexe etc/mtink-cups
+ fi
+
+ dodoc README CHANGE.LOG
+ use doc && \
+ dohtml html/*.gif html/*.html
+}
+
+pkg_postinst() {
+ # see #70310
+ chmod 700 /var/mtink /var/run/mtink 2>/dev/null
+
+ elog
+ elog "mtink needs correct permissions to access printer device."
+ elog "To do this you either need to run the following chmod command:"
+ elog "chmod 666 /dev/<device>"
+ elog "or set the suid bit on mtink, mtinkc and ttink in /usr/bin"
+ elog
+}