[Dancer-users] Packaging Dancer to CPAN

sawyer x xsawyerx at gmail.com
Thu May 26 09:29:21 CEST 2011


The problem is that the definition of a "share directory" is different when
writing a web application than when writing a general application, like a
graphical interface (game, GUI app, etc.).

The definition when writing a GUI app is that you just need a directory to
just store artifact files, static xml files, blah blah blah. Once these
files are written to disk, you don't really care about them anymore. If they
need updating or any fiddling, it will be done on your repo, and you will
redeploy a new version when you get to it. That's when File::ShareDir is
great.

The definition of a share directory when writing a web application is a
place to put stuff that you really do need to edit on the server, and
sometimes frequently. Also it's files you sometimes need to set up a back up
for (such as SQLite DBs, etc.) and that's when sharedir is useless. For
example, how often do you edit apache config files? I'll be damned if
they're all lines up in a repository that you deploy automatically now and
then to /etc/. Same goes for your static files, they aren't sitting in
/usr/share/yourapp/static/.

Another issue is that it's much more comfortable to have all the files
together. It's comfortable to edit a distribution when it's all in the same
main directory. When deploying using CPAN (and ShareDir), your files are
scattered throughout the filesystem according to what they are, instead of
what they are *related to*, thus making it very annoying to look at a single
website as a whole. This also makes the packaging of this website (for
backup purposes, for example) to be tiresome and close to insane.

I thought about it quite a bit, and I think the best solution is to be able
to have a policy of the installation toolchain which allows a completely new
structure, to be able to say "my websites are in /var/www/" and it will put
everything there in a way that is easy to play with, backup, update,
redeploy, etc. Haven't gotten around to it yet.

On Thu, May 26, 2011 at 9:12 AM, Gabor Szabo <szabgab at gmail.com> wrote:

> On Wed, May 25, 2011 at 8:02 PM, Pedro Melo <melo at simplicidade.org> wrote:
> > Hi,
> >
> > I need to repack a Dancer-based site as a CPAN module. I remember
> > seeing a bit of documentation about this somewhere but I can't find it
> > at the moment.
> >
> > Any pointers to documentation or an example on how to do this?
> >
> > Thanks in advance,
>
> I am also interested what other have to say about this but till some
> better answer comes along let me give you my 2c.
>
> As I understand many people who build CPAN-ish modules from web
> applications don't "INSTALL" it usin a cpan client.
> They install all the dependencies and then just unzip the tar.gz file
> of the actual application and configure the
> web server to use those file.
>
> I have been doing this too but with CPAN::Digger I decided I'll try to
> make it installable.
> The strategy I am trying to take is that during installation
> Makefile.PL copies the view/  the schema/
> and the environments/  to   the /share directory and then, using the
> "install_share" command of "Module::Install
> I make sure they are installed.
>
> Then I can use File::ShareDir in my code to access thos installed files.
>
> Gabor
> _______________________________________________
> Dancer-users mailing list
> Dancer-users at perldancer.org
> http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.backup-manager.org/pipermail/dancer-users/attachments/20110526/aeae8c81/attachment-0001.htm>


More information about the Dancer-users mailing list