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 | |
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')
-rw-r--r-- | net-misc/asterisk/ChangeLog | 7 | ||||
-rw-r--r-- | net-misc/asterisk/asterisk-1.0.5-r2.ebuild | 74 | ||||
-rw-r--r-- | net-misc/asterisk/asterisk-1.0.6-r1.ebuild | 70 | ||||
-rw-r--r-- | net-misc/asterisk/asterisk-1.0.7-r1.ebuild | 71 | ||||
-rw-r--r-- | net-misc/asterisk/asterisk-1.0.8.ebuild | 71 |
5 files changed, 138 insertions, 155 deletions
diff --git a/net-misc/asterisk/ChangeLog b/net-misc/asterisk/ChangeLog index 43bbe4473f68..68c5ab9c3e84 100644 --- a/net-misc/asterisk/ChangeLog +++ b/net-misc/asterisk/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for net-misc/asterisk # Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v 1.66 2005/06/28 21:05:33 stkn Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v 1.67 2005/07/21 00:57:17 stkn Exp $ + + 21 Jul 2005; Stefan Knoblich <stkn@gentoo.org> asterisk-1.0.5-r2.ebuild, + asterisk-1.0.6-r1.ebuild, asterisk-1.0.7-r1.ebuild, asterisk-1.0.8.ebuild: + Moved user+group creation to pkg_preinst() as suggested by Gabe in bug #99466, + permissions and ownerships are changed in pkg_postinst() now. 28 Jun 2005; Stefan Knoblich <stkn@gentoo.org> asterisk-1.0.7-r1.ebuild: Marking stable on x86, closing #88732 and #96826. diff --git a/net-misc/asterisk/asterisk-1.0.5-r2.ebuild b/net-misc/asterisk/asterisk-1.0.5-r2.ebuild index 1a94300fedc4..7ea2ec81cbff 100644 --- a/net-misc/asterisk/asterisk-1.0.5-r2.ebuild +++ b/net-misc/asterisk/asterisk-1.0.5-r2.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.5-r2.ebuild,v 1.4 2005/07/10 01:08:32 swegener Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/asterisk-1.0.5-r2.ebuild,v 1.5 2005/07/21 00:57:17 stkn Exp $ inherit eutils perl-module @@ -315,54 +315,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 +} + +pkg_preinst() { + einfo "Adding asterisk user and group" + enewgroup asterisk + enewuser asterisk -1 /bin/false /var/lib/asterisk asterisk +} +pkg_postinst() { # - # non-root + # Change permissions and ownerships of asterisk + # directories and files # - - 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 + einfo "Fixing permissions and ownerships" + # fix permissions in /var/... 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 + chown -R asterisk:asterisk ${ROOT}/var/${x}/asterisk + chmod -R u=rwX,g=rX,o= ${ROOT}/var/${x}/asterisk done - chown -R root:asterisk ${D}/etc/asterisk - chmod -R u=rwX,g=rX,o= ${D}/etc/asterisk -} + chown -R root:asterisk ${ROOT}/etc/asterisk + chmod -R u=rwX,g=rX,o= ${ROOT}/etc/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 - - 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" diff --git a/net-misc/asterisk/asterisk-1.0.6-r1.ebuild b/net-misc/asterisk/asterisk-1.0.6-r1.ebuild index 3d6948e4752f..af1250f45a96 100644 --- a/net-misc/asterisk/asterisk-1.0.6-r1.ebuild +++ b/net-misc/asterisk/asterisk-1.0.6-r1.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.6-r1.ebuild,v 1.5 2005/07/13 14:13:11 swegener Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/asterisk-1.0.6-r1.ebuild,v 1.6 2005/07/21 00:57:17 stkn Exp $ inherit eutils perl-module @@ -372,50 +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 +pkg_preinst() { + einfo "Adding asterisk user and group" + enewgroup asterisk + enewuser asterisk -1 /bin/false /var/lib/asterisk asterisk +} +pkg_postinst() { + # + # Change permissions and ownerships of asterisk + # directories and files + # + einfo "Fixing permissions and ownerships" # 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 + chown -R asterisk:asterisk ${ROOT}/var/${x}/asterisk + chmod -R u=rwX,g=rX,o= ${ROOT}/var/${x}/asterisk done - chown -R root:asterisk ${D}/etc/asterisk - chmod -R u=rwX,g=rX,o= ${D}/etc/asterisk -} + chown -R root:asterisk ${ROOT}/etc/asterisk + chmod -R u=rwX,g=rX,o= ${ROOT}/etc/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 - 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 - - 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" diff --git a/net-misc/asterisk/asterisk-1.0.7-r1.ebuild b/net-misc/asterisk/asterisk-1.0.7-r1.ebuild index 4a9f116ed689..1403534f4dca 100644 --- a/net-misc/asterisk/asterisk-1.0.7-r1.ebuild +++ b/net-misc/asterisk/asterisk-1.0.7-r1.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.7-r1.ebuild,v 1.13 2005/07/13 14:13:11 swegener Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/asterisk-1.0.7-r1.ebuild,v 1.14 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 of 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" 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" |