You are not logged in.

#1 2014-08-22 09:58:04

josephg
Member
From: Brazil
Registered: 2009-09-28
Posts: 106

How would I automatize a call for an argument in a package

Hi there.

I'm maintainer of some Teeworlds[1] packages[2] and I'm trying modify the packaging in order to be a install-n-play solution.  I'd like some help to figure out what is the best solution

Basically, when running a Teeworlds server, one needs to specify a config file with the syntax "teeworlds_srv -f <configfile>". If the parameter "-f <configfile>", no config file will be found and therefore server won't have your settings.  Some mods[3] require specific configurations, so user might get confused on what has to be done in order to make the server go up.  And I want that to be easiest as possible.

I would like to package it, automatizing with something like a shell script, environment variable or whatever that allows the end-user will only install the package and then run the 'teeworlds_srv' to play.

[1] https://www.teeworlds.com/
[2] https://aur.archlinux.org/packages/?K=teeworlds
[3] mods = modified servers providing different game types

Any ideas to automatize it properly?

Thanks in advance,
Rafael Ferreira

Offline

#2 2014-08-22 11:01:24

Awebb
Member
Registered: 2010-05-06
Posts: 6,285

Re: How would I automatize a call for an argument in a package

I would leave the package alone for the most part and add a series of shell scripts that can launch the different game modes. You could also create a split package, if the number of different settings is not too big. It is important to make sure, that the PKGBUILD is not interactive. It is also not encouraged to use internal variables. However, it is only discouraged, not forbidden by any rules. The user needs to make sure to modify the PKGBUILD according to his needs anyway, so it should not be a problem to introduce a local variable, for that matter.

Offline

#3 2014-08-22 12:50:58

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: How would I automatize a call for an argument in a package

If the package provides a fixed number of static configuration files for a fixed number of games modes then you could provide a script that selects the mode based on a user argument, e.g. "teeworlds_srv" with no arguments would return a list of the  modes and "teeworlds_srv modeA" would launch the server in mode A.

What I suspect to be more likely is that the user is meant to configure the file him-/herself. In that case, don't provide hand-holding scripts like this. It is not the Arch way. Include a message in the post_install function in the install script directing the user to some online documentation about how to run the server.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#4 2014-08-22 15:39:47

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: How would I automatize a call for an argument in a package

Minor observation: the word is 'automate', not 'automatize'. smile

Offline

#5 2014-08-22 17:40:06

Jristz
Member
From: America/Santiago
Registered: 2011-06-11
Posts: 1,022

Re: How would I automatize a call for an argument in a package

tomk wrote:

Minor observation: the word is 'automate', not 'automatize'. smile

http://en.wiktionary.org/wiki/automatize
http://en.wiktionary.org/wiki/automate
Wiktionary say both are valid (included automatise).


Well, I suppose that this is somekind of signature, no?

Offline

Board footer

Powered by FluxBB