Use this section if you want your package to start with C source code. Your package will have a two-part build process, first compiling the C code, and then packaging the resulting binaries.
If your C code compiles with the simple expected sequence "./configure; make; make install", you can spare extra lines in your package recipe and use the AutoPackageRecipe class from Conary:
# RECIPE TEMPLATE # Package from C source code using the simple compiler sequence class ExampleApp(AutoPackageRecipe): name = 'example' version = '1.0' buildRequires = [] def unpack(r): r.addArchive('http://www.example.com/%(name)s-sources/%(name)s-%(version)s.tgz')
Replace the class name, package name, version, and archive location as appropriate for your package. Each source or archive you add can be just a file name (if you're checking in those files with the recipe), a network-accessible location as shown in the template example, or a version control checkout action from among Conary's source actions.
For all C source code, you can use the CPackageRecipe class from Conary to package C code. Use this instead of AutoPackageRecipe when you need to make some additional adjustments before or during the compiling sequence:
# RECIPE TEMPLATE # Package from C source code class ExampleApp(CPackageRecipe): name = 'example' version = '1.0' buildRequires = [] def setup(r): r.addArchive('http://www.example.com/%(name)s-sources/%(name)s-%(version)s.tgz') r.Make(makeName = 'Makefile-differentname') r.Run('%(builddir)s/pre-install.sh') r.MakeInstall() r.Install('final.exe', '%(datadir)s/%(name)s/')
Replace the class name, package name, version, and archive location as appropriate for your package. Each source or archive you add can be just a file name (if you're checking in those files with the recipe), a network-accessible location as shown in the template example, or a version control checkout action from among Conary's source actions.
Note that the AutoPackageRecipe template defines the unpack method in the recipe, and the CPackageRecipe defines the setup method in the recipe. You can always use the setup method inherited from Conary, but you may need to use unpack or some other method to take advantage of superclass-specific tools. Be sure to note which method is used in the reference recipe or template you use as a guide.
Reference all the other actions you can add to your recipe in Conary Recipe Actions, Macros, and Variables at docs.rpath.com/conary.