[SCM] crtmpserver/master: Add portinstall script for crtmpserver-apps package
Reinhard Tartler
siretart at tauware.de
Sat Nov 5 20:10:18 UTC 2011
On Sa, Nov 05, 2011 at 19:04:08 (CET), Andriy Beregovenko wrote:
> Hi Reinhard,
>
> On Sat, Nov 05, 2011 at 11:15:54AM +0100, Reinhard Tartler wrote:
>> 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.
> Thank you for answer to must questions. I was going to ask this. :)
>
>> 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.
> I think crtmpserver-apps.examples is enough.
Ok
>> - Install a copy of that sample files in /etc/crtmpserver/applications/{app}.whatever.
>>
>> - remove this postinst script.
> This is main question. How I can copy/install working scripts if not use
> postinst ? Most of theese scripts must and will be modified in future by user.
Oh, I didn't remember that point. That's important to have in mind.
>> - Rely on dpkg conffile mechanism to track user changes.
> I do not think that it so smart to track changes in LUA script.
> "We can safely expect that every user *will* definitly want to edit and
> adjust the contents. This also means that dpkg *will* prompt on every
> package upgrade that changes anything in the file." - Your word about(april
> 2011 :))
right, in that case, I'd probably not put anything in /etc, but document
in README.Debian what the user is supposed to do. It could for example
tell users to copy the sample files to etc, similar to what your
postinst script does. Or you could even place such an install script in
verbatim the the README.Debian file so that the instructions become
copy&paste-able.
Do these files really have to go to /etc? Wouldn't any other location,
such as the users home, do as well?
>>
>> > + # 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.
>
> So mostly I wanna to know what way is properly for such type of situation.
Yeah, I think a proper README.Debian that explains the situation would
be much more clear than copy copies of configuration files around in the
package and the system.
--
Gruesse/greetings,
Reinhard Tartler, KeyID 945348A4
More information about the pkg-multimedia-maintainers
mailing list