From 12499fc400b91ff19771e4509013c779ead3ae38 Mon Sep 17 00:00:00 2001 From: jcs Date: Mon, 9 May 2005 16:50:05 +0000 Subject: [PATCH] - drop to _asterisk user/group by default - move some files around and change file/directory owners to support this - bump pkgname ok mr. jolan@ --- telephony/asterisk/Makefile | 3 ++- telephony/asterisk/patches/patch-Makefile | 4 ++-- telephony/asterisk/patches/patch-asterisk_c | 24 ++++++++++++++++++--- telephony/asterisk/patches/patch-asterisk_h | 6 +++--- telephony/asterisk/pkg/PLIST | 12 ++++++++--- 5 files changed, 37 insertions(+), 12 deletions(-) diff --git a/telephony/asterisk/Makefile b/telephony/asterisk/Makefile index 8ac8291c23b..264ce24d3e8 100644 --- a/telephony/asterisk/Makefile +++ b/telephony/asterisk/Makefile @@ -1,7 +1,8 @@ -# $OpenBSD: Makefile,v 1.3 2005/05/01 02:12:46 jcs Exp $ +# $OpenBSD: Makefile,v 1.4 2005/05/09 16:50:05 jcs Exp $ COMMENT= "open source PBX" DISTNAME= asterisk-1.0.7 +PKGNAME= ${DISTNAME}p0 CATEGORIES= telephony MASTER_SITES= ftp://ftp.asterisk.org/pub/telephony/asterisk/ \ http://mirrors.protection.cx/~jolan/ diff --git a/telephony/asterisk/patches/patch-Makefile b/telephony/asterisk/patches/patch-Makefile index 5f235b5ae50..be3739409d4 100644 --- a/telephony/asterisk/patches/patch-Makefile +++ b/telephony/asterisk/patches/patch-Makefile @@ -1,4 +1,4 @@ -$OpenBSD: patch-Makefile,v 1.2 2005/05/01 02:12:47 jcs Exp $ +$OpenBSD: patch-Makefile,v 1.3 2005/05/09 16:50:05 jcs Exp $ --- Makefile.orig Thu Mar 10 02:15:05 2005 +++ Makefile Wed Mar 30 13:34:20 2005 @@ -20,6 +20,7 @@ OSARCH=$(shell uname -s) @@ -67,7 +67,7 @@ $OpenBSD: patch-Makefile,v 1.2 2005/05/01 02:12:47 jcs Exp $ -ASTMANDIR=$(INSTALL_PREFIX)/usr/share/man +ASTBINDIR=$(INSTALL_PREFIX)/bin +ASTSBINDIR=$(INSTALL_PREFIX)/sbin -+ASTVARRUNDIR=/var/run ++ASTVARRUNDIR=/var/run/asterisk +ASTMANDIR=$(INSTALL_PREFIX)/man MODULES_DIR=$(ASTLIBDIR)/modules diff --git a/telephony/asterisk/patches/patch-asterisk_c b/telephony/asterisk/patches/patch-asterisk_c index a26983ec799..c8fe27d5dc6 100644 --- a/telephony/asterisk/patches/patch-asterisk_c +++ b/telephony/asterisk/patches/patch-asterisk_c @@ -1,6 +1,6 @@ -$OpenBSD: patch-asterisk_c,v 1.1.1.1 2004/09/26 00:38:24 jolan Exp $ ---- asterisk.c.orig Mon Sep 13 13:19:15 2004 -+++ asterisk.c Thu Sep 23 13:49:40 2004 +$OpenBSD: patch-asterisk_c,v 1.2 2005/05/09 16:50:05 jcs Exp $ +--- asterisk.c.orig Sat Jan 15 13:58:41 2005 ++++ asterisk.c Thu May 5 20:28:56 2005 @@ -193,7 +193,7 @@ int ast_safe_system(const char *s) for (x=STDERR_FILENO + 1; x<4096;x++) { close(x); @@ -10,3 +10,21 @@ $OpenBSD: patch-asterisk_c,v 1.1.1.1 2004/09/26 00:38:24 jolan Exp $ exit(1); } else if (pid > 0) { for(;;) { +@@ -1580,7 +1580,7 @@ int main(int argc, char *argv[]) + sigset_t sigs; + int num; + char *buf; +- char *runuser=NULL, *rungroup=NULL; ++ char *runuser = "_asterisk", *rungroup = "_asterisk"; + struct pollfd silly_macos[1]; + + /* Remember original args for restart */ +@@ -1693,6 +1693,8 @@ int main(int argc, char *argv[]) + ast_log(LOG_WARNING, "Unable to disable core size resource limit: %s\n", strerror(errno)); + } + } ++ ++ chdir("/"); + + if (rungroup) { + struct group *gr; diff --git a/telephony/asterisk/patches/patch-asterisk_h b/telephony/asterisk/patches/patch-asterisk_h index 2f8168c95cf..ac99bed185b 100644 --- a/telephony/asterisk/patches/patch-asterisk_h +++ b/telephony/asterisk/patches/patch-asterisk_h @@ -1,6 +1,6 @@ -$OpenBSD: patch-asterisk_h,v 1.1.1.1 2004/09/26 00:38:24 jolan Exp $ +$OpenBSD: patch-asterisk_h,v 1.2 2005/05/09 16:50:05 jcs Exp $ --- asterisk.h.orig Tue Sep 7 10:02:53 2004 -+++ asterisk.h Fri Sep 24 10:55:34 2004 ++++ asterisk.h Thu May 5 20:54:01 2005 @@ -26,8 +26,8 @@ #define AST_VAR_DIR ASTVARLIBDIR #define AST_LOG_DIR ASTLOGDIR @@ -8,7 +8,7 @@ $OpenBSD: patch-asterisk_h,v 1.1.1.1 2004/09/26 00:38:24 jolan Exp $ -#define AST_KEY_DIR ASTVARLIBDIR "/keys" -#define AST_DB ASTVARLIBDIR "/astdb" +#define AST_KEY_DIR "/var/asterisk/keys" -+#define AST_DB "/var/asterisk/astdb" ++#define AST_DB "/var/asterisk/astdb/astdb" #define AST_TMP_DIR ASTSPOOLDIR "/tmp" #define AST_CONFIG_FILE ASTCONFPATH diff --git a/telephony/asterisk/pkg/PLIST b/telephony/asterisk/pkg/PLIST index e92e664d431..6670604aa21 100644 --- a/telephony/asterisk/pkg/PLIST +++ b/telephony/asterisk/pkg/PLIST @@ -1,4 +1,6 @@ -@comment $OpenBSD: PLIST,v 1.2 2005/05/01 02:12:47 jcs Exp $ +@comment $OpenBSD: PLIST,v 1.3 2005/05/09 16:50:05 jcs Exp $ +@newgroup _asterisk:545 +@newuser _asterisk:545:_asterisk:daemon:asterisk user:/nonexistent:/sbin/nologin include/asterisk/ include/asterisk/acl.h include/asterisk/adsi.h @@ -398,8 +400,9 @@ share/doc/asterisk/model.txt share/doc/asterisk/modules.txt share/doc/asterisk/queuelog.txt share/examples/asterisk/ -share/examples/asterisk/agi/ @sample /var/asterisk/ +@sample ${SYSCONFDIR}/asterisk/ +share/examples/asterisk/agi/ @sample /var/asterisk/agi-bin/ share/examples/asterisk/agi/agi-test.agi @sample /var/asterisk/agi-bin/agi-test.agi @@ -446,7 +449,6 @@ share/examples/asterisk/default/voicemail.conf.sample share/examples/asterisk/default/vpb.conf.sample share/examples/asterisk/default/zapata.conf.sample share/examples/asterisk/openbsd/ -@sample ${SYSCONFDIR}/asterisk/ share/examples/asterisk/openbsd/extensions.conf.sample @sample ${SYSCONFDIR}/asterisk/extensions.conf share/examples/asterisk/openbsd/logger.conf.sample @@ -457,8 +459,12 @@ share/examples/asterisk/openbsd/sip.conf.sample @sample ${SYSCONFDIR}/asterisk/sip.conf share/examples/asterisk/openbsd/voicemail.conf.sample @sample ${SYSCONFDIR}/asterisk/voicemail.conf +@group _asterisk +@owner _asterisk +@sample /var/asterisk/astdb/ @sample /var/log/asterisk/ @sample /var/log/asterisk/cdr-csv/ +@sample /var/run/asterisk/ @sample /var/spool/asterisk/ @sample /var/spool/asterisk/voicemail/ @sample /var/spool/asterisk/voicemail/default/