diff options
author | marcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059> | 2005-09-10 13:52:02 +0800 |
---|---|---|
committer | marcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059> | 2005-09-10 13:52:02 +0800 |
commit | 0b61403baca88b8e2f93b2cf57c2da06d4482277 (patch) | |
tree | 029c9e3ae59f6b3ec491f26d4b99a4184de1dad1 | |
parent | cf1daa8a46bb47c5e49740cd09e70d100fd9e6f9 (diff) | |
download | marcuscom-ports-0b61403baca88b8e2f93b2cf57c2da06d4482277.tar marcuscom-ports-0b61403baca88b8e2f93b2cf57c2da06d4482277.tar.gz marcuscom-ports-0b61403baca88b8e2f93b2cf57c2da06d4482277.tar.bz2 marcuscom-ports-0b61403baca88b8e2f93b2cf57c2da06d4482277.tar.lz marcuscom-ports-0b61403baca88b8e2f93b2cf57c2da06d4482277.tar.xz marcuscom-ports-0b61403baca88b8e2f93b2cf57c2da06d4482277.tar.zst marcuscom-ports-0b61403baca88b8e2f93b2cf57c2da06d4482277.zip |
* Rewrite forkpty using UNIX98 ptys. This effectively get g-s-t working on
FreeBSD.
* Mark IGNORE for 4.X.
git-svn-id: svn://creme-brulee.marcuscom.com/ports/trunk@4813 df743ca5-7f9a-e211-a948-0013205c9059
-rw-r--r-- | sysutils/gnome-system-tools/Makefile | 12 | ||||
-rw-r--r-- | sysutils/gnome-system-tools/files/patch-src_common_gst-auth.c | 100 | ||||
-rw-r--r-- | sysutils/gnome-system-tools/pkg-plist | 4 | ||||
-rw-r--r-- | sysutils/gnomesystemtools/Makefile | 12 | ||||
-rw-r--r-- | sysutils/gnomesystemtools/files/patch-src_common_gst-auth.c | 100 | ||||
-rw-r--r-- | sysutils/gnomesystemtools/pkg-plist | 4 |
6 files changed, 206 insertions, 26 deletions
diff --git a/sysutils/gnome-system-tools/Makefile b/sysutils/gnome-system-tools/Makefile index fa8923ef8..ac6ff7a10 100644 --- a/sysutils/gnome-system-tools/Makefile +++ b/sysutils/gnome-system-tools/Makefile @@ -3,11 +3,12 @@ # Whom: Adam Weinberger <adamw@FreeBSD.org> # # $FreeBSD$ -# $MCom: ports/sysutils/gnomesystemtools/Makefile,v 1.28 2005/08/26 04:03:55 marcus Exp $ +# $MCom: ports/sysutils/gnomesystemtools/Makefile,v 1.29 2005/09/04 18:57:45 marcus Exp $ # PORTNAME= gnomesystemtools PORTVERSION= 1.4.0 +PORTREVISION= 1 CATEGORIES= sysutils gnome MASTER_SITES= ${MASTER_SITE_GNOME} MASTER_SITE_SUBDIR= sources/gnome-system-tools/1.4 @@ -27,6 +28,7 @@ GNOME_DESKTOP_VERSION=2 USE_GNOME= gnomehack gnomeprefix gnometarget intlhack nautilus2 USE_AUTOTOOLS= libtool:15 INSTALLS_OMF= yes +CONFIGURE_ARGS= --enable-services CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \ LDFLAGS="-L${LOCALBASE}/lib" @@ -34,12 +36,8 @@ GCONF_SCHEMAS= gnome-system-tools.schemas .include <bsd.port.pre.mk> -.if ${OSVERSION} >= 500000 -CONFIGURE_ARGS+= --enable-services -PLIST_SUB+= SERVICES="" -.else -CONFIGURE_ARGS+= --disable-services -PLIST_SUB+= SERVICES="@comment " +.if ${OSVERSION} < 500000 +IGNORE= Uses symbols not present in 4.X .endif .include <bsd.port.post.mk> diff --git a/sysutils/gnome-system-tools/files/patch-src_common_gst-auth.c b/sysutils/gnome-system-tools/files/patch-src_common_gst-auth.c index 9272d9181..f73b28ae4 100644 --- a/sysutils/gnome-system-tools/files/patch-src_common_gst-auth.c +++ b/sysutils/gnome-system-tools/files/patch-src_common_gst-auth.c @@ -1,13 +1,105 @@ ---- src/common/gst-auth.c.orig Thu Mar 10 14:39:18 2005 -+++ src/common/gst-auth.c Thu Mar 10 14:39:50 2005 -@@ -142,12 +142,12 @@ gst_auth_run_term (GstTool *tool, gchar +--- src/common/gst-auth.c.orig Mon Aug 8 15:00:01 2005 ++++ src/common/gst-auth.c Sat Sep 10 01:47:35 2005 +@@ -55,6 +55,82 @@ + static int root; /* if we are root, no password is + required */ + ++#ifdef __FreeBSD__ ++static int ++_forkpty (int *amaster, char *name, ++ struct termios *termp, struct winsize *winp) ++{ ++ int master, slave; ++ char *line; ++ pid_t pid; ++ ++ master = posix_openpt (O_RDWR); ++ if (master == -1) ++ return (-1); ++ ++ if (grantpt (master) == -1) ++ { ++ (void) close (master); ++ return (-1); ++ } ++ ++ if (unlockpt (master) == -1) ++ { ++ (void) close (master); ++ return (-1); ++ } ++ ++ line = ptsname (master); ++ if (line == NULL) ++ { ++ (void) close (master); ++ return (-1); ++ } ++ ++ slave = open (line, O_RDWR); ++ if (slave < 0) ++ { ++ (void) close (master); ++ return (-1); ++ } ++ ++ if (amaster) ++ *amaster = master; ++ ++ if (name) ++ strcpy (name, line); ++ ++ if (termp) ++ (void) tcsetattr(slave, TCSAFLUSH, termp); ++ ++ if (winp) ++ (void) ioctl(slave, TIOCSWINSZ, (char *) winp); ++ ++ pid = fork (); ++ switch (pid) ++ { ++ case -1: ++ (void) close (slave); ++ (void) close (master); ++ return (-1); ++ case 0: ++ (void) close (master); ++ dup2 (slave, STDIN_FILENO); ++ dup2 (slave, STDOUT_FILENO); ++ dup2 (slave, STDERR_FILENO); ++ return (0); ++ default: ++ (void) close (slave); ++ return (pid); ++ } ++ ++ (void) close (master); ++ return (-1); ++} ++#else ++#define _forkpty forkpty ++#endif ++ + static void + gst_auth_display_error_message (GstTool *tool, gchar *primary_text, gchar *secondary_text) + { +@@ -125,7 +201,7 @@ gst_auth_run_term (GstTool *tool, gchar + int p[2]; + + pipe (p); +- tool->backend_pid = forkpty (&tool->write_fd, NULL, NULL, NULL); ++ tool->backend_pid = _forkpty (&tool->write_fd, NULL, NULL, NULL); + + if (tool->backend_pid < 0) { + gst_auth_display_error_message (tool, +@@ -142,12 +218,12 @@ gst_auth_run_term (GstTool *tool, gchar unsetenv("LANG"); unsetenv("LANGUAGE"); - dup2 (p[1], 1); - dup2 (p[1], 2); + dup2 (p[1], STDOUT_FILENO); -+ /*dup2 (p[1], 2);*/ ++ dup2 (p[1], STDERR_FILENO); close (p[0]); execv (args[0], args); diff --git a/sysutils/gnome-system-tools/pkg-plist b/sysutils/gnome-system-tools/pkg-plist index 288d79c9c..48800800d 100644 --- a/sysutils/gnome-system-tools/pkg-plist +++ b/sysutils/gnome-system-tools/pkg-plist @@ -1,5 +1,5 @@ bin/network-admin -%%SERVICES%%bin/services-admin +bin/services-admin bin/shares-admin bin/time-admin bin/users-admin @@ -64,7 +64,7 @@ share/gnome-system-tools/pixmaps/wavelan-16.png share/gnome-system-tools/pixmaps/wavelan-48.png share/gnome-system-tools/pixmaps/world_map-960.png share/gnome/applications/network.desktop -%%SERVICES%%share/gnome/applications/services.desktop +share/gnome/applications/services.desktop share/gnome/applications/shares.desktop share/gnome/applications/time.desktop share/gnome/applications/users.desktop diff --git a/sysutils/gnomesystemtools/Makefile b/sysutils/gnomesystemtools/Makefile index fa8923ef8..ac6ff7a10 100644 --- a/sysutils/gnomesystemtools/Makefile +++ b/sysutils/gnomesystemtools/Makefile @@ -3,11 +3,12 @@ # Whom: Adam Weinberger <adamw@FreeBSD.org> # # $FreeBSD$ -# $MCom: ports/sysutils/gnomesystemtools/Makefile,v 1.28 2005/08/26 04:03:55 marcus Exp $ +# $MCom: ports/sysutils/gnomesystemtools/Makefile,v 1.29 2005/09/04 18:57:45 marcus Exp $ # PORTNAME= gnomesystemtools PORTVERSION= 1.4.0 +PORTREVISION= 1 CATEGORIES= sysutils gnome MASTER_SITES= ${MASTER_SITE_GNOME} MASTER_SITE_SUBDIR= sources/gnome-system-tools/1.4 @@ -27,6 +28,7 @@ GNOME_DESKTOP_VERSION=2 USE_GNOME= gnomehack gnomeprefix gnometarget intlhack nautilus2 USE_AUTOTOOLS= libtool:15 INSTALLS_OMF= yes +CONFIGURE_ARGS= --enable-services CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \ LDFLAGS="-L${LOCALBASE}/lib" @@ -34,12 +36,8 @@ GCONF_SCHEMAS= gnome-system-tools.schemas .include <bsd.port.pre.mk> -.if ${OSVERSION} >= 500000 -CONFIGURE_ARGS+= --enable-services -PLIST_SUB+= SERVICES="" -.else -CONFIGURE_ARGS+= --disable-services -PLIST_SUB+= SERVICES="@comment " +.if ${OSVERSION} < 500000 +IGNORE= Uses symbols not present in 4.X .endif .include <bsd.port.post.mk> diff --git a/sysutils/gnomesystemtools/files/patch-src_common_gst-auth.c b/sysutils/gnomesystemtools/files/patch-src_common_gst-auth.c index 9272d9181..f73b28ae4 100644 --- a/sysutils/gnomesystemtools/files/patch-src_common_gst-auth.c +++ b/sysutils/gnomesystemtools/files/patch-src_common_gst-auth.c @@ -1,13 +1,105 @@ ---- src/common/gst-auth.c.orig Thu Mar 10 14:39:18 2005 -+++ src/common/gst-auth.c Thu Mar 10 14:39:50 2005 -@@ -142,12 +142,12 @@ gst_auth_run_term (GstTool *tool, gchar +--- src/common/gst-auth.c.orig Mon Aug 8 15:00:01 2005 ++++ src/common/gst-auth.c Sat Sep 10 01:47:35 2005 +@@ -55,6 +55,82 @@ + static int root; /* if we are root, no password is + required */ + ++#ifdef __FreeBSD__ ++static int ++_forkpty (int *amaster, char *name, ++ struct termios *termp, struct winsize *winp) ++{ ++ int master, slave; ++ char *line; ++ pid_t pid; ++ ++ master = posix_openpt (O_RDWR); ++ if (master == -1) ++ return (-1); ++ ++ if (grantpt (master) == -1) ++ { ++ (void) close (master); ++ return (-1); ++ } ++ ++ if (unlockpt (master) == -1) ++ { ++ (void) close (master); ++ return (-1); ++ } ++ ++ line = ptsname (master); ++ if (line == NULL) ++ { ++ (void) close (master); ++ return (-1); ++ } ++ ++ slave = open (line, O_RDWR); ++ if (slave < 0) ++ { ++ (void) close (master); ++ return (-1); ++ } ++ ++ if (amaster) ++ *amaster = master; ++ ++ if (name) ++ strcpy (name, line); ++ ++ if (termp) ++ (void) tcsetattr(slave, TCSAFLUSH, termp); ++ ++ if (winp) ++ (void) ioctl(slave, TIOCSWINSZ, (char *) winp); ++ ++ pid = fork (); ++ switch (pid) ++ { ++ case -1: ++ (void) close (slave); ++ (void) close (master); ++ return (-1); ++ case 0: ++ (void) close (master); ++ dup2 (slave, STDIN_FILENO); ++ dup2 (slave, STDOUT_FILENO); ++ dup2 (slave, STDERR_FILENO); ++ return (0); ++ default: ++ (void) close (slave); ++ return (pid); ++ } ++ ++ (void) close (master); ++ return (-1); ++} ++#else ++#define _forkpty forkpty ++#endif ++ + static void + gst_auth_display_error_message (GstTool *tool, gchar *primary_text, gchar *secondary_text) + { +@@ -125,7 +201,7 @@ gst_auth_run_term (GstTool *tool, gchar + int p[2]; + + pipe (p); +- tool->backend_pid = forkpty (&tool->write_fd, NULL, NULL, NULL); ++ tool->backend_pid = _forkpty (&tool->write_fd, NULL, NULL, NULL); + + if (tool->backend_pid < 0) { + gst_auth_display_error_message (tool, +@@ -142,12 +218,12 @@ gst_auth_run_term (GstTool *tool, gchar unsetenv("LANG"); unsetenv("LANGUAGE"); - dup2 (p[1], 1); - dup2 (p[1], 2); + dup2 (p[1], STDOUT_FILENO); -+ /*dup2 (p[1], 2);*/ ++ dup2 (p[1], STDERR_FILENO); close (p[0]); execv (args[0], args); diff --git a/sysutils/gnomesystemtools/pkg-plist b/sysutils/gnomesystemtools/pkg-plist index 288d79c9c..48800800d 100644 --- a/sysutils/gnomesystemtools/pkg-plist +++ b/sysutils/gnomesystemtools/pkg-plist @@ -1,5 +1,5 @@ bin/network-admin -%%SERVICES%%bin/services-admin +bin/services-admin bin/shares-admin bin/time-admin bin/users-admin @@ -64,7 +64,7 @@ share/gnome-system-tools/pixmaps/wavelan-16.png share/gnome-system-tools/pixmaps/wavelan-48.png share/gnome-system-tools/pixmaps/world_map-960.png share/gnome/applications/network.desktop -%%SERVICES%%share/gnome/applications/services.desktop +share/gnome/applications/services.desktop share/gnome/applications/shares.desktop share/gnome/applications/time.desktop share/gnome/applications/users.desktop |