This file is indexed.

/usr/share/doc/defoma-doc/developers.html/ch2.html is in defoma-doc 0.11.12ubuntu1.

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
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">

<html>

<head>

<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">

<title>Developers' Guide to Defoma - Application Package's HOWTO</title>

<link href="index.html" rel="start">
<link href="ch1.html" rel="prev">
<link href="index.html" rel="next">
<link href="index.html#contents" rel="contents">
<link href="index.html#copyright" rel="copyright">
<link href="ch1.html" rel="chapter" title="1 Font Package's TODO">
<link href="ch2.html" rel="chapter" title="2 Application Package's HOWTO">
<link href="ch1.html#s1.1" rel="section" title="1.1 Creating Hintfile.">
<link href="ch1.html#s1.2" rel="section" title="1.2 Editing Hintfile.">
<link href="ch1.html#s1.3" rel="section" title="1.3 Packaging.">
<link href="ch1.html#s1.2.1" rel="subsection" title="1.2.1 Multiple Face/Charset in a Single Font.">
<link href="ch1.html#s1.3.1" rel="subsection" title="1.3.1 Using dh_installdefoma.">
<link href="ch1.html#s1.3.2" rel="subsection" title="1.3.2 Without using dh_installdefoma.">

</head>

<body>

<p><a name="ch2"></a></p>
<hr>

<p>
[ <a href="ch1.html">previous</a> ]
[ <a href="index.html#contents">Contents</a> ]
[ <a href="ch1.html">1</a> ]
[ 2 ]
[ <a href="index.html">next</a> ]
</p>

<hr>

<h1>
Developers' Guide to Defoma
<br>Chapter 2 - Application Package's HOWTO
</h1>

<hr>

<p>
Applications that are configurable about fonts and have users configure about
fonts by some means are able to achieve dynamic configuration about fonts
through Defoma framework.  This chapter describes how to build a Defoma-aware
application package step by step.
</p>
<ol type="1" start="1" >
<li>
<p>
Prepare a Defoma-configuration script.  This script is provided by each
application that uses the Defoma framework and configures fonts for its
application.  It is called whenever a font is installed or removed, so that it
updates the configuration about fonts.  How to write a Defoma-configuration
script is not described in this document, so please refer others.
</p>

<p>
The Defoma configuration script must be put under <samp>debian/</samp>
subdirectory and its name should be <samp>&lt;package-name&gt;.defoma</samp>.
</p>
</li>
</ol>
<ol type="1" start="2" >
<li>
<p>
Edit <samp>debian/rules</samp> to call dh_installdefoma in binary-arch or
binary-indep phase.
</p>

<pre>
     		(ex: debian/rules)
     		binary-indep: build install
     		       dh_testdir
     		       dh_testroot
     		       dh_installdebconf
     		       dh_installdefoma
     		       dh_installdocs
                            ...
</pre>

<p>
FYI, dh_installdefoma actually performs the following steps.
</p>
<ul>
<li>
<p>
Edit <samp>debian/rules</samp> file to install the script into
<samp>usr/share/defoma/scripts</samp>.
</p>

<pre>
     		      (ex: debian/rules)
     		      DIR = `pwd`/debian/&lt;package-name&gt;
     		      ...
     		      install: build
     		      ...
     		      install -m 644 debian/&lt;package-name&gt;.defoma \
     		      $(DIR)/usr/share/defoma/scripts
</pre>
</li>
</ul>
<ul>
<li>
<p>
Edit <samp>debian/dirs</samp> file to create
<samp>usr/share/defoma/scripts</samp> and
<samp>var/lib/defoma/&lt;package-name&gt;.d</samp> directories.
</p>

<pre>
     		      (ex: debian/dirs)
     		      usr/share/defoma/scripts
     		      var/lib/defoma/&lt;package-name&gt;.d
</pre>
</li>
</ul>
<ul>
<li>
<p>
When the application package is installed, the Defoma-configuration script
needs to configure about installed fonts for the application.  To make it
possible, edit <samp>debian/postinst</samp> file to call defoma-app with update
command.
</p>

<pre>
     		      (ex: debian/postinst)
     		      ...
     		      if [ &quot;$1&quot; = configure ]; then
     		      /usr/bin/defoma-app update &lt;package-name&gt;
     		      fi
     		      ...
</pre>
</li>
</ul>
<ul>
<li>
<p>
When the application package is removed/upgraded, the Defoma-configuration
script needs to clean up the configuration.  Edit <samp>debian/prerm</samp>
file to call defoma-app with purge/clean command respectively.
</p>

<pre>
     		      (ex: debian/prerm)
     		      ...
     		      if [ &quot;$1&quot; = remove ]; then
     		      /usr/bin/defoma-app purge &lt;package-name&gt;
     		      fi
     		      if [ &quot;$1&quot; = upgrade ]; then
     		      /usr/bin/defoma-app clean &lt;package-name&gt;
     		      fi
     		      ...
</pre>

<p>
In addition, when the application package is removed,
<samp>/var/lib/defoma/&lt;package-name&gt;.d</samp> directory MUST be removed
without fail.  Edit <samp>debian/postrm</samp> file to remove the directory.
</p>

<pre>
     		      (ex: debian/postrm)
     		      ...
     		      if [ &quot;$1&quot; = remove ]; then
     		      /bin/rm -fr /var/lib/defoma/&lt;package-name&gt;.d
     		      fi
     		      ...
</pre>
</li>
</ul>
</li>
</ol>
<ol type="1" start="3" >
<li>
<p>
If the application package provides a public subst-rule (see Defoma::Subst
manpage), the rulefile should be created at postinst if the rulefile doesn't
exist.  Edit <samp>debian/postinst</samp> file to call defoma-subst with
new-rule command.  It should be called before defoma-app.
</p>

<pre>
     		(ex: debian/postinst)
     		...
     		if [ &quot;$1&quot; = configure ]; then
     		  if [ ! -f &quot;/etc/defoma/&lt;rulename&gt;.subst-rule ]; then
     		    /usr/bin/defoma-subst new-rule &lt;rulename&gt;
     		  fi
     		  ..
     		  /usr/bin/defoma-app update &lt;package-name&gt;
     		fi
</pre>

<p>
Created rulefile is considered as conffile, so it must be removed when the
package is purged.  Edit <samp>debian/postrm</samp> file to remove the rulefile
at purge.
</p>

<pre>
     		(ex: debian/postrm)
     		...
     		FILE='/etc/defoma/&lt;rulename&gt;.subst-rule'
     		if [ &quot;$1&quot; = purge ]; then
     		  /bin/rm -f $FILE $FILE&tilde;
     		fi
</pre>
</li>
</ol>
<ol type="1" start="4" >
<li>
<p>
Edit <samp>debian/control</samp> to make the package depend on defoma.
</p>

<pre>
     		(ex: debian/control)
     		Build-Depends: defoma (&gt;= 0.7.0)
     		...
     		Depends: defoma (&gt;= x.y.z)
     		...
</pre>

<p>
Which version to depend is decided by what function the script makes use of.
See <samp>/usr/share/doc/defoma-doc/version-dependency.txt</samp> for more
detail.
</p>
</li>
</ol>
<ol type="1" start="5" >
<li>
<p>
It is recommended to provide README.Defoma which describes categories which the
script accepts and installs to, and HintTypes which the script particularly
uses.
</p>
</li>
</ol>

<hr>

<p>
[ <a href="ch1.html">previous</a> ]
[ <a href="index.html#contents">Contents</a> ]
[ <a href="ch1.html">1</a> ]
[ 2 ]
[ <a href="index.html">next</a> ]
</p>

<hr>

<p>
Developers' Guide to Defoma
</p>

<address>
Yasuhiro Take (take@debian.org)<br>
<br>
</address>
<hr>

</body>

</html>