[dancer-users] Questions about distributing Dancer2 applications
Maxwell Carey
mcarey at ucar.edu
Tue May 6 18:20:23 BST 2014
I have a Dancer2 application that I'd like to distribute. I have a
couple of questions about the process that may be more related to
ExtUtils::MakeMaker than to Dancer, but I figured I'd ask here first
since deployment of web applications seems a little different from
installing regular modules.
1. Typically when you install a Perl package with
perl Makefile.PL && make && make install
modules goes somewhere like /usr/local/lib/perl5/, binaries go somewhere
like /usr/local/bin/, documentation goes somewhere else, and so on. I
don't want my application fragmented like that (and I don't think it
would even work if it were); when users run `make install` I want
everything from my MANIFEST to simply be copied into the install
directory as-is. For example, I want to end up with
/usr/local/myapp/bin/
/usr/local/myapp/lib/
/usr/local/myapp/lib/myapp.pm
/usr/local/myapp/public/
...
I assume this is how most Dancer/Dancer2 apps would have to be installed
to work properly...how can I do this? I tried
perl Makefile.PL INSTALL_BASE=/usr/local/myapp/
but that puts myapp.pm in /usr/local/myapp/lib/perl5/ and doesn't copy
any of the other files or directories I want, like public/.
2. My app includes an index page containing links to other pages on the
same server, e.g.
<a href="http://host.example.com/foo">foo</a>
This page is served with send_file, no templates involved. So far I have
simply hard-coded the server name into the file, but that won't work
when somebody tries to install it on another server.
I thought I could use the PL_FILES attribute to WriteMakefile() to run a
script that fills in the correct host name during the build process.
Would this be a reasonable approach?
More information about the dancer-users
mailing list