[SCM] crtmpserver/master: Add portinstall script for crtmpserver-apps package

Reinhard Tartler siretart at tauware.de
Sat Nov 5 10:15:54 UTC 2011


On Sa, Nov 05, 2011 at 10:34:49 (CET), jet-guest at users.alioth.debian.org wrote:

> The following commit has been merged in the master branch:
> commit a91aeff97b9c3a8e543a3f738bd52e0f952861ed
> Author: Andriy Beregovenko <jet at jet.kiev.ua>
> Date:   Sat Nov 5 11:34:37 2011 +0200
>
>     Add portinstall script for crtmpserver-apps package
>
> diff --git a/debian/crtmpserver-apps.postinst b/debian/crtmpserver-apps.postinst
> new file mode 100644
> index 0000000..1c6507d
> --- /dev/null
> +++ b/debian/crtmpserver-apps.postinst
> @@ -0,0 +1,36 @@
> +#!/bin/sh
> +
> +set -e
> +
> +APPLICATIONS="admin applestreamingclient appselector flvplayback proxypublish samplefactory stresstest vptests"
> +APPCONFPATH="/etc/crtmpserver/applications"
> +
> +
> +case "$1" in
> +	configure)
> +		# Copy application config if not exists
> +		for app in "$APPLICATIONS"; do
> +			if [ ! -f /etc/crtmpserver/applications/${app}.lua ]
> +			then
> +				cp /etc/crtmpserver/applications/${app}.lua.sample \
> +					/etc/crtmpserver/applications/${app}.lua
> +				chmod 644 /etc/crtmpserver/applications/${app}.lua
> +			fi
> +		done

Why this copying around? This looks pretty confusing and surprising to
the user. I guess you want to have a reference copy around on the
system, which is a valid concern. However, since we are working on the
'official' debian packages, I think we should do this consinstently with
other packages in debian. So, this is what I propose:

- Install the references in /usr/share/doc/crtmpserver/examples. This
  can be done elegenatly using dh_installexamples(1) in debian/rules.

- Install a copy of that sample files in /etc/crtmpserver/applications/{app}.whatever.

- Rely on dpkg conffile mechanism to track user changes.

- remove this postinst script.



> +		# copy users sample file if not exists
> +		if [ ! -f /etc/crtmpserver/conf.d/users.lua ]
> +		then
> +			cp /etc/crtmpserver/conf.d/users.lua.sample \
> +				/etc/crtmpserver/conf.d/users.lua
> +			chmod 640 /etc/crtmpserver/conf.d/users.lua
> +		fi

dito.

Cheers,
Reinhard.
-- 
Gruesse/greetings,
Reinhard Tartler, KeyID 945348A4



More information about the pkg-multimedia-maintainers mailing list