From 153be3513be4bc2e4bc3dd0108a11950286cdd8a Mon Sep 17 00:00:00 2001 From: espie Date: Sun, 22 Apr 2001 13:23:38 +0000 Subject: [PATCH] same fixes as libs2. Plus: - do the login/logout in konsole_grantpty. It's just a question of opening the tty slave so that login() won't get confused. --- x11/kde/base2/Makefile | 12 ++- x11/kde/base2/patches/patch-aclocal_m4 | 24 ++++++ .../base2/patches/patch-admin_libtool_m4_in | 24 ++++++ x11/kde/base2/patches/patch-admin_ltcf-c_sh | 20 +++++ x11/kde/base2/patches/patch-admin_ltcf-cxx_sh | 2 +- x11/kde/base2/patches/patch-admin_ltconfig | 2 +- .../patch-kcontrol_thememgr_Makefile_in | 8 +- .../patch-kcontrol_thememgr_Makefile_in.orig | 20 +++++ .../patches/patch-konsole_src_Makefile_am | 11 +++ .../patches/patch-konsole_src_Makefile_in | 20 +++++ .../base2/patches/patch-konsole_src_TEPty_C | 14 ++++ .../patch-konsole_src_konsole_grantpty_c | 75 +++++++++++++++++++ .../base2/patches/patch-konsole_src_main_C | 12 --- x11/kde/base2/pkg/PLIST | 7 +- 14 files changed, 226 insertions(+), 25 deletions(-) create mode 100644 x11/kde/base2/patches/patch-aclocal_m4 create mode 100644 x11/kde/base2/patches/patch-admin_libtool_m4_in create mode 100644 x11/kde/base2/patches/patch-admin_ltcf-c_sh create mode 100644 x11/kde/base2/patches/patch-kcontrol_thememgr_Makefile_in.orig create mode 100644 x11/kde/base2/patches/patch-konsole_src_Makefile_am create mode 100644 x11/kde/base2/patches/patch-konsole_src_Makefile_in create mode 100644 x11/kde/base2/patches/patch-konsole_src_TEPty_C create mode 100644 x11/kde/base2/patches/patch-konsole_src_konsole_grantpty_c delete mode 100644 x11/kde/base2/patches/patch-konsole_src_main_C diff --git a/x11/kde/base2/Makefile b/x11/kde/base2/Makefile index 72bed7f86bd..757fbc2460b 100644 --- a/x11/kde/base2/Makefile +++ b/x11/kde/base2/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.14 2001/04/18 15:01:25 espie Exp $ +# $OpenBSD: Makefile,v 1.15 2001/04/22 13:23:38 espie Exp $ COMMENT= "X11 toolkit, basic applications" CATEGORIES= x11 x11/kde @@ -12,11 +12,16 @@ MASTER_SITES= ${MASTER_SITE_KDE} MASTER_SITE_SUBDIR= stable/${VERSION}/distribution/tar/generic/src/ EXTRACT_SUFX= .tar.bz2 +# Parts of kde want shared libraries to work, as some symbols are +# duplicated over the place. +NOT_FOR_ARCHS=${NO_SHARED_ARCHS} + USE_MOTIF= any LIB_DEPENDS= kdecore.3.::x11/kde/libs2 \ ldap.2::databases/openldap BUILD_DEPENDS= uic::x11/qt2-designer +BUILD_DEPENDS+= zsh:zsh-*:shells/zsh CONFIGURE_STYLE= gnu CONFIGURE_ARGS= --with-qt-includes=${LOCALBASE}/include/X11/qt2 @@ -37,8 +42,13 @@ CONFIGURE_ENV= MOC=${LOCALBASE}/bin/moc2 \ RUN_KAPPFINDER=no KDEDIR=${LOCALBASE} MAKE_ENV= ${CONFIGURE_ENV} +pre-build: + # Let zsh act as an sh replacement + ln -sf $(LOCALBASE)/bin/zsh ${WRKBUILD}/sh + # Ensure qt2 will always be at the front MAKE_FLAGS=CXXLD='--tag CXX ${CXX} -L${LOCALBASE}/lib/qt2' +MAKE_FLAGS+=LIBTOOL='$(WRKBUILD)/sh $(WRKBUILD)/libtool' # GPL PERMIT_DISTFILES_CDROM= Yes diff --git a/x11/kde/base2/patches/patch-aclocal_m4 b/x11/kde/base2/patches/patch-aclocal_m4 new file mode 100644 index 00000000000..13407192838 --- /dev/null +++ b/x11/kde/base2/patches/patch-aclocal_m4 @@ -0,0 +1,24 @@ +$OpenBSD: patch-aclocal_m4,v 1.1 2001/04/22 13:23:38 espie Exp $ +--- aclocal.m4.orig Sat Apr 21 18:03:55 2001 ++++ aclocal.m4 Sat Apr 21 18:04:15 2001 +@@ -4638,19 +4638,7 @@ netbsd*) + ;; + + openbsd* ) +- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then +- case "$host_cpu" in +- i*86 ) +- changequote(,)dnl +- lt_cv_deplibs_check_method='file_magic OpenBSD/i[3-9]86 demand paged shared library' +- changequote([, ])dnl +- lt_cv_file_magic_cmd=/usr/bin/file +- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` +- ;; +- esac +- else +- lt_cv_deplibs_check_method=pass_all +- fi ++ lt_cv_deplibs_check_method=pass_all + ;; + + newsos6) diff --git a/x11/kde/base2/patches/patch-admin_libtool_m4_in b/x11/kde/base2/patches/patch-admin_libtool_m4_in new file mode 100644 index 00000000000..7b432b9e366 --- /dev/null +++ b/x11/kde/base2/patches/patch-admin_libtool_m4_in @@ -0,0 +1,24 @@ +$OpenBSD: patch-admin_libtool_m4_in,v 1.1 2001/04/22 13:23:38 espie Exp $ +--- admin/libtool.m4.in.orig Sat Apr 21 18:03:05 2001 ++++ admin/libtool.m4.in Sat Apr 21 18:03:42 2001 +@@ -623,19 +623,7 @@ netbsd*) + ;; + + openbsd* ) +- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then +- case "$host_cpu" in +- i*86 ) +- changequote(,)dnl +- lt_cv_deplibs_check_method='file_magic OpenBSD/i[3-9]86 demand paged shared library' +- changequote([, ])dnl +- lt_cv_file_magic_cmd=/usr/bin/file +- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` +- ;; +- esac +- else +- lt_cv_deplibs_check_method=pass_all +- fi ++ lt_cv_deplibs_check_method=pass_all + ;; + + newsos6) diff --git a/x11/kde/base2/patches/patch-admin_ltcf-c_sh b/x11/kde/base2/patches/patch-admin_ltcf-c_sh new file mode 100644 index 00000000000..f490b4822ac --- /dev/null +++ b/x11/kde/base2/patches/patch-admin_ltcf-c_sh @@ -0,0 +1,20 @@ +$OpenBSD: patch-admin_ltcf-c_sh,v 1.1 2001/04/22 13:23:38 espie Exp $ +--- admin/ltcf-c.sh.orig Sat Apr 21 18:05:03 2001 ++++ admin/ltcf-c.sh Sat Apr 21 18:06:45 2001 +@@ -425,10 +425,14 @@ else + ;; + + openbsd*) +- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' +- hardcode_libdir_flag_spec='-R$libdir' ++ archive_cmds='$CC $pic_flag -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' ++ archive_expsym_cmds='$CC $pic_flag -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' ++ old_archive_cmds="$old_archive_cmds~"'$RANLIB $oldlib' ++ hardcode_libdir_flag_spec='${wl}-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no ++ remove_lgcc=yes ++ output_verbose_link_cmds='$CC $ac_cv_prog_cc_pic -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"' + ;; + + os2*) diff --git a/x11/kde/base2/patches/patch-admin_ltcf-cxx_sh b/x11/kde/base2/patches/patch-admin_ltcf-cxx_sh index 2840a21046d..3b3dcc5ad74 100644 --- a/x11/kde/base2/patches/patch-admin_ltcf-cxx_sh +++ b/x11/kde/base2/patches/patch-admin_ltcf-cxx_sh @@ -1,4 +1,4 @@ -$OpenBSD: patch-admin_ltcf-cxx_sh,v 1.4 2001/03/12 16:18:34 espie Exp $ +$OpenBSD: patch-admin_ltcf-cxx_sh,v 1.5 2001/04/22 13:23:38 espie Exp $ --- admin/ltcf-cxx.sh.orig Mon Feb 19 12:20:49 2001 +++ admin/ltcf-cxx.sh Sun Mar 11 15:42:15 2001 @@ -355,14 +355,14 @@ case "$host_os" in diff --git a/x11/kde/base2/patches/patch-admin_ltconfig b/x11/kde/base2/patches/patch-admin_ltconfig index 30c391f6f52..2c85b03b0a3 100644 --- a/x11/kde/base2/patches/patch-admin_ltconfig +++ b/x11/kde/base2/patches/patch-admin_ltconfig @@ -1,4 +1,4 @@ -$OpenBSD: patch-admin_ltconfig,v 1.3 2001/03/12 16:18:34 espie Exp $ +$OpenBSD: patch-admin_ltconfig,v 1.4 2001/04/22 13:23:38 espie Exp $ --- admin/ltconfig.orig Sat Mar 10 15:05:21 2001 +++ admin/ltconfig Sat Mar 10 15:07:50 2001 @@ -1162,6 +1162,8 @@ openbsd*) diff --git a/x11/kde/base2/patches/patch-kcontrol_thememgr_Makefile_in b/x11/kde/base2/patches/patch-kcontrol_thememgr_Makefile_in index 0b7eaad82d7..e84184ae0b4 100644 --- a/x11/kde/base2/patches/patch-kcontrol_thememgr_Makefile_in +++ b/x11/kde/base2/patches/patch-kcontrol_thememgr_Makefile_in @@ -1,7 +1,7 @@ -$OpenBSD: patch-kcontrol_thememgr_Makefile_in,v 1.2 2001/03/14 16:09:31 espie Exp $ ---- kcontrol/thememgr/Makefile.in.orig Thu Mar 8 20:36:41 2001 -+++ kcontrol/thememgr/Makefile.in Thu Mar 8 20:38:48 2001 -@@ -643,10 +643,13 @@ maintainer-clean-generic clean mostlycle +$OpenBSD: patch-kcontrol_thememgr_Makefile_in,v 1.3 2001/04/22 13:23:39 espie Exp $ +--- kcontrol/thememgr/Makefile.in.orig Tue Mar 20 18:01:18 2001 ++++ kcontrol/thememgr/Makefile.in Sun Apr 22 14:49:32 2001 +@@ -654,10 +654,13 @@ maintainer-clean-generic clean mostlycle install-data-local: diff --git a/x11/kde/base2/patches/patch-kcontrol_thememgr_Makefile_in.orig b/x11/kde/base2/patches/patch-kcontrol_thememgr_Makefile_in.orig new file mode 100644 index 00000000000..db66a83ead1 --- /dev/null +++ b/x11/kde/base2/patches/patch-kcontrol_thememgr_Makefile_in.orig @@ -0,0 +1,20 @@ +$OpenBSD: patch-kcontrol_thememgr_Makefile_in.orig,v 1.1 2001/04/22 13:23:39 espie Exp $ +--- kcontrol/thememgr/Makefile.in.orig Thu Mar 8 20:36:41 2001 ++++ kcontrol/thememgr/Makefile.in Thu Mar 8 20:38:48 2001 +@@ -643,10 +643,13 @@ maintainer-clean-generic clean mostlycle + + + install-data-local: +- cd $(srcdir)/Themes; \ ++ rm -rf $(srcdir)/Archive; \ ++ cp -rp $(srcdir)/Themes $(srcdir)/Archive; \ ++ find $(srcdir)/Archive -type d -name CVS -print -prune|xargs rm -rf; \ ++ cd $(srcdir)/Archive; \ + for f in *; do \ +- if [ -d $$f -a $$f != "CVS" ]; then \ +- tar --exclude CVS -b 16 -c -f - $$f | gzip -c > $(DESTDIR)$(themesdir)/$$f.ktheme; \ ++ if [ -d $$f ]; then \ ++ tar -b 16 -zcf $(DESTDIR)$(themesdir)/$$f.ktheme $$f; \ + fi; \ + done + diff --git a/x11/kde/base2/patches/patch-konsole_src_Makefile_am b/x11/kde/base2/patches/patch-konsole_src_Makefile_am new file mode 100644 index 00000000000..59cce208f62 --- /dev/null +++ b/x11/kde/base2/patches/patch-konsole_src_Makefile_am @@ -0,0 +1,11 @@ +$OpenBSD: patch-konsole_src_Makefile_am,v 1.1 2001/04/22 13:23:39 espie Exp $ +--- konsole/src/Makefile.am.orig Sun Apr 22 15:08:25 2001 ++++ konsole/src/Makefile.am Sun Apr 22 15:08:51 2001 +@@ -58,6 +58,7 @@ konsole_LDFLAGS = $(all_libraries) $(KDE + + konsole_grantpty_SOURCES = konsole_grantpty.c + konsole_grantpty_LDFLAGS = $(KDE_RPATH) ++konsole_grantpty_LIBADD = $(LIBUTIL) + + install-data-local: + @echo "" diff --git a/x11/kde/base2/patches/patch-konsole_src_Makefile_in b/x11/kde/base2/patches/patch-konsole_src_Makefile_in new file mode 100644 index 00000000000..a1f2458a9d1 --- /dev/null +++ b/x11/kde/base2/patches/patch-konsole_src_Makefile_in @@ -0,0 +1,20 @@ +$OpenBSD: patch-konsole_src_Makefile_in,v 1.1 2001/04/22 13:23:39 espie Exp $ +--- konsole/src/Makefile.in.orig Sun Apr 22 15:07:19 2001 ++++ konsole/src/Makefile.in Sun Apr 22 15:08:21 2001 +@@ -307,6 +307,7 @@ konsole_LDFLAGS = $(all_libraries) $(KDE + + konsole_grantpty_SOURCES = konsole_grantpty.c + konsole_grantpty_LDFLAGS = $(KDE_RPATH) ++konsole_grantpty_LIBADD = $(LIBUTIL) + + # Not AUTO here, because there are some unused files + #>- METASOURCES = TEWidget.moc TEmuVt102.moc session.moc konsole.moc TEmulation.moc TEPty.moc kwrited.moc konsole_part.moc +@@ -544,7 +545,7 @@ konsole$(EXEEXT): $(konsole_OBJECTS) $(k + + konsole_grantpty$(EXEEXT): $(konsole_grantpty_OBJECTS) $(konsole_grantpty_DEPENDENCIES) + @rm -f konsole_grantpty$(EXEEXT) +- $(LINK) $(konsole_grantpty_LDFLAGS) $(konsole_grantpty_OBJECTS) $(konsole_grantpty_LDADD) $(LIBS) ++ $(LINK) $(konsole_grantpty_LDFLAGS) $(konsole_grantpty_OBJECTS) $(konsole_grantpty_LDADD) $(konsole_grantpty_LIBADD) $(LIBS) + + kwrited$(EXEEXT): $(kwrited_OBJECTS) $(kwrited_DEPENDENCIES) + @rm -f kwrited$(EXEEXT) diff --git a/x11/kde/base2/patches/patch-konsole_src_TEPty_C b/x11/kde/base2/patches/patch-konsole_src_TEPty_C new file mode 100644 index 00000000000..aff6328c05b --- /dev/null +++ b/x11/kde/base2/patches/patch-konsole_src_TEPty_C @@ -0,0 +1,14 @@ +$OpenBSD: patch-konsole_src_TEPty_C,v 1.7 2001/04/22 13:23:39 espie Exp $ +--- konsole/src/TEPty.C.orig Sun Apr 22 15:06:36 2001 ++++ konsole/src/TEPty.C Sun Apr 22 15:07:12 2001 +@@ -126,6 +126,10 @@ extern "C" { + #include + #endif + ++#ifdef __OpenBSD__ ++/* Let konsole_grantpty do it */ ++# undef USE_LOGIN ++#endif + #include + + #ifdef HAVE_TERMIOS_H diff --git a/x11/kde/base2/patches/patch-konsole_src_konsole_grantpty_c b/x11/kde/base2/patches/patch-konsole_src_konsole_grantpty_c new file mode 100644 index 00000000000..0ec07105d97 --- /dev/null +++ b/x11/kde/base2/patches/patch-konsole_src_konsole_grantpty_c @@ -0,0 +1,75 @@ +$OpenBSD: patch-konsole_src_konsole_grantpty_c,v 1.1 2001/04/22 13:23:39 espie Exp $ +--- konsole/src/konsole_grantpty.c.orig Sun Apr 22 15:04:38 2001 ++++ konsole/src/konsole_grantpty.c Sun Apr 22 15:06:31 2001 +@@ -40,6 +40,11 @@ + # include + #endif + ++#ifdef __OpenBSD__ ++# include ++# include ++#endif ++ + #define PTY_FILENO 3 /* keep in sync with grantpty */ + #define TTY_GROUP "tty" + +@@ -52,6 +57,8 @@ int main (int argc, char *argv[]) + uid_t uid; + mode_t mod; + char* tty; ++ char* rtty; ++ int log_in; + + /* check preconditions **************************************************/ + if (argc != 2 || (strcmp(argv[1],"--grant") && strcmp(argv[1],"--revoke"))) +@@ -77,11 +84,13 @@ int main (int argc, char *argv[]) + { + uid = getuid(); /* current user id */ + mod = S_IRUSR|S_IWUSR|S_IWGRP; ++ log_in = 1; + } + else + { + uid = 0; /* root */ + mod = S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH; ++ log_in = 0; + } + /* Get the group ID of the special `tty' group. */ + p = getgrnam(TTY_GROUP); /* posix */ +@@ -175,5 +184,36 @@ int main (int argc, char *argv[]) + return 1; /* FAIL */ + } + ++#ifdef __OpenBSD__ ++ /* Make sure the tty is fd 0, to help login work */ ++ dup2(open(tty, O_RDWR), 0); ++ rtty = strrchr(tty, '/'); ++ if (rtty) ++ rtty++; ++ else ++ rtty = tty; ++ if (log_in) ++ { ++ char *str_ptr; ++ struct utmp l_struct; ++ memset(&l_struct, 0, sizeof(struct utmp)); ++ ++ if (! (str_ptr=getlogin()) ) { ++ return 1; ++ } ++ strncpy(l_struct.ut_name, str_ptr, UT_NAMESIZE); ++ ++ if (gethostname(l_struct.ut_host, UT_HOSTSIZE) == -1) { ++ if (errno != ENOMEM) ++ return 1; ++ l_struct.ut_host[UT_HOSTSIZE]=0; ++ } ++ ++ strncpy(l_struct.ut_line, rtty, UT_LINESIZE); ++ time(&l_struct.ut_time); ++ login(&l_struct); ++ } else ++ logout(rtty); ++#endif + return 0; /* OK */ + } diff --git a/x11/kde/base2/patches/patch-konsole_src_main_C b/x11/kde/base2/patches/patch-konsole_src_main_C deleted file mode 100644 index 04e79c2c817..00000000000 --- a/x11/kde/base2/patches/patch-konsole_src_main_C +++ /dev/null @@ -1,12 +0,0 @@ ---- konsole/src/main.C.orig Sun Feb 18 16:28:29 2001 -+++ konsole/src/main.C Tue Mar 6 21:52:42 2001 -@@ -67,7 +67,9 @@ public: - /* --| main |------------------------------------------------------ */ - int main(int argc, char* argv[]) - { -+#ifndef __OpenBSD__ - setuid(getuid()); setgid(getgid()); // drop privileges -+#endif - - // deal with shell/command //////////////////////////// - bool login_shell = false; diff --git a/x11/kde/base2/pkg/PLIST b/x11/kde/base2/pkg/PLIST index 88b199c4f0e..32509eb3549 100644 --- a/x11/kde/base2/pkg/PLIST +++ b/x11/kde/base2/pkg/PLIST @@ -1,15 +1,10 @@ -@comment $OpenBSD: PLIST,v 1.14 2001/03/30 12:32:07 espie Exp $ +@comment $OpenBSD: PLIST,v 1.15 2001/04/22 13:23:40 espie Exp $ @mode u+s @owner root bin/konsole_grantpty bin/kcheckpass @mode @owner -@group utmp -@mode g+s -bin/konsole -@group -@mode bin/appletproxy bin/chooser bin/conttest