This file is indexed.

/usr/share/doc/fdroidserver/html/html_node/Building-Applications.html is in fdroidserver 0.7.0-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- This manual is for the F-Droid repository server tools.

Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015 Ciaran Gultnieks

Copyright (C) 2011 Henrik Tunedal, Michael Haas, John Sullivan

Copyright (C) 2013 David Black

Copyright (C) 2013, 2014, 2015 Daniel Martí

Copyright (C) 2015 Boris Kraut

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled "GNU
Free Documentation License". -->
<!-- Created by GNU Texinfo 6.3, http://www.gnu.org/software/texinfo/ -->
<head>
<title>F-Droid Server Manual: Building Applications</title>

<meta name="description" content="F-Droid Server Manual: Building Applications">
<meta name="keywords" content="F-Droid Server Manual: Building Applications">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Index.html#Index" rel="index" title="Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="index.html#Top" rel="up" title="Top">
<link href="Importing-Applications.html#Importing-Applications" rel="next" title="Importing Applications">
<link href="Simple-Binary-Repository.html#Simple-Binary-Repository" rel="prev" title="Simple Binary Repository">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smalllisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>


</head>

<body lang="en">
<a name="Building-Applications"></a>
<div class="header">
<p>
Next: <a href="Importing-Applications.html#Importing-Applications" accesskey="n" rel="next">Importing Applications</a>, Previous: <a href="Simple-Binary-Repository.html#Simple-Binary-Repository" accesskey="p" rel="prev">Simple Binary Repository</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index.html#Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="Building-Applications-1"></a>
<h2 class="chapter">5 Building Applications</h2>

<p>Instead of (or as well as) including binary APKs from external sources in a
repository, you can build them directly from the source code.
</p>
<p>Using this method, it is is possible to verify that the application builds
correctly, corresponds to the source code, and contains only free software.
Unforunately, in the Android world, it seems to be very common for an
application supplied as a binary APK to present itself as Free Software
when in fact some or all of the following are true:
</p>
<ol>
<li> The source code (either for a particular version, or even all versions!) is
unavailable or incomplete.
</li><li> The source code is not capable of producing the actual binary supplied.
</li><li> The &rsquo;source code&rsquo; contains binary files of unknown origin, or with proprietary
licenses.
</li></ol>

<p>For this reason, source-built applications are the preferred method for the
main F-Droid repository, although occasionally for technical or historical
reasons, exceptions are made to this policy.
</p>
<p>When building applications from source, it should be noted that you will be
signing them (all APK files must be signed to be installable on Android) with
your own key. When an application is already installed on a device, it is not
possible to upgrade it in place to a new version signed with a different key
without first uninstalling the original. This may present an inconvenience to
users, as the process of uninstalling loses any data associated with the
previous installation.
</p>
<p>The process for managing a repository for built-from-source applications is
very similar to that described in the Simple Binary Repository chapter,
except now you need to:
</p>
<ol>
<li> Include Build entries in the metadata files.
</li><li> Run <code>fdroid build</code> to build any applications that are not already built.
</li><li> Run <code>fdroid publish</code> to finalise packaging and sign any APKs that have
been built.
</li></ol>


<a name="More-about-_0022fdroid-build_0022"></a>
<h3 class="section">5.1 More about &quot;fdroid build&quot;</h3>

<p>When run without any parameters, <code>fdroid build</code> will build any and all
versions of applications that you don&rsquo;t already have in the <code>repo</code>
directory (or more accurately, the <code>unsigned</code> directory). There are various
other things you can do. As with all the tools, the <code>--help</code> option is
your friend, but a few annotated examples and discussion of the more common
usage modes follows:
</p>
<p>To build a single version of a single application, you could run the
following:
</p>
<div class="example">
<pre class="example">fdroid build org.fdroid.fdroid:16
</pre></div>

<p>This attempts to build version code 16 (which is version 0.25) of the F-Droid
client. Many of the tools recognise arguments as packages, allowing their
activity to be limited to just a limited set of packages.
</p>
<p>If the build above was successful, two files will have been placed in the
<code>unsigned</code> directory:
</p>
<div class="example">
<pre class="example">org.fdroid.fdroid_16.apk
org.fdroid.fdroid_16_src.tar.gz
</pre></div>

<p>The first is the (unsigned) APK. You could sign this with a debug key and push
it direct to your device or an emulator for testing. The second is a source
tarball containing exactly the source that was used to generate the binary.
</p>
<p>If you were intending to publish these files, you could then run:
</p>
<div class="example">
<pre class="example">fdroid publish
</pre></div>

<p>The source tarball would move to the <code>repo</code> directory (which is the
directory you would push to your web server). A signed and zip-aligned version
of the APK would also appear there, and both files would be removed from the
<code>unsigned</code> directory.
</p>
<p>If you&rsquo;re building purely for the purposes of testing, and not intending to
push the results to a repository, at least yet, the <code>--test</code> option can be
used to direct output to the <code>tmp</code> directory instead of <code>unsigned</code>.
A similar effect could by achieved by simply deleting the output files from
<code>unsigned</code> after the build, but with the risk of forgetting to do so!
</p>
<p>Along similar lines (and only in conjunction with <code>--test</code>, you can use
<code>--force</code> to force a build of a Disabled application, where normally it
would be completely ignored. Similarly a version that was found to contain
ELFs or known non-free libraries can be forced to build. See also —
<code>scanignore=</code> and <code>scandelete=</code> in the <code>Build:</code> section.
</p>
<p>If the build was unsuccessful, you can find out why by looking at the output
in the logs/ directory. If that isn&rsquo;t illuminating, try building the app the
regular way, step by step: android update project, ndk-build, ant debug.
</p>
<p>Note that source code repositories often contain prebuilt libraries. If the
app is being considered for the main F-Droid repository, it is important that
all such prebuilts are built either via the metadata or by a reputable third
party.
</p>

<a name="Running-_0022fdroid-build_0022-in-your-app_0027s-source"></a>
<h3 class="section">5.2 Running &quot;fdroid build&quot; in your app&rsquo;s source</h3>

<p>Another option for using <code>fdroid build</code> is to use a metadata file
that is included in the app&rsquo;s source itself, rather than in a
<code>metadata/</code> folder with lots of other apps.  This metadata file
should be in the root of your source repo, and be called
<code>.fdroid.json</code>, <code>.fdroid.xml</code>, <code>.fdroid.yaml</code>, or
<code>.fdroid.txt</code>, depending on your preferred data format: JSON,
XML, YAML, or F-Droid&rsquo;s <code>.txt</code> format.
</p>
<p>Once you have that setup, you can build the most recent version of
the app using the whole FDroid stack by running:
</p>
<div class="example">
<pre class="example">fdroid build
</pre></div>

<p>If you want to build every single version, then specify <code>--all</code>.
</p>

<a name="Direct-Installation"></a>
<h3 class="section">5.3 Direct Installation</h3>

<p>You can also build and install directly to a connected device or emulator
using the <code>fdroid install</code> command. If you do this without passing
packages as arguments then all the latest built and signed version available
of each package will be installed . In most cases, this will not be what you
want to do, so execution will stop straight away. However, you can override
this if you&rsquo;re sure that&rsquo;s what you want, by using <code>--all</code>.  Note that
currently, no sanity checks are performed with this mode, so if the files in
the signed output directory were modified, you won&rsquo;t be notified.
</p>

<hr>
<div class="header">
<p>
Next: <a href="Importing-Applications.html#Importing-Applications" accesskey="n" rel="next">Importing Applications</a>, Previous: <a href="Simple-Binary-Repository.html#Simple-Binary-Repository" accesskey="p" rel="prev">Simple Binary Repository</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index.html#Index" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>