[Midnightbsd-cvs] mports: mports/print: Add libgnomecups.
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Wed Aug 22 04:15:12 EDT 2007
Log Message:
-----------
Add libgnomecups.
Modified Files:
--------------
mports/print:
Makefile (r1.29 -> r1.30)
Added Files:
-----------
mports/print/libgnomecups:
Makefile (r1.1)
distinfo (r1.1)
pkg-descr (r1.1)
pkg-plist (r1.1)
mports/print/libgnomecups/files:
patch-20_parse-dot-cups-lpoptions (r1.1)
patch-21_fix-islocal (r1.1)
patch-22_ignore-ipp-not-found (r1.1)
patch-23_replace-set-printer-attrs (r1.1)
patch-24_mem-leak (r1.1)
patch-25_browsed_ppds (r1.1)
-------------- next part --------------
Index: Makefile
===================================================================
RCS file: /home/cvs/mports/print/Makefile,v
retrieving revision 1.29
retrieving revision 1.30
diff -Lprint/Makefile -Lprint/Makefile -u -r1.29 -r1.30
--- print/Makefile
+++ print/Makefile
@@ -27,6 +27,7 @@
SUBDIR += gsfonts
SUBDIR += gv
SUBDIR += jadetex
+ SUBDIR += libgnomecups
SUBDIR += libpaper
SUBDIR += pdflib
SUBDIR += pecl-pdflib
--- /dev/null
+++ print/libgnomecups/pkg-descr
@@ -0,0 +1,3 @@
+Support library for Cups adminstration through GNOME.
+
+WWW: http://www.gnome.org/
--- /dev/null
+++ print/libgnomecups/pkg-plist
@@ -0,0 +1,51 @@
+include/libgnomecups-1/libgnomecups/gnome-cups-init.h
+include/libgnomecups-1/libgnomecups/gnome-cups-printer.h
+include/libgnomecups-1/libgnomecups/gnome-cups-queue.h
+include/libgnomecups-1/libgnomecups/gnome-cups-request.h
+include/libgnomecups-1/libgnomecups/gnome-cups-util.h
+lib/libgnomecups-1.0.a
+lib/libgnomecups-1.0.la
+lib/libgnomecups-1.0.so
+lib/libgnomecups-1.0.so.1
+libdata/pkgconfig/libgnomecups-1.0.pc
+share/locale/bg/LC_MESSAGES/libgnomecups.mo
+share/locale/ca/LC_MESSAGES/libgnomecups.mo
+share/locale/cs/LC_MESSAGES/libgnomecups.mo
+share/locale/de/LC_MESSAGES/libgnomecups.mo
+share/locale/en_CA/LC_MESSAGES/libgnomecups.mo
+share/locale/en_GB/LC_MESSAGES/libgnomecups.mo
+share/locale/es/LC_MESSAGES/libgnomecups.mo
+share/locale/eu/LC_MESSAGES/libgnomecups.mo
+share/locale/fi/LC_MESSAGES/libgnomecups.mo
+share/locale/fr/LC_MESSAGES/libgnomecups.mo
+share/locale/gl/LC_MESSAGES/libgnomecups.mo
+share/locale/gu/LC_MESSAGES/libgnomecups.mo
+share/locale/hi/LC_MESSAGES/libgnomecups.mo
+share/locale/hr/LC_MESSAGES/libgnomecups.mo
+share/locale/hu/LC_MESSAGES/libgnomecups.mo
+share/locale/is/LC_MESSAGES/libgnomecups.mo
+share/locale/it/LC_MESSAGES/libgnomecups.mo
+share/locale/ja/LC_MESSAGES/libgnomecups.mo
+share/locale/lt/LC_MESSAGES/libgnomecups.mo
+share/locale/nb/LC_MESSAGES/libgnomecups.mo
+share/locale/ne/LC_MESSAGES/libgnomecups.mo
+share/locale/nl/LC_MESSAGES/libgnomecups.mo
+share/locale/no/LC_MESSAGES/libgnomecups.mo
+share/locale/pa/LC_MESSAGES/libgnomecups.mo
+share/locale/pt/LC_MESSAGES/libgnomecups.mo
+share/locale/pt_BR/LC_MESSAGES/libgnomecups.mo
+share/locale/rw/LC_MESSAGES/libgnomecups.mo
+share/locale/sk/LC_MESSAGES/libgnomecups.mo
+share/locale/sq/LC_MESSAGES/libgnomecups.mo
+share/locale/sr/LC_MESSAGES/libgnomecups.mo
+share/locale/sr at Latn/LC_MESSAGES/libgnomecups.mo
+share/locale/sv/LC_MESSAGES/libgnomecups.mo
+share/locale/th/LC_MESSAGES/libgnomecups.mo
+share/locale/uk/LC_MESSAGES/libgnomecups.mo
+share/locale/wa/LC_MESSAGES/libgnomecups.mo
+share/locale/zh_CN/LC_MESSAGES/libgnomecups.mo
+share/locale/zh_TW/LC_MESSAGES/libgnomecups.mo
+ at dirrmtry include/libgnomecups-1/libgnomecups
+ at dirrmtry include/libgnomecups-1
+ at dirrmtry share/locale/rw/LC_MESSAGES
+ at dirrmtry share/locale/rw
--- /dev/null
+++ print/libgnomecups/Makefile
@@ -0,0 +1,31 @@
+# New ports collection makefile for: libgnomecups
+# Date created: 14 Jul 2003
+# Whom: Glenn Johnson <glennpj at charter.net>
+#
+# $MidnightBSD: mports/print/libgnomecups/Makefile,v 1.1 2007/08/22 08:15:10 laffer1 Exp $
+# $FreeBSD: ports/print/libgnomecups/Makefile,v 1.22 2007/07/05 03:54:51 tmclaugh Exp $
+#
+
+PORTNAME= libgnomecups
+PORTVERSION= 0.2.2
+PORTEPOCH= 1
+CATEGORIES= print gnome
+MASTER_SITES= ${MASTER_SITE_GNOME}
+MASTER_SITE_SUBDIR= sources/${PORTNAME}/0.2
+DIST_SUBDIR= gnome2
+
+MAINTAINER= ports at MidnightBSD.org
+COMMENT= Support library for gnome cups admistration
+
+LIB_DEPENDS= cups.2:${PORTSDIR}/print/cups-base
+
+USE_BZIP2= yes
+USE_GMAKE= yes
+USE_GNOME= gnomehack intlhack ltverhack glib20
+USE_GETTEXT= yes
+USE_LDCONFIG= yes
+USE_AUTOTOOLS= libtool:15
+CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \
+ LDFLAGS="-L${LOCALBASE}/lib"
+
+.include <bsd.port.mk>
--- /dev/null
+++ print/libgnomecups/distinfo
@@ -0,0 +1,3 @@
+MD5 (gnome2/libgnomecups-0.2.2.tar.bz2) = 959d5524fe9c37efb55ccfa02e3a063b
+SHA256 (gnome2/libgnomecups-0.2.2.tar.bz2) = f70599274dbb575fbbc83bb58179b757800e5d87e59e35f5d95e618c7ec31444
+SIZE (gnome2/libgnomecups-0.2.2.tar.bz2) = 314374
--- /dev/null
+++ print/libgnomecups/files/patch-21_fix-islocal
@@ -0,0 +1,17 @@
+diff -pruN 0.2.2-1/libgnomecups/gnome-cups-printer.c 0.2.2-1ubuntu5/libgnomecups/gnome-cups-printer.c
+--- 0.2.2-1/libgnomecups/gnome-cups-printer.c 2005-09-23 21:52:49.000000000 +0100
++++ libgnomecups/gnome-cups-printer.c 2006-06-27 16:21:38.000000000 +0100
+@@ -976,8 +980,11 @@ gnome_cups_printer_get_is_local (GnomeCu
+ {
+ g_return_val_if_fail (GNOME_CUPS_IS_PRINTER (printer), FALSE);
+
+- return (printer->details->device_uri != NULL) &&
+- (strcmp (printer->details->device_uri, "") != 0);
++ return printer->details->device_uri != NULL &&
++ strncmp(printer->details->device_uri, "smb:", 4) != 0 &&
++ strncmp(printer->details->device_uri, "http:", 5) != 0 &&
++ strncmp(printer->details->device_uri, "https:", 5) != 0 &&
++ strncmp(printer->details->device_uri, "ipp:", 4) != 0;
+ }
+
+ void
--- /dev/null
+++ print/libgnomecups/files/patch-25_browsed_ppds
@@ -0,0 +1,50 @@
+diff -Nur libgnomecups-0.2.2/libgnomecups/gnome-cups-printer.c libgnomecups-0.2.2.new/libgnomecups/gnome-cups-printer.c
+--- libgnomecups-0.2.2/libgnomecups/gnome-cups-printer.c 2006-09-18 10:23:13.000000000 +0200
++++ libgnomecups/gnome-cups-printer.c 2006-09-18 10:23:18.000000000 +0200
+@@ -1105,7 +1105,7 @@
+ return NULL;
+ }
+
+- host = _gnome_cups_printer_get_host (printer);
++ host = _gnome_cups_printer_get_ppd_host (printer);
+ ppdpath = get_ppd_uri_path (printer);
+
+ gnome_cups_request_file (host, ppdpath, fd, &error);
+@@ -1976,3 +1976,26 @@
+
+ return host;
+ }
++
++gchar *
++_gnome_cups_printer_get_ppd_host (GnomeCupsPrinter *printer)
++{
++ gchar *host = NULL;
++
++ if (printer->details->printer_uri) {
++ gchar *x, *y;
++
++ x = strstr (printer->details->printer_uri, "://");
++
++ if (x) {
++ x += 3;
++ y = strpbrk (x, ":/");
++ if (y)
++ host = g_strndup (x, y - x);
++ else
++ host = g_strdup (x);
++ }
++ }
++
++ return host;
++}
+diff -Nur libgnomecups-0.2.2/libgnomecups/gnome-cups-printer.h libgnomecups-0.2.2.new/libgnomecups/gnome-cups-printer.h
+--- libgnomecups-0.2.2/libgnomecups/gnome-cups-printer.h 2005-03-04 14:43:33.000000000 +0100
++++ libgnomecups/gnome-cups-printer.h 2006-09-18 10:23:18.000000000 +0200
+@@ -184,6 +184,7 @@
+ /* Private */
+ void _gnome_cups_printer_init (void);
+ gchar *_gnome_cups_printer_get_host (GnomeCupsPrinter *printer);
++gchar *_gnome_cups_printer_get_ppd_host (GnomeCupsPrinter *printer);
+
+ G_END_DECLS
+
--- /dev/null
+++ print/libgnomecups/files/patch-24_mem-leak
@@ -0,0 +1,23 @@
+diff -urN libgnomecups-0.2.2.orig/libgnomecups/gnome-cups-request.c libgnomecups-0.2.2/libgnomecups/gnome-cups-request.c
+--- libgnomecups-0.2.2.orig/libgnomecups/gnome-cups-request.c 2006-07-03 21:55:57.000000000 +0200
++++ libgnomecups/gnome-cups-request.c 2006-07-03 21:57:00.000000000 +0200
+@@ -470,17 +470,12 @@
+ char **attributes)
+ {
+ ipp_attribute_t *attr;
+- int i;
+
+ attr = ippAddStrings (request,
+ group,
+- IPP_TAG_KEYWORD,
++ IPP_TAG_KEYWORD | IPP_TAG_COPY,
+ "requested-attributes",
+- n_attributes, NULL, NULL);
+-
+- for (i = 0; i < n_attributes; i++) {
+- attr->values[i].string.text = gnome_cups_strdup (attributes[i]);
+- }
++ n_attributes, NULL, attributes);
+ }
+
+ typedef struct
--- /dev/null
+++ print/libgnomecups/files/patch-23_replace-set-printer-attrs
@@ -0,0 +1,36 @@
+diff -pruN 0.2.2-1/libgnomecups/gnome-cups-printer.c 0.2.2-1ubuntu5/libgnomecups/gnome-cups-printer.c
+--- 0.2.2-1/libgnomecups/gnome-cups-printer.c 2005-09-23 21:52:49.000000000 +0100
++++ libgnomecups/gnome-cups-printer.c 2006-06-27 16:21:38.000000000 +0100
+@@ -1237,6 +1244,9 @@ gnome_cups_printer_get_description (Gnom
+
+ }
+
++/* Define the CUPS-Add-Modify-Printer, see http://www.cups.org/documentation.php/spec-ipp.html#CUPS_ADD_MODIFY_PRINTER */
++#define CUPS_ADD_MODIFY_PRINTER 0x4003
++
+ void
+ gnome_cups_printer_set_description (GnomeCupsPrinter *printer,
+ const char *description,
+@@ -1252,7 +1262,9 @@ gnome_cups_printer_set_description (Gnom
+ return;
+ }
+
+- request = gnome_cups_request_new_for_printer (IPP_SET_PRINTER_ATTRIBUTES,
++ /* As read in http://lists.samba.org/archive/samba-technical/2003-February/027044.html
++ CUPS does not currently support IPP_SET_PRINTER_ATTRIBUTES, so a is used */
++ request = gnome_cups_request_new_for_printer (CUPS_ADD_MODIFY_PRINTER,
+ printer);
+ ippAddString (request, IPP_TAG_PRINTER, IPP_TAG_TEXT,
+ "printer-info", NULL, description);
+@@ -1283,9 +1295,9 @@ gnome_cups_printer_set_location (GnomeCu
+ if (!strcmp (location, printer->details->location)) {
+ return;
+ }
+-
++ /* Same as above (IPP_SET_PRINTER_ATTRIBUTES replaced by CUPS-Add-Modify-Printer ) */
+ request = gnome_cups_request_new_for_printer (
+- IPP_SET_PRINTER_ATTRIBUTES, printer);
++ CUPS_ADD_MODIFY_PRINTER, printer);
+ ippAddString (request, IPP_TAG_PRINTER, IPP_TAG_TEXT,
+ "printer-location", NULL, location);
+ response = gnome_cups_request_execute (request, NULL, "/admin/", error);
--- /dev/null
+++ print/libgnomecups/files/patch-22_ignore-ipp-not-found
@@ -0,0 +1,12 @@
+diff -pruN 0.2.2-1/libgnomecups/gnome-cups-request.c 0.2.2-1ubuntu5/libgnomecups/gnome-cups-request.c
+--- 0.2.2-1/libgnomecups/gnome-cups-request.c 2005-03-28 16:43:06.000000000 +0100
++++ libgnomecups/gnome-cups-request.c 2006-06-27 16:21:38.000000000 +0100
+@@ -349,7 +349,7 @@ request_thread_main (GnomeCupsRequest *r
+ if (request->response == NULL)
+ status = IPP_INTERNAL_ERROR;
+
+- if (status > IPP_OK_CONFLICT) {
++ if (status > IPP_OK_CONFLICT && status != IPP_NOT_FOUND) {
+ g_warning ("IPP request failed with status %d", status);
+ if (request->error != NULL)
+ *(request->error) = g_error_new (GNOME_CUPS_ERROR,
--- /dev/null
+++ print/libgnomecups/files/patch-20_parse-dot-cups-lpoptions
@@ -0,0 +1,14 @@
+diff -pruN 0.2.2-1/libgnomecups/gnome-cups-printer.c 0.2.2-1ubuntu5/libgnomecups/gnome-cups-printer.c
+--- 0.2.2-1/libgnomecups/gnome-cups-printer.c 2005-09-23 21:52:49.000000000 +0100
++++ libgnomecups/gnome-cups-printer.c 2006-06-27 16:21:38.000000000 +0100
+@@ -510,6 +510,10 @@ parse_lpoptions (cups_dest_t **dests)
+ num_dests = cups_get_dests (filename, num_dests, dests);
+ g_free (filename);
+
++ filename = g_build_filename (g_get_home_dir (), ".cups", "lpoptions", NULL);
++ num_dests = cups_get_dests (filename, num_dests, dests);
++ g_free (filename);
++
+ return num_dests;
+ }
+
More information about the Midnightbsd-cvs
mailing list