Den Sun, 17 May 2009 15:35:29 -0400
skrev [Foresight-devel]  So you want to work on the User Guide?:

Perfect, this one is just perfect. I love the info about recipe and
cook it. Makes everything easier for me that does that almost everyday.



> I took some time today to write up a small howto... It does need to go
> somewhere more accessible than the mailing for sure, but I have
> exhausted my free hours away from my family for now :) Here it goes
> verbatin and full of markup tags.
> 
> == Playing with the Foresight User Guide ==
> * Create a foresight-devel (or any other name for that matter)
> directory in your home directory
> {code}
> mkdir ~/foresight-devel
> {code}
> * Checkout the source code from the mercurial repository
> {code}
> cd ~/foresight-devel
> hg clone http://hg.foresightlinux.org/hg/foresight-user-guide-2
> {code}
> * You should now have the following files available:
> {code}
> $ ls -l
> -rw-rw-r-- 1 omaciel omaciel    0 2009-05-17 14:27 COPYING
> -rw-rw-r-- 1 omaciel omaciel 2544 2009-05-17 14:27 foresight-icon.png
> -rw-rw-r-- 1 omaciel omaciel  193 2009-05-17 14:27
> foresight-user-guide -rw-rw-r-- 1 omaciel omaciel  236 2009-05-17
> 14:27 foresight-user-guide.desktop drwxrwxr-x 3 omaciel omaciel 4096
> 2009-05-17 14:27 guide -rw-rw-r-- 1 omaciel omaciel 1528 2009-05-17
> 14:27 Makefile -rw-rw-r-- 1 omaciel omaciel    0 2009-05-17 14:27 NEWS
> -rw-rw-r-- 1 omaciel omaciel    0 2009-05-17 14:27 README
> -rw-rw-r-- 1 omaciel omaciel  321 2009-05-17 14:27 TODO
> {code}
> 
> * This shows you that the User Guide has been developed to be easily
> packaged.  The actual text that makes up the guide itself reside in
> the all the XML files in the *guide* directory:
> 
> {code}
> $ ls -l
> -rw-rw-r-- 1 omaciel omaciel 39625 2009-05-17 14:27 applications.xml
> drwxrwxr-x 3 omaciel omaciel  4096 2009-05-17 14:27 figures
> -rw-rw-r-- 1 omaciel omaciel   767 2009-05-17 14:27 foresight2.xml
> -rw-rw-r-- 1 omaciel omaciel  2333 2009-05-17 14:27
> foresight-user-guide.xml -rw-rw-r-- 1 omaciel omaciel  5304
> 2009-05-17 14:27 getinvolved.xml -rw-rw-r-- 1 omaciel omaciel  6375
> 2009-05-17 14:27 help.xml -rw-rw-r-- 1 omaciel omaciel  2653
> 2009-05-17 14:27 installation.xml -rw-rw-r-- 1 omaciel omaciel 19676
> 2009-05-17 14:27 legal.xml -rw-rw-r-- 1 omaciel omaciel 21273
> 2009-05-17 14:27 post-install-config.xml -rw-rw-r-- 1 omaciel
> omaciel  7941 2009-05-17 14:27 preface.xml -rw-rw-r-- 1 omaciel
> omaciel 14239 2009-05-17 14:27 software.xml {code}
> 
> * The xml files can be edited using any text editor!
> * In order to test your changes, you have the choice of:
> ** Compiling the package "by hand" running make && make install
> ** Packaging it locally, which I prefer in order to validate:
> *** My changes didn't break anything
> *** My system is not overriden with unmanaged code :)
> 
> Assumming you took the second option, then:
> 
> * Create a conary context file:
> {code}
> cat ~/.conaryrc
> 
> user *.rpath.org USERNAME PASSWORD
> [fl2-devel]
> autoResolve True
> buildLabel              foresight.rpath....@fl:2-devel
> installLabelPath        foresight.rpath....@fl:2-devel-kernel
> foresight.rpath....@fl:2-devel conary.rpath....@rpl:2-qa
> conary.rpath....@rpl:1-compat
> shortenGroupFlavors True
> {code}
> 
> * Create a directory where you will checkout the existing
> foresight-user-guide package
> {code}
> mkdir -p ~/packaging/fl2-devel
> cd ~/packaging/fl2-devel
> cvc context fl2-devel
> cvc co foresight-user-guide
> cd foresight-user-guide
> {code}
> 
> * Now that we have the package checked out, we can modify its recipe
> to use a tarball containing our changes instead of pulling from the
> mercurial repository. Just to be clear:
> ** We still have to create the tarball I mentioned above
> ** We will comment out the line that starts with
> r.addMercurialSnapshot by adding a # in front of it
> ** We will add a r.addArchive with the name of the tarball we generate
> * So the recipe will then look like:
> {code}
> #
> # Copyright (c) 2007 Foresight Linux
> # This file is distributed under the terms of the MIT License.
> # A copy is available at
> http://www.rpath.com/permanent/mit-license.html #
> 
> class ForesightUserGuide(PackageRecipe):
>     name = 'foresight-user-guide'
>     version = '0.0.6'
> 
>     buildRequires = ['desktop-file-utils:runtime', 'make:runtime']
> 
>     def setup(r):
>         
> #r.addMercurialSnapshot('http://hg.foresightlinux.org/hg/foresight-user-guide-2',
> tag='%(version)s')
>         r.addArchive('foresight-user-guide.tar.gz')
>         r.MakeInstall()
> {code}
> 
> * Create a tar.gz file of the entire
> ~/foresight-devel/foresight-user-guide-2 directory and save it as
> foresight-user-guide.tar.gz in the
> ~/packaging/fl2-devel/foresight-user-guide directory.
> 
> * Then cook it with cvc or rmake (I have not included my rmakerc
> context here):
> 
> {code}
> cvc cook foresight-user-guide.recipe
> {code}
> 
> * You can then inspect the resulting chnageset file:
> 
> {code}
> conary scs --ls foresight-user-guide-0.0.6.ccs
> {code}
> 
> * Better yet, install it and see your work "live":
> 
> {code}
> sudo conary update foresight-user-guide-0.0.6.ccs
> {code}
> 
> * Are you happy now? Great! Now generate a nice patch and send it our
> way so that we can review it and apply it.
> 
> {code}
> cd ~/foresight-devel/foresight-user-guide-2
> hg diff > ~/Desktop/fixesforwebsite.patch
> {code}
> 
> * Send us the ~/Desktop/fixesforwebsite.patch file and feel good about
> yourself! :)
> 



-- 
Tomas Forsman

Foresight Linux Developer
http://www.foresightlinux.se
http://www.foresightlinux.org
_______________________________________________
Foresight-devel mailing list
[email protected]
http://lists.rpath.org/mailman/listinfo/foresight-devel

Reply via email to