From 1418be8cb6200d90442af5da75ce945ecfc6a370 Mon Sep 17 00:00:00 2001 From: Michal Bielicki Date: Thu, 29 Nov 2007 00:38:58 +0000 Subject: [PATCH] fixes to make it more debianish. also fixed to create and remove the pacakge git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6423 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- debian/control | 4 +-- debian/freeswitch.postinst | 51 ++++++++++++++++++++++++++++++++++++++ debian/freeswitch.postrm | 44 ++++++++++++++++++++++++++++++++ debian/postinst | 2 -- debian/postrm | 2 -- debian/preinst | 2 -- debian/rules | 10 ++++---- 7 files changed, 102 insertions(+), 13 deletions(-) create mode 100755 debian/freeswitch.postinst create mode 100755 debian/freeswitch.postrm delete mode 100644 debian/postinst delete mode 100644 debian/postrm delete mode 100644 debian/preinst diff --git a/debian/control b/debian/control index 8fa7adc004..5d4b160a92 100644 --- a/debian/control +++ b/debian/control @@ -2,12 +2,12 @@ Source: freeswitch Maintainer: Michael Jerris Section: net Priority: extra -Build-Depends: debhelper (>= 5), automake1.9, autoconf, libtool, unixodbc-dev, libasound2-dev, libcurl3-dev, libssl-dev +Build-Depends: debhelper (>= 5), automake1.9, autoconf, libtool, unixodbc-dev, libasound2-dev, libcurl3-dev, libssl-dev, ncurses-dev Standards-Version: 3.7.2 Package: freeswitch Architecture: any -Depends: ${shlibs:Depends}, unixodbc, libasound2, libcurl3, openssl +Depends: ${shlibs:Depends}, unixodbc, libasound2, libcurl3, openssl, libncurses5 Suggests: monit Description: A telephony platform that really kicks some ass... FreeSWITCH is an open source telephony platform designed to facilitate the diff --git a/debian/freeswitch.postinst b/debian/freeswitch.postinst new file mode 100755 index 0000000000..c3dff9870c --- /dev/null +++ b/debian/freeswitch.postinst @@ -0,0 +1,51 @@ +#! /bin/sh +# set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package +# +# quoting from the policy: +# Any necessary prompting should almost always be confined to the +# post-installation script, and should be protected with a conditional +# so that unnecessary prompting doesn't happen if a package's +# installation fails and the `postinst' is called with `abort-upgrade', +# `abort-remove' or `abort-deconfigure'. + +case "$1" in + configure) + if ! getent passwd openfire >/dev/null; then + adduser --disabled-password --quiet --system \ + --home /opt/freeswitch \ + --gecos "FreeSwitch Voice Platform" --group daemon + fi + + mkdir -p /opt/freeswitch + chown -R freeswitch:daemon /opt/freeswitch + chmod -R o-rwx /opt/freeswitch + + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/freeswitch.postrm b/debian/freeswitch.postrm new file mode 100755 index 0000000000..9dbbeb0246 --- /dev/null +++ b/debian/freeswitch.postrm @@ -0,0 +1,44 @@ +#!/bin/sh +# postrm script for openfire +# +# see: dh_installdeb(1) + +# set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' overwrit>r> +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + purge) + rm -Rf /etc/opt/freeswitch + rm -Rf /opt/freeswitch + userdel freeswitch + ;; + + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + + + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/postinst b/debian/postinst deleted file mode 100644 index 3001115c24..0000000000 --- a/debian/postinst +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -chown -R freeswitch:daemon /opt/freeswitch diff --git a/debian/postrm b/debian/postrm deleted file mode 100644 index cc3d550cd1..0000000000 --- a/debian/postrm +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -userdel -r freeswitch diff --git a/debian/preinst b/debian/preinst deleted file mode 100644 index 5a635d0473..0000000000 --- a/debian/preinst +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -adduser --home /opt/freeswitch --ingroup daemon --disabled-password --disabled-login --gecos "The FreeSwitch Voice Switching System" --no-create-home freeswitch diff --git a/debian/rules b/debian/rules index c66a18652a..31b410f729 100755 --- a/debian/rules +++ b/debian/rules @@ -5,7 +5,7 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -export MODULES ?= mod_console mod_syslog mod_commands mod_conference mod_dptools mod_enum mod_fifo mod_openmrcp mod_amr mod_g711 mod_g722 mod_g723_1 mod_g726 mod_g729 mod_gsm mod_ilbc mod_l16 mod_speex mod_dialplan_xml mod_dialplan_asterisk mod_dingaling mod_iax mod_portaudio mod_sofia mod_woomera mod_openzap mod_event_multicast mod_event_socket mod_native_file mod_sndfile mod_local_stream mod_spidermonkey mod_spidermonkey_teletone mod_spidermonkey_core_db mod_spidermonkey_odbc mod_xml_rpc mod_xml_curl mod_xml_cdr mod_say_en mod_say_fr mod_say_de +export MODULES ?= mod_console mod_syslog mod_commands mod_conference mod_dptools mod_enum mod_fifo mod_openmrcp mod_amr mod_g711 mod_g722 mod_g723_1 mod_g726 mod_g729 mod_gsm mod_ilbc mod_l16 mod_speex mod_dialplan_directory mod_dialplan_xml mod_dialplan_asterisk mod_dingaling mod_iax mod_portaudio mod_sofia mod_woomera mod_openzap mod_event_multicast mod_event_socket mod_native_file mod_sndfile mod_local_stream mod_spidermonkey mod_spidermonkey_teletone mod_spidermonkey_core_db mod_spidermonkey_odbc mod_xml_rpc mod_xml_curl mod_xml_cdr mod_say_en mod_say_fr mod_say_de ifndef AUTOCONF AUTOCONFS := $(wildcard /usr/bin/autoconf*) AUTOCONF = $(shell which autoconf) @@ -56,9 +56,10 @@ endif ifneq "$(wildcard /usr/share/misc/config.guess)" "" cp -f /usr/share/misc/config.guess build/config/config.guess endif - - - dh_clean + rm -f config.status + rm -f */*/config.status + rm -f */*/*/config.status + dh_clean install: build dh_testdir @@ -111,4 +112,3 @@ binary-arch: build install binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install -# vim:set ai et sts=2 sw=2 tw=0: