diff options
author | Stefan Knoblich <stkn@gentoo.org> | 2005-07-21 00:57:17 +0000 |
---|---|---|
committer | Stefan Knoblich <stkn@gentoo.org> | 2005-07-21 00:57:17 +0000 |
commit | 7bcaad0a9d93935ce7e41d41e1f2785869a5b3ca (patch) | |
tree | 94987f5ef092393054d4753369c652c7e1100845 /net-misc/asterisk/asterisk-1.0.8.ebuild | |
parent | Fix autotool crappiness. (diff) | |
download | gentoo-2-7bcaad0a9d93935ce7e41d41e1f2785869a5b3ca.tar.gz gentoo-2-7bcaad0a9d93935ce7e41d41e1f2785869a5b3ca.tar.bz2 gentoo-2-7bcaad0a9d93935ce7e41d41e1f2785869a5b3ca.zip |
Moved user+group creation to pkg_preinst, permission and ownership changes are in pkg_postinst only now (#99466).
(Portage version: 2.0.51.22-r1)
Diffstat (limited to 'net-misc/asterisk/asterisk-1.0.8.ebuild')
-rw-r--r-- | net-misc/asterisk/asterisk-1.0.8.ebuild | 71 |
1 files changed, 33 insertions, 38 deletions
diff --git a/net-misc/asterisk/asterisk-1.0.8.ebuild b/net-misc/asterisk/asterisk-1.0.8.ebuild index 5c6fc7b23a7a..0e40c8785ba4 100644 --- a/net-misc/asterisk/asterisk-1.0.8.ebuild +++ b/net-misc/asterisk/asterisk-1.0.8.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/asterisk-1.0.8.ebuild,v 1.6 2005/07/13 14:13:11 swegener Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/asterisk-1.0.8.ebuild,v 1.7 2005/07/21 00:57:17 stkn Exp $ inherit eutils perl-module @@ -372,51 +372,46 @@ src_install() { sed -i -e "s:/etc/asterisk/perl:/var/lib/asterisk/perl:" \ ${D}${VENDOR_LIB}/AstAPI/LoadFile.pm ${D}${VENDOR_LIB}/AstAPI/WebServer.pm fi +} - if [[ -z "$(egetent passwd asterisk)" ]]; then - einfo "Adding asterisk user and group" - enewgroup asterisk - enewuser asterisk -1 /bin/false /var/lib/asterisk asterisk - fi - - # fix permissions - for x in spool run lib log; do - chown -R asterisk:asterisk ${D}/var/${x}/asterisk - chmod -R u=rwX,g=rX,o= ${D}/var/${x}/asterisk - done - - chown -R root:asterisk ${D}/etc/asterisk - chmod -R u=rwX,g=rX,o= ${D}/etc/asterisk +pkg_preinst() { + einfo "Adding asterisk user and group" + enewgroup asterisk + enewuser asterisk -1 /bin/false /var/lib/asterisk asterisk } pkg_postinst() { - if has_version "net-misc/asterisk"; then - # - # Change permissions and ownerships of asterisk - # directories and files - # - einfo "Fixing permissions and ownerships" - # fix permissions in /var/... - for x in spool run lib log; do - chown -R asterisk:asterisk ${ROOT}var/${x}/asterisk - chmod -R u=rwX,g=rX,o= ${ROOT}var/${x}/asterisk - done + # + # Change permissions and ownerships of asterisk + # directories and files + # + einfo "Fixing permissions and ownerships" + # fix permissions in /var/... + for x in spool run lib log; do + chown -R asterisk:asterisk ${ROOT}var/${x}/asterisk + chmod -R u=rwX,g=rX,o= ${ROOT}var/${x}/asterisk + done - chown -R root:asterisk ${ROOT}etc/asterisk - chmod -R u=rwX,g=rX,o= ${ROOT}etc/asterisk + chown -R root:asterisk ${ROOT}etc/asterisk + chmod -R u=rwX,g=rX,o= ${ROOT}etc/asterisk - if [[ -z "$(grep "/var/run/asterisk" ${ROOT}etc/asterisk/asterisk.conf)" ]] - then - einfo "Fixing astrundir in ${ROOT}etc/asterisk/asterisk.conf" - mv -f ${ROOT}etc/asterisk/asterisk.conf \ - ${ROOT}etc/asterisk/asterisk.conf.bak - sed -e "s:^\(astrundir[\t ]=>\).*:\1 /var/run/asterisk:" \ - ${ROOT}etc/asterisk/asterisk.conf.bak >\ - ${ROOT}etc/asterisk/asterisk.conf - einfo "Backup has been saved as ${ROOT}etc/asterisk/asterisk.conf.bak" - fi + # + # Fix locations for old installations (pre-non-root versions) + # + if [[ -z "$(grep "/var/run/asterisk" ${ROOT}etc/asterisk/asterisk.conf)" ]] + then + einfo "Fixing astrundir in ${ROOT}etc/asterisk/asterisk.conf" + mv -f ${ROOT}etc/asterisk/asterisk.conf \ + ${ROOT}etc/asterisk/asterisk.conf.bak + sed -e "s:^\(astrundir[\t ]=>\).*:\1 /var/run/asterisk:" \ + ${ROOT}etc/asterisk/asterisk.conf.bak >\ + ${ROOT}etc/asterisk/asterisk.conf + einfo "Backup has been saved as ${ROOT}etc/asterisk/asterisk.conf.bak" fi + # + # Some messages + # einfo "Asterisk has been installed" einfo "" einfo "to add new Mailboxes use: /usr/sbin/addmailbox" |