[SM-Users] mcdp spell?

Javier Vasquez jevv.cr at gmail.com
Fri Apr 27 11:07:01 EDT 2007


On 4/27/07, Juuso Alasuutari <iuso at sourcemage.org> wrote:
> Javier Vasquez wrote:
> > Hi,
> >
>>  ...
> > http://www.mcmilk.de/projects/mcdp
> >
> > Thanks,
> >
>
> Here's a small, hypothetical example of what you can do in a spell.
> We'll assume that the program source includes a Makefile which has an
> option called 'OPTION' in it which you're supposed to edit by hand. The
> option accepts two possible values, 'ON' and 'OFF'. We'll also assume
> that the Makefile has no 'make install' target, and that a succesful
> make produces an executable called foobar.
>
> begin-------------------------------
>
>
> CONFIGURE:
>
> config_query_option  OPTION_VAR  "Enable option?"  y  "ON"  "OFF"
>
>
> PRE_BUILD:
>
> default_pre_build       &&
> cd "$SOURCE_DIRECTORY"  &&
> sed -i  "s|^OPTION=.*$|OPTION=$OPTION_VAR|"  Makefile
>
>
> BUILD:
>
> make
>
>
> INSTALL:
>
> cp  foobar  "$INSTALL_ROOT/usr/bin/"
>
>
> end---------------------------------
>
> There are some important things worth noticing:
> - If you add your own PRE_BUILD, BUILD, INSTALL or similar file, it will
> completely override the default equivalent behavior. Keep this in mind
> at all times.
> - In PRE_BUILD those first two lines are the equivalent of the default
> PRE_BUILD behavior and are necessary when you want to have a custom
> PRE_BUILD; after them you can place your custom commands.
> - This example needs a BUILD file containing only 'make', because the
> default BUILD behavior is to execute ./configure before make.
> - In INSTALL the $INSTALL_ROOT variable needs to be prefixed in front of
> all install targets. It is necessary to enable spells to be cast into
> chroots and other custom locations.
>
> Hope you enjoy writing a spell, please do ask more if you need to. :)
>
> J


Thanks a lot, this clarify things a lot, actually I compiled,
installed and tried mcpd on smgl yesterday night, and everything went
OK, except for the fact that I required to generate a patch, since the
Makefile "uninstall" was broken, and it was overwriting i*86 with i386
all the time.

Looking at the previous description, I guess the patch instruction
needs to go under PRE_BUILD.  Only thing is that this is a personal
patch, and I don't have any http/ftp server.  I'll see if the patch is
accepted by the mcdp developer, and if not, well, I wouldn't know if
the spell I can come up with will be of any use for others (good thing
is that when browsing about "sourcemage mcdp", I found nothing, so
most probably there's no one interested on mcdp but me).  At any rate
I'll try writing one and post it here if I get it to work.  I'm just
new to this, :).

Thanks a lot,

-- 
Javier


More information about the SM-Users mailing list