Rework config patches somewhat so they might work on non-NetBSD.

Attempt to honor VARBASE instead of blithely dropping stuff into /var;
may be incomplete. Doing this right may require sorting out multiple
/var trees as it shouldn't, at least by default, be working dialer
locks in the pkgsrc VARBASE; however, it's not clear that those will
always necessarily be in /var either. For now the package assumes
they will be though.

*** If I have broken this for you, please let me know ASAP.
This commit is contained in:
dholland 2012-04-08 00:47:26 +00:00
parent 3638940ec7
commit 5327375d60
4 changed files with 123 additions and 37 deletions

View file

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.78 2012/04/07 23:51:00 dholland Exp $
# $NetBSD: Makefile,v 1.79 2012/04/08 00:47:26 dholland Exp $
DISTNAME= mgetty1.1.37-Jun05
PKGNAME= mgetty-1.1.37
@ -22,8 +22,10 @@ PKG_DESTDIR_SUPPORT= destdir
WRKSRC= ${WRKDIR}/${PKGNAME_NOREV}
MAKE_ENV+= MGETTY_CONFDIR=${PKG_SYSCONFDIR:Q} PERL5=${PERL5:Q}
MAKE_ENV+= ROOT_USER=${ROOT_USER:Q} ROOT_GROUP=${ROOT_GROUP}
MAKE_ENV+= ROOT_USER=${ROOT_USER:Q}
MAKE_ENV+= ROOT_GROUP=${ROOT_GROUP:Q}
MAKE_FLAGS+= prefix=${DESTDIR:Q}${PREFIX:Q} \
spool=${VARBASE}/spool \
INFODIR=${DESTDIR:Q}${PREFIX:Q}/${PKGINFODIR:Q} \
MAN1DIR=${DESTDIR:Q}${PREFIX:Q}/${PKGMANDIR:Q}/man1\
MAN4DIR=${DESTDIR:Q}${PREFIX:Q}/${PKGMANDIR:Q}/man4\
@ -35,7 +37,7 @@ INSTALL_MAKE_FLAGS= ${MAKE_FLAGS} CONFDIR=${DESTDIR:Q}${EXAMPLES_DIR:Q}
BUILD_MAKE_FLAGS= ${MAKE_FLAGS:S,${DESTDIR},,} CONFDIR=${PKG_SYSCONFDIR:Q}
CFLAGS.SunOS+= -Dsolaris2
CFLAGS+= -DDEVICE_GROUP=${ROOT_GROUP}
CFLAGS+= -DDEVICE_GROUP=\"${ROOT_GROUP}\"
.include "../../mk/bsd.prefs.mk"
.if ${OPSYS} != "SunOS"
@ -47,6 +49,13 @@ USE_TOOLS+= makeinfo perl:run
INFO_FILES= yes
PKG_SYSCONFSUBDIR= mgetty+sendfax
PKG_GROUPS= dialer
PKG_USERS= fax:dialer
USERGROUP_PHASE= pre-install
EXAMPLES_DIR= ${PREFIX}/share/examples/mgetty+sendfax
SPOOL_DIR= ${VARBASE}/spool/fax
.for cfg in dialin.config \
faxheader \
faxrunq.config \
@ -58,19 +67,17 @@ PKG_SYSCONFSUBDIR= mgetty+sendfax
CONF_FILES+= ${EXAMPLES_DIR}/${cfg} ${PKG_SYSCONFDIR}/${cfg}
.endfor
PKG_GROUPS= dialer
PKG_USERS= fax:dialer
ROOT_DIR_PERMS= ${ROOT_USER} ${ROOT_GROUP} 755
FAX_DIR_PERMS= fax ${ROOT_GROUP} 755
USERGROUP_PHASE= pre-install
EXAMPLES_DIR= ${PREFIX}/share/examples/mgetty+sendfax
OWN_DIRS_PERMS+= /var/spool/fax ${ROOT_USER} ${ROOT_GROUP} 755
OWN_DIRS_PERMS+= /var/spool/fax/incoming ${ROOT_USER} ${ROOT_GROUP} 755
OWN_DIRS_PERMS+= /var/spool/fax/outgoing fax ${ROOT_GROUP} 755
OWN_DIRS_PERMS+= ${SPOOL_DIR} ${ROOT_DIR_PERMS}
OWN_DIRS_PERMS+= ${SPOOL_DIR}/incoming ${ROOT_DIR_PERMS}
OWN_DIRS_PERMS+= ${SPOOL_DIR}/outgoing ${FAX_DIR_PERMS}
SUBST_CLASSES+= prefix
SUBST_FILES.prefix= faxrunq.config policy.h
SUBST_FILES.prefix= faxrunq.config
SUBST_SED.prefix= -e 's|/usr/local|${PREFIX}|'
SUBST_SED.prefix+= -e 's|/var/log|${VARBASE}/log|'
SUBST_STAGE.prefix= pre-configure
SUBST_MESSAGE.prefix= Fixing hardcoded installation prefix.

View file

@ -1,16 +1,16 @@
$NetBSD: distinfo,v 1.34 2012/04/08 00:04:12 dholland Exp $
$NetBSD: distinfo,v 1.35 2012/04/08 00:47:27 dholland Exp $
SHA1 (mgetty1.1.37-Jun05.tar.gz) = fec9672e8be29a41f1392c6bf90c0d5732cdb2c2
RMD160 (mgetty1.1.37-Jun05.tar.gz) = 56aa9e213e4bd79c13ace2b7222253d91e756865
Size (mgetty1.1.37-Jun05.tar.gz) = 1057939 bytes
SHA1 (patch-aa) = f80c4e7f7eb23eac7ee23c2144612b82c122d45f
SHA1 (patch-ab) = d40fab74e361c15cb525705de0c6d986ed599b71
SHA1 (patch-ab) = 84976f4834494193a4d0f2fe90ee6963a056d346
SHA1 (patch-ac) = bdc69ccc3430634bb74742fd105ee8f3fcde4d21
SHA1 (patch-ad) = f02a92a3a9a46fe71d7541897da24470e38f68c7
SHA1 (patch-af) = 088be22c69f39ca099cbe497b7e845bf103bf1c7
SHA1 (patch-ag) = f12e39005c78a94f641ccbdbbfa51b5181821148
SHA1 (patch-ah) = 0a3e5b1375eb36610e6a97113a8e535bf2fd1c6b
SHA1 (patch-ai) = 10592bbc86db1c362c7af93369087fd9d41fa47c
SHA1 (patch-ai) = 31c028c99e7f3e3aea37e271b6cec55b81df4421
SHA1 (patch-aj) = 37d88c1a4f8d5826f7113dd120c32e89cc442e5d
SHA1 (patch-ak) = 18f9570f35909089a4083fa24903dfea14dcc475
SHA1 (patch-al) = 2a6dcf13d65446d2064228b1024517e599892a60

View file

@ -1,4 +1,8 @@
$NetBSD: patch-ab,v 1.13 2012/02/16 17:29:25 hans Exp $
$NetBSD: patch-ab,v 1.14 2012/04/08 00:47:27 dholland Exp $
- configure for pkgsrc
- honor VARBASE
- add vgetty to build
--- Makefile.orig 2010-06-05 09:48:22.000000000 +0000
+++ Makefile
@ -18,7 +22,7 @@ $NetBSD: patch-ab,v 1.13 2012/02/16 17:29:25 hans Exp $
#
#CFLAGS=-Wall -O2 -pipe -DSECUREWARE -DUSE_POLL
-CFLAGS=-O2 -Wall -pipe
+CFLAGS+=-O2 -Wall -pipe -DPREFIX=\"${PREFIX}\"
+CFLAGS+=-O2 -Wall -pipe -DPREFIX=\"${PREFIX}\" -DVARBASE=\"${VARBASE}\"
#CFLAGS=-O -DSVR4
#CFLAGS=-O -DSVR4 -DSVR42
#CFLAGS=-O -DUSE_POLL

View file

@ -1,15 +1,37 @@
$NetBSD: patch-ai,v 1.8 2012/04/08 00:04:12 dholland Exp $
$NetBSD: patch-ai,v 1.9 2012/04/08 00:47:27 dholland Exp $
- improve default configuration behavior for the modern world
- configure for pkgsrc
- DEVICE_GROUP is set from the pkgsrc makefile, so avoid compiler
warnings by not defining it again when it's already set.
warnings by not defining it again when it's already set.
- honor PREFIX and VARBASE in paths
- turn on AUTO_PPP (whatever that is...?)
- configure paths for pkgsrc.
- ...?
--- policy.h.orig 2012-04-07 23:59:02.000000000 +0000
--- policy.h.orig 2012-04-08 00:19:33.000000000 +0000
+++ policy.h
@@ -114,7 +114,9 @@
@@ -48,7 +48,12 @@
* Normally, this is "/bin/login", just a few systems put "login"
* elsewhere (e.g. Free/NetBSD in "/usr/bin/login").
*/
+#if defined(__NetBSD__) || defined(__FreeBSD__) ||\
+ defined(__OpenBSD__) || defined (__DragonFly__)
+#define DEFAULT_LOGIN_PROGRAM "/usr/bin/login"
+#else
#define DEFAULT_LOGIN_PROGRAM "/bin/login"
+#endif
/* FidoNet mailer support
*
@@ -86,7 +91,7 @@
* If the path doesn't start with "/", it's relative to CONFDIR.
*/
/* #define CNDFILE "dialin.config" */
-
+#define CNDFILE "dialin.config"
/* If you want to use /etc/gettydefs to set tty flags, define this
* I recommend against it, I suspect some bugs lingering in that code
@@ -114,7 +119,9 @@
/* group id that the device is chown()ed to. If not defined, the
* primary group of "DEVICE_OWNER" is used.
*/
@ -19,29 +41,82 @@ warnings by not defining it again when it's already set.
/* access mode for the line while getty has it - it should be accessible
* by uucp / uucp, but not by others (imagine someone dialing into your
@@ -593,6 +595,21 @@
@@ -147,7 +154,7 @@
*
* if the directory does not exist, the log file goes to CONSOLE (!)
*/
-#define LOG_PATH "/var/log/mgetty.%s"
+#define LOG_PATH VARBASE "/log/mgetty.%s"
/* Default log error level threshold. Possible error levels are
* L_FATAL, L_ERROR, L_AUDIT, L_WARN, L_MESG, L_NOISE, L_JUNK (see mgetty.h)
@@ -233,6 +240,7 @@
*/
/* for a few systems, you can just take those defaults and be happy */
+/* pkgsrc note: these should *not* use VARBASE */
#if defined (SVR4) || defined(sunos4)
# define LOCK_PATH "/var/spool/locks"
# define LOCK "/var/spool/locks/LCK..%s"
@@ -459,7 +467,8 @@
* watch out: if you run 'sendfax' as non-privileged user (user 'fax' etc.)
* you might need to create this file manually and chown it to 'fax'
*/
-#define FAX_LOG "/var/log/sendfax.log"
+/*#define FAX_LOG "/var/log/sendfax.log" */ /* original */
+#define FAX_LOG VARBASE "/spool/fax/Faxlog"
/* local station ID (your fax number)
* 20 character string, most faxmodem allow all ascii characters 32..127,
@@ -552,20 +561,15 @@
*/
#ifdef SVR4
# define MAILER "/usr/bin/mailx -s 'Incoming facsimile message'"
-#else
-# if defined(_AIX) || defined(__NetBSD__) || defined(linux)
-# define MAILER "/usr/sbin/sendmail"
-# define NEED_MAIL_HEADERS
-# endif
-# ifdef M_UNIX /* SCO */
-# define MAILER "/usr/lib/mail/execmail"
-# define NEED_MAIL_HEADERS
-# endif
-#endif
-
-#ifndef MAILER
+#elif defined(M_UNIX) /* SCO */
+# define MAILER "/usr/lib/mail/execmail"
+# define NEED_MAIL_HEADERS
+#elif defined(__IRIX__)
# define MAILER "/usr/lib/sendmail"
# define NEED_MAIL_HEADERS
+#else /* modern standard -- AIX, *BSD, Linux, etc. */
+# define MAILER "/usr/sbin/sendmail"
+# define NEED_MAIL_HEADERS
#endif
/* where to send notify mail about incoming faxes to
@@ -586,13 +590,18 @@
* If you don't want this type of service, do not define it at all
* Absolute path name has to be used here!
*/
-#define FAX_NOTIFY_PROGRAM "/usr/local/lib/mgetty+sendfax/new_fax"
+#define FAX_NOTIFY_PROGRAM PREFIX "/lib/mgetty+sendfax/new_fax"
/* default minimum space required on spooling partition for receiving a FAX
* (in KILObytes)
*/
#define MINFREESPACE 1024
+#undef DEFAULT_LOGIN_PROGRAM
+#define DEFAULT_LOGIN_PROGRAM "/usr/bin/login"
+
+#define CNDFILE "dialin.config"
+
+#undef MGETTY_PID_FILE
+#define MGETTY_PID_FILE "/var/run/mg-pid.%s"
+
+#undef FAX_LOG
+#define FAX_LOG "/var/spool/fax/Faxlog"
+
+#undef MAILER
+#define MAILER "/usr/sbin/sendmail"
+
+#undef DEVICE_GROUP
/* fax machines exchange so-called "non-standard-frames" that can be
* used to identify what vendor and model is on the other end.
* mgetty parses and prints this by default, because it can help
@@ -601,3 +618,4 @@
@@ -601,3 +610,4 @@
*/
#define FAX_NSF_PARSER