HOWTO: Patch & Rebuild a Package

General discussions about AsteriskNOW.

Moderators: Moderator, Support

HOWTO: Patch & Rebuild a Package

Postby j4m3s » Thu Mar 08, 2007 5:18 pm

Getting AsteriskNOW to do exactly what you need seems a little tricky at first for developers not familiar with conary.

How do I recompile <somepackage>??
Where's the source code??


AsteriskNOW comes with all the development packages you need in order to get started, like gcc, libstdc++, etc.. But where's the source code?

Short answer, there is none.

This is because using rPath's technology, developers only need a set of instructions for the computer to follow in order to obtain the right results (binaries in this case).

This is where recipes come in. Recipes tell conary where to get source code, what patches to add, and where to put it when its all done. Additionally, it can also specify libraries that it provides or requires in order to be built (this is a dream come true for packagers). I'm sure all the RedHat/Debian users all say 'but [RedHat,Debian] can do that'

Well for anyone thats ever hosed a system by doing an 'apt-get upgrade' or something similar with redhat/yum you discover there are inherent problems with those package managers. Mainly due to their 'dumb' behavior, as in pull the latest package for that version of distribution. Well those binaries store limited amounts of history of buildtime dependencies (normally something libsomething.so.4) and can create problems when something like an api change made it into a non-major release of a library.

This is where Conary is different. In each package, conary stores build & runtime dependency versions; down to what version of code, what version of recipe, and what build iteration. Granted it's still linux, but now with the ability to drill down to exactly where/when that package and its contents came from, as well as where to go for information on its dependencies.

Now, after all thats out of the way, down to the nitty-gritty...
Last edited by j4m3s on Sun Feb 17, 2008 12:10 pm, edited 2 times in total.
j4m3s
Oldsterisk
 
Posts: 249
Joined: Fri Dec 22, 2006 1:31 pm

Postby j4m3s » Thu Mar 08, 2007 5:36 pm

Making Conary changesets is a little different than making RPMS or debs (although if it makes you feel any better, some of the original developers of RPM created Conary)

In this example will do a more complicated example which demonstrates the more advanced features of conary, just for good measure :wink:

Say I want to add a patch to zaptel, (this requires building against kernel headers, hence more involved :o )

1. First, you'll need to checkout the recipe
Code: Select all
cd /home/admin/src
cvc co zaptel
cd zaptel


2. Now, place your patch in the dir, edit the recipe and add a line for your patch somewhere after the r.addArchive, but before the r.Configure
Code: Select all
r.addPatch('mypatchfile.diff')

NOTE: the patch will need to be generated from the top-level dir of the zaptel source (this is normally the case though)


3. Now we'll need to cook the recipe, you may need to specify a different kver and leave off the '[zaptel.smp]' if its non-smp
Code: Select all
cvc cook --macro 'kver 2.6.17.11-1.1.smp.x86.cmov' zaptel.recipe[zaptel.smp]

This is where the 'complication' comes in. Normally you wouldnt need to supply all of these options, but since we need to build against a kernel we have to tell it exactly which one, otherwise CRASHBOOMBANG


4a. Now it might barf due to unmet dependencies which you can install with conary
Code: Select all
sudo conary update <package>:<component> --resolve

4b. You may need to get the kernel headers too
Code: Select all
conary update kernel:build-tree --sync-to-parents

If it builds successfully you'll end up with a <package>-<version>.ccs file, which will be in the directory from where you executed the 'cvc cook ..'


5. Finally. install the .ccs file via conary
Code: Select all
sudo conary update zaptel-1.4.0.ccs


Hope this answers most of your questions and best of luck! 8)
j4m3s
Oldsterisk
 
Posts: 249
Joined: Fri Dec 22, 2006 1:31 pm

Postby lancsman » Fri Mar 09, 2007 3:53 am

My Limited understanding of Conary would have taken me straight to action 4a. So are you saying that inorder to use the conary update there are other action that are need first?

Mark
lancsman
Newsterisk
 
Posts: 49
Joined: Sat Sep 17, 2005 6:34 am
Location: UK

Postby j4m3s » Fri Mar 09, 2007 10:38 am

lancsman wrote:My Limited understanding of Conary would have taken me straight to action 4a. So are you saying that inorder to use the conary update there are other action that are need first?

Mark


This is for compiling your own special version and turn it into a package conary can install on your system.

If you are looking to just install additional packages then 'conary update...' will do the trick
j4m3s
Oldsterisk
 
Posts: 249
Joined: Fri Dec 22, 2006 1:31 pm

Postby santosam » Mon Mar 12, 2007 5:38 am

I once installed the text editor "joe" using the conary update joe command, but the next time I tried an update from the rPath Agent, it removed the joe package because it was not listed in the AsteriskNow "file list" (I know that there is a more proper name for that)
santosam
Oldsterisk
 
Posts: 137
Joined: Fri Feb 16, 2007 1:47 pm
Location: Portugal

Postby j4m3s » Mon Mar 12, 2007 9:15 am

santosam wrote:I once installed the text editor "joe" using the conary update joe command, but the next time I tried an update from the rPath Agent, it removed the joe package because it was not listed in the AsteriskNow "file list" (I know that there is a more proper name for that)


The reason it uninstalls your package when you use rAA to update your system is because it "migrates" your system to whatever is latest on the repo. This migration removes any additional runtime packages you have installed, like mysql-server in this case.

you can turn off this behavior by editing /etc/raa/prod.cfg

Code: Select all
# Set to False if you want to use updateall instead of migrate
updatetroves.migrate = True

to
Code: Select all
# Set to False if you want to use updateall instead of migrate
updatetroves.migrate = False
j4m3s
Oldsterisk
 
Posts: 249
Joined: Fri Dec 22, 2006 1:31 pm

Postby redoxoder » Tue Feb 05, 2008 3:10 pm

hello
sorry but
i want to add modif to chan_sip
i want to add pickup change for thomson2030
how to do???

http://www.thomsontelecompartner.com...tion.php?id=87


thks
redoxoder
Newsterisk
 
Posts: 17
Joined: Fri Sep 28, 2007 3:48 am

Postby ngs » Tue May 20, 2008 12:13 pm

I can't checkout recipe

Code: Select all
[admin@localhost src]$ pwd
/home/admin/src
[admin@localhost src]$ ls -l
total 0
[admin@localhost src]$ cat /etc/distro-release
AsteriskNOW Release 1.0.2
[admin@localhost src]$ cvc co zaptel
error: zaptel:source was not found on path asterisknow.digium.com@*now:1

Please tell me what I doing wrong?
AsteriskNOW-1.0.2.1-x86
ngs
Newsterisk
 
Posts: 1
Joined: Tue May 20, 2008 11:11 am

Postby g4m3c4ck » Fri Dec 05, 2008 9:23 am

Saw this in another thread but I like to share it.

In order to keep the packages you intstalled you need to modify the /etc/raa/plugins.d/updatetroves.cfg file not the /etc/raa/prod.conf file


At least is was that way for me.
g4m3c4ck
Newsterisk
 
Posts: 19
Joined: Tue Nov 18, 2008 7:01 am

Postby bkruse » Fri Dec 05, 2008 2:55 pm

g4m3c4ck wrote:Saw this in another thread but I like to share it.

In order to keep the packages you intstalled you need to modify the /etc/raa/plugins.d/updatetroves.cfg file not the /etc/raa/prod.conf file


At least is was that way for me.


Thanks for the info g4m3c4ck!

-bk
bkruse
Site Admin
 
Posts: 878
Joined: Mon Dec 04, 2006 3:20 pm
Location: Huntsville, Alabama


Return to AsteriskNOW General

Who is online

Users browsing this forum: No registered users and 1 guest

cron