aboutsummaryrefslogtreecommitdiff
blob: 3156265a2e321844695a4c18c8d44bfc3d2fd1c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link title="new" rel="stylesheet" href="/css/main.css" type="text/css">
<link REL="shortcut icon" HREF="/favicon.ico" TYPE="image/x-icon">
<link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/www-gentoo-org.xml" title="Gentoo Website">
<link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/forums-gentoo-org.xml" title="Gentoo Forums">
<link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/bugs-gentoo-org.xml" title="Gentoo Bugzilla">
<link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/packages-gentoo-org.xml" title="Gentoo Packages">
<link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/archives-gentoo-org.xml" title="Gentoo List Archives">
<title>Gentoo Linux Documentation
--
  Ebuild Generator GSoC 2011</title>
</head>
<body style="margin:0px;" bgcolor="#ffffff"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td valign="top" height="125" bgcolor="#45347b"><a href="/"><img border="0" src="/images/gtop-www.jpg" alt="Gentoo Logo"></a></td></tr>
<tr><td valign="top" align="right" colspan="1" bgcolor="#ffffff"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr>
<td width="99%" class="content" valign="top" align="left">
<br><h1>Ebuild Generator GSoC 2011</h1>
<form name="contents" action="http://www.gentoo.org">
<b>Content</b>:
        <select name="url" size="1" OnChange="location.href=form.url.options[form.url.selectedIndex].value" style="font-family:sans-serif,Arial,Helvetica"><option value="#doc_chap1">1. Introduction</option>
<option value="#doc_chap2">2. How to use</option>
<option value="#doc_chap3">3. Where to go from here</option></select>
</form>
<p class="chaphead"><a name="doc_chap1"></a><span class="chapnum">1. 
            </span>Introduction</p>
<p class="secthead"><a name="doc_chap1_sect1">What problem does this project try to solve?</a></p>
<p>
            When writing ebuilds it can be a hassle to hunt down dependecies for
            the program and link them to the useflag that triggers them.
        </p>
<p>
            The point of this program is to help users write ebuilds by generating
            the useflags, dependecies and link useflags to dependecies for them.
            It is able to guess dependecies for packages that are not installed on the system.
        </p>
<p>
            Note that if the program that you try to generate the ebuild for is a simple
            <span class="code-input">"./configure &amp;&amp; make &amp;&amp; make install"</span> project the generated ebuild should not
            need any edits to work
        </p>
<p class="chaphead"><a name="doc_chap2"></a><span class="chapnum">2. 
            </span>How to use</p>
<p class="secthead"><a name="doc_chap2_sect1">Installation</a></p>
<p>
            At this time the ebuild for the ebuild generator is not in portage, get it from the overlay dir on:
            <a href="https://github.com/DarkDefender/ebuildgen">https://github.com/DarkDefender/ebuildgen</a> .
            After you have emerged it you should be able to run the program with the command "genebuild"
        </p>
<p class="secthead"><a name="doc_chap2_sect2">Gererating an ebuild</a></p>
<p>
                Lets say I want to generate an ebuild for the "moc" project (<a href="http://moc.daper.net">http://moc.daper.net</a>).
                It's svn based so I simply type the following command.
            </p>
<a name="doc_chap2_pre1"></a><table class="ntable" width="100%" cellspacing="0" cellpadding="0" border="0">
<tr><td bgcolor="#7a5ada"><p class="codetitle">Code Listing 2.1: Generating and ebuild from svn</p></td></tr>
<tr><td bgcolor="#eeeeff" align="left" dir="ltr"><pre>
                    $ <span class="code-input">genebuild --svn svn://daper.net/moc/trunk</span>
                </pre></td></tr>
</table>
<table class="ncontent" width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td bgcolor="#bbffbb"><p class="note"><b>Note: </b>
                    At this time the ebuild generator only supports GIT, HG and SVN
                </p></td></tr></table>
<p>
                It will go ahead and download the source code to <span class="path" dir="ltr">/tmp/ebuildgen/curproj/</span>
                and then search the project for the topmost configure.{in,ac}. Then it will use the
                Makefile.ac in the same dir as the configure script and then scan the source files.
            </p>
<p>
                When it is done scanning source files it will try to link the includes it found in
                the source files to packages using qfile and the pfl online database.
            </p>
<table class="ncontent" width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td bgcolor="#ffffbb"><p class="note"><b>Important: </b>Make sure to double check that the dependecies that it pulls in are sane!</p></td></tr></table>
<p>
                After the generator is done it will place the generated ebuild in 
                <span class="path" dir="ltr">/tmp/ebuildgen/generated.ebuild</span>.
                Rename and edit the ebuild to you liking, put it in your local portage and emerge away.
            </p>
<p class="chaphead"><a name="doc_chap3"></a><span class="chapnum">3. 
            </span>Where to go from here</p>
<p class="secthead"><a name="doc_chap3_sect1">Sanity checks</a></p>
<p>
                Because the generator doesn't run anycode from the projects that it will generate an ebuild for,
                it is likely that there will be cases where it guesses wrong dependecies.
                There for it would be good to have a check that tells the uses if the generator pulled in any
                obsolete packages or missed some vital ones.
            </p>
<p>
                If the "auto dependency builder" by Alexander Bersenev doesn't get included in portage I'll try
                to implement it to solve this problem.
                That way my ebuild generator "guesses" and the auto dependency builder confirms if the generator
                has guessed right.
            </p>
<p class="secthead"><a name="doc_chap3_sect2">Support for more languages and build scripts</a></p>
<p>
                There is very basic support for pure makefile projects in the generator. But I've disabled it as
                it is not good enough yet to be useful.
            </p>
<p>
                Before I start to try supporting other stuff I have to flesh out the current support that I have.
                There is alot for missing features and/or incomplete features that needs to be done.
            </p>
<p>
                But after that I think I'll try to support scons/cmake and later perhaps python projects.
            </p>
<p class="secthead"><a name="doc_chap3_sect3">Interested in contributing to the project?</a></p>
<p>
                Please contact me with the email on this page or pm/ping me on IRC.
                I usually hang out in #gentoo-chat on freenode by the name "DarkDefender"
            </p>
<p>
                The source code is located on github <a href="https://github.com/DarkDefender/ebuildgen">https://github.com/DarkDefender/ebuildgen</a>
            </p>
<br><br>
</td>
<td width="1%" bgcolor="#dddaec" valign="top"><table border="0" cellspacing="4px" cellpadding="4px">
<tr><td class="topsep" align="center"><p class="altmenu"><a title="View a printer-friendly version" class="altlink" href="darkdefende@gmail.com?style=printable">Print</a></p></td></tr>
<tr><td class="topsep" align="center"><p class="alttext">Updated August 16, 2011</p></td></tr>
<tr><td class="topsep" align="left"><p class="alttext"><b>Summary: </b>
  Generate ebuilds for autotools C/C++ based projects. The main goal is to
  help users write ebuilds by guessing useflags and dependecies.
</p></td></tr>
<tr><td align="left" class="topsep"><p class="alttext">
   <a href="mailto:darkdefende@gmail.com" class="altlink"><b>Sebastian Parborg</b></a>
<br><i>Author</i><br></p></td></tr>
<tr lang="en"><td align="center" class="topsep">
<p class="alttext"><b>Donate</b> to support our development efforts.
        </p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick"><input type="hidden" name="business" value="paypal@gentoo.org"><input type="hidden" name="item_name" value="Gentoo Linux Support"><input type="hidden" name="item_number" value="1000"><input type="hidden" name="image_url" value="/images/paypal.png"><input type="hidden" name="no_shipping" value="1"><input type="hidden" name="return" value="http://www.gentoo.org"><input type="hidden" name="cancel_return" value="http://www.gentoo.org"><input type="image" src="http://images.paypal.com/images/x-click-but21.gif" name="submit" alt="Donate to Gentoo">
</form>
</td></tr>
<tr lang="en"><td align="center"><iframe src="http://sidebar.gentoo.org" scrolling="no" width="125" height="850" frameborder="0" style="border:0px padding:0x" marginwidth="0" marginheight="0"><p>Your browser does not support iframes.</p></iframe></td></tr>
</table></td>
</tr></table></td></tr>
<tr><td colspan="2" align="right" class="infohead">
Copyright 2001-2011 Gentoo Foundation, Inc. Questions, Comments? <a class="highlight" href="/main/en/contact.xml">Contact us</a>.
</td></tr>
</table></body>
</html>