[M3devel] M3Config contains paths to installation directory.

Jay K jay.krell at cornell.edu
Fri Jul 31 09:06:15 CEST 2009


Please consider that you don't really need this CM3_INSTALL_PREFIX feature. I understand what it does. And the implementation is pretty small and ok. I don't mind leaving it in. And I think I fixed the problem with it. I hope it is clear that it isn't really needed. I will explain why.
 
 
It isn't needed because the default ship location is adequate.
The default ship location is the location of cm3, or one level up from there, or uh, whatever the config file says, but that is what it usually is.
 
 
Now, granted, the location of cm3 "right now" might not be what you want.
However, copying cm3 to where you want shipping to go is cheap, if in fact you are after building the whole system. If you are after just building a few packages, then, indeed, what I am saying makes less/no sense.
 
 
gcc for example, is a bit heavyweight to copy around. It is many files.
 
 
However cm3 is very small. If you want to ship somewhere else, you can do this:
 
 
  mkdir -p /tmp/foo/bin/config  
  cd /tmp/foo/bin  
  cp /usr/local/bin/cm3 .   
  cp /usr/local/bin/cm3.cfg .   
  cp /usr/local/bin/config/* config   
  export PATH=/tmp/foo/bin:$PATH 
 
 
That's it. Then go about building the distribution, I'm not sure of the order here, but I'm sick of arguing about scripts and package groups and pkginfo.txt, the whole lot is unnecessary. 
 
  cd $CVSROOT/m3-sys/m3cc   
  cm3 -build 
  cm3 -ship  
  cd $CVSROOT/m3-libs/m3core  
  cm3 -build 
  cm3 -ship  
  cd $CVSROOT/m3-libs/libm3  
  cm3 -build  
  cm3 -ship   
  cd $CVSROOT/m3-libs/sysutils  
  cm3 -build  
  cm3 -ship   
  cd $CVSROOT/m3-sys/m3quake  
  cm3 -build  
  cm3 -ship   
  cd $CVSROOT/m3-sys/m3middle   
  cm3 -build  
  cm3 -ship   
  cd $CVSROOT/m3-sys/m3front  
  cm3 -build  
  cm3 -ship   
  cd $CVSROOT/m3-sys/m3linker    
  cm3 -build  
  cm3 -ship   
  cd $CVSROOT/m3-sys/m3back      
  cm3 -build  
  cm3 -ship    
  cd $CVSROOT/m3-sys/cm3     
  cm3 -build  
  cm3 -ship  oops this line doesn't do anything useful
  # rem next line makes up for previous line not "working"   
  cp build_dir/cm3 /tmp/foo/bin  
  and continue on your way building/shipping whatever 
 
 
Again, if you just want to package up some gui apps for example, not the whole system from scratch, then CM3_INSTALL_PREFIX becomes more useful.
 
 
I do wonder if the usage should have been cm3 -ship DESTDIR=/tmp/foo to follow widespread existing practice, but ok either way. Apple also uses a different name like DSTROOT for their linker/assembler and such. 
 
 
This technique is how I build distributions and I believe how Olaf does too, since I based my code on his.
 
 
  -  Jay


----------------------------------------
> From: dragisha at m3w.org
> To: eiserlohpp at yahoo.com
> Date: Fri, 31 Jul 2009 00:17:47 +0200
> CC: m3devel at elegosoft.com
> Subject: Re: [M3devel] M3Config contains paths to installation directory.
>
> cm3 -?
> ...
>> CM3_INSTALL_PREFIX path prefix to prepend to filenames being installed,
>> "make DESTDIR=" behaviour for cm3
>>
>
> This is one patch I've introduced earlier and it's excellent conduit for
> RPM packaging scripts I develop. I am using it like this:
>
>
>> export CM3_INSTALL_PREFIX=$RPM_BUILD_ROOT
>>
>> ./scripts/do-pkg.sh realclean m3core libm3
>>
>> ./scripts/do-pkg.sh buildship m3core libm3
>>
>
> Please let me know if your script fails on you mentioning mkdir failure.
> I have workaround for it (as Jay did not accept my report as a bug).
>
>
> I'll put my RPM script in repository RSN.
>
> dd
>
> On Wed, 2009-07-15 at 18:19 -0700, Peter Eiserloh wrote:
>> Hi Jay,
>>
>> Do you know of any way to tell the build system that the
>> final installation directory is located in one place, but
>> that the software is to actually be shipped (temporarily)
>> to a staging directory.
>>
>> Specifically, libm3/src/config contains a m3makefile that
>> derives the M3Config interface, containing a number of
>> paths to the installation root directory.
>>
>> This is the normal situation for most people, but I am
>> installing to a temporary directory, for packaging purposes.
>> The packaging software later installs the package into
>> the correct location.
>>
>> Whenever I build the system, M3Config always contains
>> the paths to my staging area.
>>
>> I would like some way of specifying to the build system
>> that the final (or real) installation root is one thing,
>> but "ship" would actually install into a different one.
>>
>>
>>
>> +--------------------------------------------------------+
>> | Peter P. Eiserloh |
>> +--------------------------------------------------------+
>>
>>
>>
> --
> Dragiša Durić 
>


More information about the M3devel mailing list