Skip to content

Commit

Permalink
[IMP] packaging debian
Browse files Browse the repository at this point in the history
bzr revid: al@openerp.com-20111003013956-kekmedzn8qm3u3s7
  • Loading branch information
antonylesuisse committed Oct 3, 2011
1 parent 8d7a2af commit 28a5c58
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 30 deletions.
4 changes: 2 additions & 2 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ Depends:
python-werkzeug,
python-yaml,
python-zsi
Conflicts: tinyerp-server, openerp-server
Replaces: tinyerp-server, openerp-server
Conflicts: tinyerp-server, openerp-server, openerp-web
Replaces: tinyerp-server, openerp-server, openerp-web
Recommends:
graphviz, ghostscript, postgresql, python-imaging, python-matplotlib
Description: OpenERP Enterprise Resource Management
Expand Down
46 changes: 18 additions & 28 deletions debian/openerp.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,25 @@

set -e

CONFFILE="/etc/openerp.conf"
FILESTORE="/var/lib/openerp/filestore"
LOGFILE="/var/log/openerp.log"
USERNAME="openerp"

case "${1}" in
configure)
if ! getent passwd | grep -q "^${USERNAME}" then
adduser --system --no-create-home --quiet --gecos 'OpenERP' --group ${USERNAME}
fi
# Creating log file
touch ${LOGFILE}
chown ${USERNAME}:${USERNAME} ${LOGFILE}
chmod 0640 ${LOGFILE}
# Creating local storage directory
mkdir -p ${FILESTORE}
# Setting ownership and permissions
chmod 0640 ${CONFFILE}
chown ${_USERNAME}:${_USERNAME} ${CONFFILE}
chown ${_USERNAME}:${_USERNAME} /var/lib/openerp -R
;;

abort-upgrade|abort-remove|abort-deconfigure)
;;

*)
echo "postinst called with unknown argument \`{$1}'" >&2
exit 1
;;
configure)
if ! getent passwd | grep -q "^openerp"; then
adduser --system --no-create-home --quiet --gecos 'OpenERP' --group openerp
fi
# Register "openerp" as a postgres superuser
su - postgres -c "createuser -s openerp" 2> /dev/null || true
chown openerp:openerp /etc/openerp/openerp-server.conf
chmod 0640 /etc/openerp/openerp-server.conf
# Creating log file
touch /var/log/openerp.log
chown openerp:openerp /var/log/openerp.log
chmod 0640 /var/log/openerp.log
# Creating local storage directory
mkdir -p /var/lib/openerp/filestore
chown openerp:openerp -R /var/lib/openerp
;;
*)
;;
esac

#DEBHELPER#
Expand Down

0 comments on commit 28a5c58

Please sign in to comment.