diff --git a/sysutils/doinkd/Makefile b/sysutils/doinkd/Makefile index b43ae3b8c841..813c67bc1bee 100644 --- a/sysutils/doinkd/Makefile +++ b/sysutils/doinkd/Makefile @@ -23,10 +23,20 @@ USE_RC_SUBR= ${PORTNAME} PLIST_FILES= etc/idled.cf.template libexec/idled +.include + +.if ${OSVERSION} > 900006 +EXTRA_PATCHES= ${PATCHDIR}/utmpx-Makefile \ + ${PATCHDIR}/utmpx-idled.h \ + ${PATCHDIR}/utmpx-idled.c +.else +EXTRA_PATCHES= ${PATCHDIR}/utmp-Makefile +.endif + post-extract: (cd ${WRKSRC}; make clean) post-install: @${STRIP_CMD} ${PREFIX}/libexec/idled -.include +.include diff --git a/sysutils/doinkd/files/patch-Makefile b/sysutils/doinkd/files/utmp-Makefile similarity index 100% rename from sysutils/doinkd/files/patch-Makefile rename to sysutils/doinkd/files/utmp-Makefile diff --git a/sysutils/doinkd/files/utmpx-Makefile b/sysutils/doinkd/files/utmpx-Makefile new file mode 100644 index 000000000000..f644fa8ef978 --- /dev/null +++ b/sysutils/doinkd/files/utmpx-Makefile @@ -0,0 +1,105 @@ +--- Makefile.orig 1996-05-16 15:05:28.000000000 -0700 ++++ Makefile 2010-01-25 16:08:20.000000000 -0800 +@@ -2,8 +2,8 @@ + # + + # C compiler flags +-CC = cc +-RM = rm ++CC ?= cc ++RM ?= rm + INCLUDE = + + ###################################################################### +@@ -166,26 +166,26 @@ + # You will need to delete parse.c before compiling! You can either + # do so by hand, or do a 'make clean' followed by the normal 'make'. + #DEFS += -O -m486 +-#DEFS += -DBSD_OS2 -DHAVE_SETSID -DHAVE_YYRESTART -DPS_HACK ++DEFS += -DBSD_OS2 -DHAVE_SETSID -DHAVE_YYRESTART -DPS_HACK -DHAVE_UTMPX -DSYSV + #DEFS += -DPROC_SEARCH_1 + #SPECLIBS = -lkvm +-#INSTTYPE = install1a ++INSTTYPE = install1a + # +-#DEST = /usr/local/libexec +-#CFDEST = /usr/local/libexec +-#MDEST = /usr/local/man +-#LOGDEST = /var/log ++DEST = ${PREFIX}/libexec ++CFDEST = ${PREFIX}/etc ++MDEST = ${PREFIX}/man ++LOGDEST = /var/log + # +-#OWNER = root +-#CFOWNER = root +-#MOWNER = man ++OWNER = root ++CFOWNER = root ++MOWNER = man + # +-#GROUP = daemon +-#CFGROUP = daemon ++GROUP = daemon ++CFGROUP = daemon + # +-#MODE = 750 +-#CFMODE = 664 +-#MMODE = 444 ++MODE = 750 ++CFMODE = 644 ++MMODE = 444 + + ###################################################################### + ###################################################################### +@@ -215,25 +215,25 @@ + # SVR4 -- Solaris 2.x + # Use install3 for /usr/sbin/install + # and install1 for /usr/ucb/install +-DEFS += -DSYSV -DHAVE_PROC_FS -DUTMPPID -DHAVE_SETSID -DHAVE_UTMPX -DUTMPHOST -DRUDEKILL +-SPECLIBS = +-INSTTYPE = install3 +- +-DEST = /usr/local/bin +-CFDEST = /usr/local/lib +-MDEST = /usr/local/man +-LOGDEST = /var/log ++#DEFS += -DSYSV -DHAVE_PROC_FS -DUTMPPID -DHAVE_SETSID -DHAVE_UTMPX -DUTMPHOST -DRUDEKILL ++#SPECLIBS = ++#INSTTYPE = install3 + +-OWNER = root +-CFOWNER = root +-MOWNER = root ++#DEST = /usr/local/bin ++#CFDEST = /usr/local/lib ++#MDEST = /usr/local/man ++#LOGDEST = /var/log ++ ++#OWNER = root ++#CFOWNER = root ++#MOWNER = root + +-GROUP = root +-CFGROUP = root ++#GROUP = root ++#CFGROUP = root + +-MODE = 750 +-CFMODE = 664 +-MMODE = 644 ++#MODE = 750 ++#CFMODE = 664 ++#MMODE = 644 + + ###################################################################### + ###################################################################### +@@ -428,7 +428,7 @@ + # HERE are the big CFLAGS + # Add -g if you want debugging + # Add -O or whatever variant for optimization +-CFLAGS = ${DEFS} ${DEBUG} -DCONFIG=\"${CONFIG}\" -DLOGFILE=\"${LOGFILE}\" ${INCLUDE} ++CFLAGS+= ${DEFS} ${DEBUG} -DCONFIG=\"${CONFIG}\" -DLOGFILE=\"${LOGFILE}\" ${INCLUDE} + + # For HP's ANSI C compiler (use -g instead of +O3 for debugging) + # CFLAGS = +O3 -Aa -D_HPUX_SOURCE ${DEFS} ${DEBUG} -DCONFIG=\"${CONFIG}\" -DLOGFILE=\"${LOGFILE}\" ${INCLUDE} diff --git a/sysutils/doinkd/files/utmpx-doinkd.c b/sysutils/doinkd/files/utmpx-doinkd.c new file mode 100644 index 000000000000..8606b3c461e2 --- /dev/null +++ b/sysutils/doinkd/files/utmpx-doinkd.c @@ -0,0 +1,33 @@ +--- idled.c.orig 2010-01-25 16:06:48.000000000 -0800 ++++ idled.c 2010-01-25 16:09:39.000000000 -0800 +@@ -335,7 +335,7 @@ + if (strcmp(utmpbuf.ut_line,XDM_DEV) == 0) + { + /* This is the console. Is there a real name attached? */ +- if (strlen(utmpbuf.ut_name) > 0) ++ if (strlen(utmpbuf.ut_user) > 0) + isConsole = TRUE; /* Yes, use it */ + else + strcpy(console_user,""); /* No, clear the console user */ +@@ -349,10 +349,10 @@ + #endif /* SYSV */ + { + user = &users[utmptr]; +- (void) strncpy (tmpname, utmpbuf.ut_name, NAMELEN); ++ (void) strncpy (tmpname, utmpbuf.ut_user, NAMELEN); + tmpname[NAMELEN] = 0; + +- if (!strcmp (user->uid, tmpname) && user->time_on == utmpbuf.ut_xtime) ++ if (!strcmp (user->uid, tmpname) && user->time_on == utmpbuf.ut_tv.tv_sec) + { + if (new) + setlimits (utmptr); +@@ -402,7 +402,7 @@ + logfile ("Error: could not get info on supposed user %s.",user->uid); + else + getgroups_func (pswd->pw_name, user->groups, pswd->pw_gid); +- user->time_on = utmpbuf.ut_xtime; ++ user->time_on = utmpbuf.ut_tv.tv_sec; + setlimits (utmptr); + user->next = tempus; + chk_session_refuse(user); diff --git a/sysutils/doinkd/files/utmpx-doinkd.h b/sysutils/doinkd/files/utmpx-doinkd.h new file mode 100644 index 000000000000..13a2ef1f79b4 --- /dev/null +++ b/sysutils/doinkd/files/utmpx-doinkd.h @@ -0,0 +1,10 @@ +--- idled.h.orig 2010-01-25 16:07:42.000000000 -0800 ++++ idled.h 2010-01-25 16:07:50.000000000 -0800 +@@ -1,7 +1,6 @@ + #include + #include + #include +-#include + + #define qelem qelem_sys /* Work around to use our own qelem below */ + #include diff --git a/sysutils/doinkd/files/utmpx-idled.c b/sysutils/doinkd/files/utmpx-idled.c new file mode 100644 index 000000000000..8606b3c461e2 --- /dev/null +++ b/sysutils/doinkd/files/utmpx-idled.c @@ -0,0 +1,33 @@ +--- idled.c.orig 2010-01-25 16:06:48.000000000 -0800 ++++ idled.c 2010-01-25 16:09:39.000000000 -0800 +@@ -335,7 +335,7 @@ + if (strcmp(utmpbuf.ut_line,XDM_DEV) == 0) + { + /* This is the console. Is there a real name attached? */ +- if (strlen(utmpbuf.ut_name) > 0) ++ if (strlen(utmpbuf.ut_user) > 0) + isConsole = TRUE; /* Yes, use it */ + else + strcpy(console_user,""); /* No, clear the console user */ +@@ -349,10 +349,10 @@ + #endif /* SYSV */ + { + user = &users[utmptr]; +- (void) strncpy (tmpname, utmpbuf.ut_name, NAMELEN); ++ (void) strncpy (tmpname, utmpbuf.ut_user, NAMELEN); + tmpname[NAMELEN] = 0; + +- if (!strcmp (user->uid, tmpname) && user->time_on == utmpbuf.ut_xtime) ++ if (!strcmp (user->uid, tmpname) && user->time_on == utmpbuf.ut_tv.tv_sec) + { + if (new) + setlimits (utmptr); +@@ -402,7 +402,7 @@ + logfile ("Error: could not get info on supposed user %s.",user->uid); + else + getgroups_func (pswd->pw_name, user->groups, pswd->pw_gid); +- user->time_on = utmpbuf.ut_xtime; ++ user->time_on = utmpbuf.ut_tv.tv_sec; + setlimits (utmptr); + user->next = tempus; + chk_session_refuse(user); diff --git a/sysutils/doinkd/files/utmpx-idled.h b/sysutils/doinkd/files/utmpx-idled.h new file mode 100644 index 000000000000..13a2ef1f79b4 --- /dev/null +++ b/sysutils/doinkd/files/utmpx-idled.h @@ -0,0 +1,10 @@ +--- idled.h.orig 2010-01-25 16:07:42.000000000 -0800 ++++ idled.h 2010-01-25 16:07:50.000000000 -0800 +@@ -1,7 +1,6 @@ + #include + #include + #include +-#include + + #define qelem qelem_sys /* Work around to use our own qelem below */ + #include diff --git a/sysutils/idled/Makefile b/sysutils/idled/Makefile index b43ae3b8c841..813c67bc1bee 100644 --- a/sysutils/idled/Makefile +++ b/sysutils/idled/Makefile @@ -23,10 +23,20 @@ USE_RC_SUBR= ${PORTNAME} PLIST_FILES= etc/idled.cf.template libexec/idled +.include + +.if ${OSVERSION} > 900006 +EXTRA_PATCHES= ${PATCHDIR}/utmpx-Makefile \ + ${PATCHDIR}/utmpx-idled.h \ + ${PATCHDIR}/utmpx-idled.c +.else +EXTRA_PATCHES= ${PATCHDIR}/utmp-Makefile +.endif + post-extract: (cd ${WRKSRC}; make clean) post-install: @${STRIP_CMD} ${PREFIX}/libexec/idled -.include +.include diff --git a/sysutils/idled/files/patch-Makefile b/sysutils/idled/files/utmp-Makefile similarity index 100% rename from sysutils/idled/files/patch-Makefile rename to sysutils/idled/files/utmp-Makefile diff --git a/sysutils/idled/files/utmpx-Makefile b/sysutils/idled/files/utmpx-Makefile new file mode 100644 index 000000000000..f644fa8ef978 --- /dev/null +++ b/sysutils/idled/files/utmpx-Makefile @@ -0,0 +1,105 @@ +--- Makefile.orig 1996-05-16 15:05:28.000000000 -0700 ++++ Makefile 2010-01-25 16:08:20.000000000 -0800 +@@ -2,8 +2,8 @@ + # + + # C compiler flags +-CC = cc +-RM = rm ++CC ?= cc ++RM ?= rm + INCLUDE = + + ###################################################################### +@@ -166,26 +166,26 @@ + # You will need to delete parse.c before compiling! You can either + # do so by hand, or do a 'make clean' followed by the normal 'make'. + #DEFS += -O -m486 +-#DEFS += -DBSD_OS2 -DHAVE_SETSID -DHAVE_YYRESTART -DPS_HACK ++DEFS += -DBSD_OS2 -DHAVE_SETSID -DHAVE_YYRESTART -DPS_HACK -DHAVE_UTMPX -DSYSV + #DEFS += -DPROC_SEARCH_1 + #SPECLIBS = -lkvm +-#INSTTYPE = install1a ++INSTTYPE = install1a + # +-#DEST = /usr/local/libexec +-#CFDEST = /usr/local/libexec +-#MDEST = /usr/local/man +-#LOGDEST = /var/log ++DEST = ${PREFIX}/libexec ++CFDEST = ${PREFIX}/etc ++MDEST = ${PREFIX}/man ++LOGDEST = /var/log + # +-#OWNER = root +-#CFOWNER = root +-#MOWNER = man ++OWNER = root ++CFOWNER = root ++MOWNER = man + # +-#GROUP = daemon +-#CFGROUP = daemon ++GROUP = daemon ++CFGROUP = daemon + # +-#MODE = 750 +-#CFMODE = 664 +-#MMODE = 444 ++MODE = 750 ++CFMODE = 644 ++MMODE = 444 + + ###################################################################### + ###################################################################### +@@ -215,25 +215,25 @@ + # SVR4 -- Solaris 2.x + # Use install3 for /usr/sbin/install + # and install1 for /usr/ucb/install +-DEFS += -DSYSV -DHAVE_PROC_FS -DUTMPPID -DHAVE_SETSID -DHAVE_UTMPX -DUTMPHOST -DRUDEKILL +-SPECLIBS = +-INSTTYPE = install3 +- +-DEST = /usr/local/bin +-CFDEST = /usr/local/lib +-MDEST = /usr/local/man +-LOGDEST = /var/log ++#DEFS += -DSYSV -DHAVE_PROC_FS -DUTMPPID -DHAVE_SETSID -DHAVE_UTMPX -DUTMPHOST -DRUDEKILL ++#SPECLIBS = ++#INSTTYPE = install3 + +-OWNER = root +-CFOWNER = root +-MOWNER = root ++#DEST = /usr/local/bin ++#CFDEST = /usr/local/lib ++#MDEST = /usr/local/man ++#LOGDEST = /var/log ++ ++#OWNER = root ++#CFOWNER = root ++#MOWNER = root + +-GROUP = root +-CFGROUP = root ++#GROUP = root ++#CFGROUP = root + +-MODE = 750 +-CFMODE = 664 +-MMODE = 644 ++#MODE = 750 ++#CFMODE = 664 ++#MMODE = 644 + + ###################################################################### + ###################################################################### +@@ -428,7 +428,7 @@ + # HERE are the big CFLAGS + # Add -g if you want debugging + # Add -O or whatever variant for optimization +-CFLAGS = ${DEFS} ${DEBUG} -DCONFIG=\"${CONFIG}\" -DLOGFILE=\"${LOGFILE}\" ${INCLUDE} ++CFLAGS+= ${DEFS} ${DEBUG} -DCONFIG=\"${CONFIG}\" -DLOGFILE=\"${LOGFILE}\" ${INCLUDE} + + # For HP's ANSI C compiler (use -g instead of +O3 for debugging) + # CFLAGS = +O3 -Aa -D_HPUX_SOURCE ${DEFS} ${DEBUG} -DCONFIG=\"${CONFIG}\" -DLOGFILE=\"${LOGFILE}\" ${INCLUDE} diff --git a/sysutils/idled/files/utmpx-idled.c b/sysutils/idled/files/utmpx-idled.c new file mode 100644 index 000000000000..8606b3c461e2 --- /dev/null +++ b/sysutils/idled/files/utmpx-idled.c @@ -0,0 +1,33 @@ +--- idled.c.orig 2010-01-25 16:06:48.000000000 -0800 ++++ idled.c 2010-01-25 16:09:39.000000000 -0800 +@@ -335,7 +335,7 @@ + if (strcmp(utmpbuf.ut_line,XDM_DEV) == 0) + { + /* This is the console. Is there a real name attached? */ +- if (strlen(utmpbuf.ut_name) > 0) ++ if (strlen(utmpbuf.ut_user) > 0) + isConsole = TRUE; /* Yes, use it */ + else + strcpy(console_user,""); /* No, clear the console user */ +@@ -349,10 +349,10 @@ + #endif /* SYSV */ + { + user = &users[utmptr]; +- (void) strncpy (tmpname, utmpbuf.ut_name, NAMELEN); ++ (void) strncpy (tmpname, utmpbuf.ut_user, NAMELEN); + tmpname[NAMELEN] = 0; + +- if (!strcmp (user->uid, tmpname) && user->time_on == utmpbuf.ut_xtime) ++ if (!strcmp (user->uid, tmpname) && user->time_on == utmpbuf.ut_tv.tv_sec) + { + if (new) + setlimits (utmptr); +@@ -402,7 +402,7 @@ + logfile ("Error: could not get info on supposed user %s.",user->uid); + else + getgroups_func (pswd->pw_name, user->groups, pswd->pw_gid); +- user->time_on = utmpbuf.ut_xtime; ++ user->time_on = utmpbuf.ut_tv.tv_sec; + setlimits (utmptr); + user->next = tempus; + chk_session_refuse(user); diff --git a/sysutils/idled/files/utmpx-idled.h b/sysutils/idled/files/utmpx-idled.h new file mode 100644 index 000000000000..13a2ef1f79b4 --- /dev/null +++ b/sysutils/idled/files/utmpx-idled.h @@ -0,0 +1,10 @@ +--- idled.h.orig 2010-01-25 16:07:42.000000000 -0800 ++++ idled.h 2010-01-25 16:07:50.000000000 -0800 +@@ -1,7 +1,6 @@ + #include + #include + #include +-#include + + #define qelem qelem_sys /* Work around to use our own qelem below */ + #include