Code
Using teepee
will be difficult without getting the code… here’s
a few hints on what you can do.
Installation
If you just want to use teepee
, the suggested way is to download the
bundled version, set the execution bit and put it somewhere in the
PATH
, like this:
Your mileage may vary with the last command, ranging from whether you
actually want to install in /usr/local/bin
to whether you’re allowed
to do that. You can choose any directory in the PATH
of course, or use
any other trick.
As an alternative, you can just get the code and take care to install support modules by yourself, like this:
teepee
is capable of using different modules for JSON and YAML, if
you’re installing them yourself I’d just suggest to use the best around.
Hacking
The main repository is hosted on GitHub and is there to be forked! It is licensed under The Artistic License 2.0 so it should be pretty easy for you to do whatever you want with it.
The main script is teepee
and it is located in the root directory of
the project. There is also a bundled version available at
bundle/teepee
, including all dependencies inside the file itself and
ready for installing around.
Dependencies
You will need to install dependencies, which are the following modules:
- something to deal with JSON. Any of the following will do, although
I’d suggest to go for the first one if possible:
- Cpanel::JSON::XS
- JSON::XS
- JSON::PP - this does not require a compiler, and it should be already available with a fairly recent standard Perl installation
- something to deal with YAML. Any of the following will do, although
I’d suggest to go for the first one if possible:
- YAML::XS
- YAML::Syck
- YAML::Tiny - this does not require a compiler
- Data::Crumbr
- Template::Perlish
If you’re planning on re-generating the bundled version, you should install YAML::Tiny and JSON::PP, as they are the ones used in the bundling process.
The dependencies might be installed with the Perl you are using, or locally using any mechanism (e.g. a local::lib of some sort). I usually install dependencies for bundling using epan with the following command:
Bundle Generation
The script update.sh
will update the bundled version stored at
bundle/teepee
. It requires the dependencies to be available, see
previous section for them.
The bundling script used mobundle
from
deployable. You can get it directly
like this:
Think of mobundle
as
a fatpacker that exists since
2007…
If you installed your dependency modules for teepee
in a place where
Perl does not normally look for, you have a few options. One, of course,
is to fiddle with environment variable PERL5LIB
. If you feel more like
something less invasive for your environment, you can set up some
localization via file _local/update-local.sh
. For example, after I set
up the local modules with epan as
described in the previous section, I use the following localization
script:
It takes care to properly set environment variable
MOBUNDLE_LOCAL_PARAMETERS
, that is eventually used by update.sh
when
calling mobundle
. You can find a commented version of the above script
inside eg/update-local.sh
, so if you’re following the hints on using
epan
you can just copy this file in _local
.