1
00:00:00,000 --> 00:00:05,000
The next talk is packaging for beginners

2
00:00:05,000 --> 00:00:07,000
by Gergely Nagy

3
00:00:11,000 --> 00:00:13,000
This talk will be,

4
00:00:13,000 --> 00:00:15,000
about packaging in a

5
00:00:15,000 --> 00:00:17,000
much, different style than

6
00:00:17,000 --> 00:00:19,000
most would expect.

7
00:00:19,000 --> 00:00:21,000
So, first of all

8
00:00:21,000 --> 00:00:23,000
who amoung you have

9
00:00:23,000 --> 00:00:25,000
read the new maintainers guide

10
00:00:25,000 --> 00:00:27,000
or, the packaging guide or

11
00:00:27,000 --> 00:00:29,000
any of that stuff?

12
00:00:29,000 --> 00:00:31,000
How many of you

13
00:00:31,000 --> 00:00:33,000
enjoyed it? [laughter]

14
00:00:33,000 --> 00:00:35,000
[laughter]

15
00:00:35,000 --> 00:00:37,000
Alright, well that's

16
00:00:37,000 --> 00:00:39,000
because they are very dry

17
00:00:39,000 --> 00:00:41,000
and to make

18
00:00:41,000 --> 00:00:43,000
this talk, better and useful

19
00:00:43,000 --> 00:00:45,000
I will ignore everything that is written in

20
00:00:45,000 --> 00:00:47,000
them. [laughter] I would advise you

21
00:00:47,000 --> 00:00:49,000
to do the same because they are very

22
00:00:49,000 --> 00:00:51,000
useful once you know, what

23
00:00:51,000 --> 00:00:53,000
you are doing but when you are

24
00:00:53,000 --> 00:00:55,000
trying

25
00:00:55,000 --> 00:00:57,000
your first steps, they are

26
00:00:57,000 --> 00:00:59,000
an awful, boring

27
00:00:59,000 --> 00:01:01,000
piece of something.

28
00:01:01,000 --> 00:01:03,000
So, we will

29
00:01:03,000 --> 00:01:05,000
do something very different today.

30
00:01:05,000 --> 00:01:07,000
Another question, how

31
00:01:07,000 --> 00:01:09,000
many of you have read the policy

32
00:01:09,000 --> 00:01:11,000
from beginning to end?

33
00:01:13,000 --> 00:01:15,000
ok, congratulations!

34
00:01:15,000 --> 00:01:17,000
1 person, how many

35
00:01:17,000 --> 00:01:19,000
of you tried to read

36
00:01:19,000 --> 00:01:21,000
the policy ?

37
00:01:21,000 --> 00:01:23,000
How many of you got bored

38
00:01:23,000 --> 00:01:25,000
after the first 5 minutes?

39
00:01:25,000 --> 00:01:27,000
Yes,

40
00:01:27,000 --> 00:01:29,000
because the poilcy is not meant to be

41
00:01:29,000 --> 00:01:31,000
read from begining to

42
00:01:31,000 --> 00:01:33,000
end. You look at it

43
00:01:33,000 --> 00:01:35,000
trying to find things when lintian,

44
00:01:35,000 --> 00:01:37,000
yells at you.

45
00:01:37,000 --> 00:01:39,000
So, that's what we will do

46
00:01:39,000 --> 00:01:41,000
today.

47
00:01:43,000 --> 00:01:45,000
I have one small announcement

48
00:01:45,000 --> 00:01:47,000
to make,

49
00:01:47,000 --> 00:01:49,000
I have bad news. I promised

50
00:01:49,000 --> 00:01:51,000
ponies but it turns out

51
00:01:51,000 --> 00:01:53,000
ponysay is not

52
00:01:53,000 --> 00:01:55,000
free software. At, least

53
00:01:55,000 --> 00:01:57,000
the data is not.

54
00:01:57,000 --> 00:01:59,000
So, this talk we will

55
00:01:59,000 --> 00:02:01,000
package something entirely different,

56
00:02:01,000 --> 00:02:03,000
but since I promised ponies!

57
00:02:03,000 --> 00:02:05,000
Here is one I drew,

58
00:02:05,000 --> 00:02:07,000
today.

59
00:02:07,000 --> 00:02:09,000
Doesn't look

60
00:02:09,000 --> 00:02:11,000
like a pony! but.

61
00:02:13,000 --> 00:02:15,000
Okay.

62
00:02:15,000 --> 00:02:17,000
So, let's look at

63
00:02:17,000 --> 00:02:19,000
what we will be packaging today.

64
00:02:19,000 --> 00:02:21,000
It's a little program I

65
00:02:21,000 --> 00:02:23,000
wrote.

66
00:02:23,000 --> 00:02:25,000
Fit for,

67
00:02:25,000 --> 00:02:27,000
Debian's 20th birthday!

68
00:02:27,000 --> 00:02:29,000
The cake

69
00:02:29,000 --> 00:02:31,000
is a lie,

70
00:02:31,000 --> 00:02:33,000
appearently it isn't, but

71
00:02:33,000 --> 00:02:35,000
it's an ASCII art so it doesn't

72
00:02:35,000 --> 00:02:37,000
look like a cake.

73
00:02:37,000 --> 00:02:39,000
But, if you squint a little you might notice,

74
00:02:39,000 --> 00:02:41,000
that it is one.

75
00:02:41,000 --> 00:02:43,000
And, the resolution

76
00:02:43,000 --> 00:02:45,000
is terrible, so we have

77
00:02:45,000 --> 00:02:47,000
the text all over the place. [laughter]

78
00:02:47,000 --> 00:02:49,000
But that is ok, we don't mind.

79
00:02:49,000 --> 00:02:51,000
It looks better when the resolution

80
00:02:51,000 --> 00:02:53,000
is bigger, trust me on that. Anyway,

81
00:02:53,000 --> 00:02:55,000
we will take this piece of software

82
00:02:55,000 --> 00:02:57,000
it's, really easy and package

83
00:02:57,000 --> 00:02:59,000
it.

84
00:02:59,000 --> 00:03:01,000
It's your

85
00:03:01,000 --> 00:03:03,000
standard how to

86
00:03:03,000 --> 00:03:05,000
based thing written in C.

87
00:03:05,000 --> 00:03:07,000
It has one

88
00:03:07,000 --> 00:03:09,000
source file and that is about it.

89
00:03:09,000 --> 00:03:11,000
How do you go about packaging

90
00:03:11,000 --> 00:03:13,000
it ? Well, the easiest

91
00:03:13,000 --> 00:03:15,000
way is to call

92
00:03:15,000 --> 00:03:17,000
dpkd-buildpackage

93
00:03:19,000 --> 00:03:21,000
command.

94
00:03:21,000 --> 00:03:23,000
And see what it tells you,

95
00:03:23,000 --> 00:03:25,000
well it's missing a changelog and a debian

96
00:03:25,000 --> 00:03:27,000
directory, so let's make one.

97
00:03:29,000 --> 00:03:31,000
There is a handy tool called

98
00:03:31,000 --> 00:03:33,000
'dch', which is

99
00:03:33,000 --> 00:03:35,000
short of deb change

100
00:03:35,000 --> 00:03:37,000
it is mean't to,

101
00:03:37,000 --> 00:03:39,000
help you write change logs.

102
00:03:39,000 --> 00:03:41,000
And we will use it to

103
00:03:41,000 --> 00:03:43,000
create one.

104
00:03:45,000 --> 00:03:47,000
We fill it out

105
00:03:47,000 --> 00:03:49,000
you've probably seen a few change logs.

106
00:03:49,000 --> 00:03:51,000
It's not rocket science.

107
00:03:53,000 --> 00:03:55,000
Oh,

108
00:03:57,000 --> 00:03:59,000
ok,

109
00:03:59,000 --> 00:04:01,000
sorry.

110
00:04:03,000 --> 00:04:05,000
Fill it out.

111
00:04:07,000 --> 00:04:09,000
We do not have an ITP,

112
00:04:09,000 --> 00:04:11,000
bug to close, so that's about it.

113
00:04:11,000 --> 00:04:13,000
Let's see what it says now.

114
00:04:13,000 --> 00:04:15,000
Oh,

115
00:04:15,000 --> 00:04:17,000
lots of text! What did it

116
00:04:17,000 --> 00:04:19,000
type. Oh,

117
00:04:19,000 --> 00:04:21,000
we need a control file! What is a control file?

118
00:04:21,000 --> 00:04:23,000
Well, a control file

119
00:04:23,000 --> 00:04:25,000
tells, dpkg

120
00:04:25,000 --> 00:04:27,000
what

121
00:04:27,000 --> 00:04:29,000
sources you have and what binaries

122
00:04:29,000 --> 00:04:31,000
packages you want to build.

123
00:04:31,000 --> 00:04:33,000
So, we will hack up a really

124
00:04:33,000 --> 00:04:35,000
easy one.

125
00:04:35,000 --> 00:04:37,000
First, of all

126
00:04:37,000 --> 00:04:39,000
every control file

127
00:04:39,000 --> 00:04:41,000
has to have 2

128
00:04:41,000 --> 00:04:43,000
sections. The first section

129
00:04:43,000 --> 00:04:45,000
describes the source

130
00:04:45,000 --> 00:04:47,000
it looks a bit

131
00:04:47,000 --> 00:04:49,000
like,

132
00:04:51,000 --> 00:04:53,000
ok,

133
00:04:53,000 --> 00:04:55,000
sorry I always forget my editor is

134
00:04:55,000 --> 00:04:57,000
a bit dumb!

135
00:04:57,000 --> 00:04:59,000
The first section

136
00:04:59,000 --> 00:05:01,000
describes the source,

137
00:05:01,000 --> 00:05:03,000
which

138
00:05:03,000 --> 00:05:05,000
in this case

139
00:05:05,000 --> 00:05:07,000
is this.

140
00:05:07,000 --> 00:05:09,000
We also

141
00:05:09,000 --> 00:05:11,000
have a couple of other fields we need

142
00:05:11,000 --> 00:05:13,000
here like, maintainer

143
00:05:17,000 --> 00:05:19,000
we need a Section

144
00:05:21,000 --> 00:05:23,000
lets see

145
00:05:23,000 --> 00:05:25,000
games, will be fine

146
00:05:25,000 --> 00:05:27,000
and the

147
00:05:27,000 --> 00:05:29,000
priotity which will be extra.

148
00:05:29,000 --> 00:05:31,000
That should

149
00:05:31,000 --> 00:05:33,000
be enough for starters,

150
00:05:41,000 --> 00:05:43,000
and I need to learn to spell.

151
00:05:43,000 --> 00:05:45,000
The next section,

152
00:05:45,000 --> 00:05:47,000
is about the binary

153
00:05:47,000 --> 00:05:49,000
we will build one

154
00:05:49,000 --> 00:05:51,000
binary package

155
00:05:51,000 --> 00:05:53,000
except it's called Package.

156
00:05:55,000 --> 00:05:57,000
It has the same name.

157
00:05:59,000 --> 00:06:01,000
We give it a description,

158
00:06:07,000 --> 00:06:09,000
and,

159
00:06:09,000 --> 00:06:11,000
the long description starts

160
00:06:11,000 --> 00:06:13,000
right after in the next line.

161
00:06:13,000 --> 00:06:15,000
You have to start it with a space,

162
00:06:15,000 --> 00:06:17,000
because,

163
00:06:17,000 --> 00:06:19,000
this whole control files looks like an email.

164
00:06:21,000 --> 00:06:23,000
And starting

165
00:06:23,000 --> 00:06:25,000
with a space tells the,

166
00:06:25,000 --> 00:06:27,000
parser it

167
00:06:27,000 --> 00:06:29,000
is a continuation,

168
00:06:29,000 --> 00:06:31,000
of what was above.

169
00:06:39,000 --> 00:06:41,000
Ok and that is about it.

170
00:06:43,000 --> 00:06:45,000
So, we have a very

171
00:06:45,000 --> 00:06:47,000
simple control file.

172
00:06:47,000 --> 00:06:49,000
Let's see what the tool

173
00:06:49,000 --> 00:06:51,000
tells us.

174
00:06:51,000 --> 00:06:53,000
Oh,

175
00:06:53,000 --> 00:06:55,000
right we need an Architecture field.

176
00:07:01,000 --> 00:07:03,000
Every package in Debian must,

177
00:07:03,000 --> 00:07:05,000
have an

178
00:07:05,000 --> 00:07:07,000
Architecture associated

179
00:07:07,000 --> 00:07:09,000
with it.

180
00:07:11,000 --> 00:07:13,000
It can be

181
00:07:13,000 --> 00:07:15,000
either

182
00:07:15,000 --> 00:07:17,000
and Arch all

183
00:07:17,000 --> 00:07:19,000
package, which means the same

184
00:07:19,000 --> 00:07:21,000
binary will run on all

185
00:07:21,000 --> 00:07:23,000
architectures.

186
00:07:23,000 --> 00:07:25,000
In our case this is,

187
00:07:25,000 --> 00:07:27,000
wrong, because this is a C

188
00:07:27,000 --> 00:07:29,000
program which is compiled and

189
00:07:29,000 --> 00:07:31,000
it depends on the architecture.

190
00:07:31,000 --> 00:07:33,000
So, we write in here

191
00:07:33,000 --> 00:07:35,000
you could list

192
00:07:35,000 --> 00:07:37,000
the architectures here if your

193
00:07:37,000 --> 00:07:39,000
package is something that

194
00:07:39,000 --> 00:07:41,000
only works on a certain subset of

195
00:07:41,000 --> 00:07:43,000
of architectures.

196
00:07:45,000 --> 00:07:47,000
You can make it Linux,

197
00:07:47,000 --> 00:07:49,000
specific by writing linux-any

198
00:07:49,000 --> 00:07:51,000
or FreeBSD specific.

199
00:07:53,000 --> 00:07:55,000
by writing,

200
00:07:55,000 --> 00:07:57,000
kfreebsd-any.

201
00:07:57,000 --> 00:07:59,000
This is a portable thing so we will write,

202
00:07:59,000 --> 00:08:01,000
any.

203
00:08:01,000 --> 00:08:03,000
Going further,

204
00:08:03,000 --> 00:08:05,000
now it needs a rules

205
00:08:05,000 --> 00:08:07,000
file. We are progressing,

206
00:08:07,000 --> 00:08:09,000
a rules file is used

207
00:08:09,000 --> 00:08:11,000
to do the hard

208
00:08:11,000 --> 00:08:13,000
work.

209
00:08:13,000 --> 00:08:15,000
It tells dpkg

210
00:08:15,000 --> 00:08:17,000
rules

211
00:08:17,000 --> 00:08:19,000
about how to build a

212
00:08:19,000 --> 00:08:21,000
package. In the most simple case

213
00:08:21,000 --> 00:08:23,000
like ours,

214
00:08:27,000 --> 00:08:29,000
we will deal with

215
00:08:29,000 --> 00:08:31,000
this only.

216
00:08:31,000 --> 00:08:33,000
This is 'magic',

217
00:08:33,000 --> 00:08:35,000
'black magic',

218
00:08:35,000 --> 00:08:37,000
but the wonderful thing about

219
00:08:37,000 --> 00:08:39,000
black magic is that you don't need to

220
00:08:39,000 --> 00:08:41,000
understand it. If you need

221
00:08:41,000 --> 00:08:43,000
to change the way,

222
00:08:43,000 --> 00:08:45,000
the magic works.

223
00:08:45,000 --> 00:08:47,000
You only have to understand little

224
00:08:47,000 --> 00:08:49,000
pieces of it, and thankfully

225
00:08:49,000 --> 00:08:51,000
deb helper, which

226
00:08:51,000 --> 00:08:53,000
dh is a part of

227
00:08:53,000 --> 00:08:55,000
has wonderful documentation.

228
00:08:55,000 --> 00:08:57,000
Man pages and so on,

229
00:08:57,000 --> 00:08:59,000
and so forth.

230
00:08:59,000 --> 00:09:01,000
I would suggest,

231
00:09:01,000 --> 00:09:03,000
that if you start packaging,

232
00:09:03,000 --> 00:09:05,000
something. Start with this

233
00:09:05,000 --> 00:09:07,000
and

234
00:09:07,000 --> 00:09:09,000
if something goes wrong, go from there.

235
00:09:09,000 --> 00:09:11,000
We will see how things,

236
00:09:11,000 --> 00:09:13,000
will go wrong and

237
00:09:13,000 --> 00:09:15,000
by the way Debian

238
00:09:15,000 --> 00:09:17,000
rules is a make file thats

239
00:09:17,000 --> 00:09:19,000
why we have this first

240
00:09:19,000 --> 00:09:21,000
line here.

241
00:09:21,000 --> 00:09:23,000
We also need to make

242
00:09:23,000 --> 00:09:25,000
it executable, of course.

243
00:09:27,000 --> 00:09:29,000
Now, lets see what happens

244
00:09:31,000 --> 00:09:33,000
oh, yeah.

245
00:09:35,000 --> 00:09:37,000
Since it's a make file,

246
00:09:37,000 --> 00:09:39,300
I have to make it a makefile.

247
00:09:41,300 --> 00:09:43,300
There we go.

248
00:09:45,300 --> 00:09:47,300
Well,

249
00:09:47,300 --> 00:09:49,300
it did things.

250
00:09:51,300 --> 00:09:53,300
But, it also

251
00:09:53,300 --> 00:09:55,300
gave us a lot of

252
00:09:55,300 --> 00:09:57,300
errors and

253
00:09:57,300 --> 00:09:59,300
other things.

254
00:09:59,300 --> 00:10:01,300
So, we need to tell this

255
00:10:01,300 --> 00:10:03,300
tool to ignore,

256
00:10:03,300 --> 00:10:05,300
the git directory

257
00:10:05,300 --> 00:10:07,300
and a couple of other

258
00:10:07,300 --> 00:10:09,300
things. The best way to do that,

259
00:10:13,300 --> 00:10:15,300
is to set the

260
00:10:15,300 --> 00:10:17,300
source format to,

261
00:10:17,300 --> 00:10:19,300
the one it suggests.

262
00:10:19,300 --> 00:10:21,300
Right, here at the bottom.

263
00:10:21,300 --> 00:10:23,300
We can do that by

264
00:10:23,300 --> 00:10:25,300
creating a new directories,

265
00:10:25,300 --> 00:10:27,300
called debian and then source.

266
00:10:29,300 --> 00:10:31,300
And, creating

267
00:10:31,300 --> 00:10:33,300
a new file in it

268
00:10:33,300 --> 00:10:35,300
called format.

269
00:10:37,300 --> 00:10:39,300
Which has the text,

270
00:10:39,300 --> 00:10:41,300
'3.0

271
00:10:41,300 --> 00:10:43,300
(quilt)' in it.

272
00:10:43,300 --> 00:10:45,300
What this format does you

273
00:10:45,300 --> 00:10:47,300
don't need to know, at least

274
00:10:47,300 --> 00:10:49,300
not right now. It's

275
00:10:49,300 --> 00:10:51,300
pretty complicated and

276
00:10:51,300 --> 00:10:53,300
its a similiar

277
00:10:53,300 --> 00:10:55,300
kind of 'magic' as debhelper.

278
00:10:57,300 --> 00:10:59,300
It just has less documentation.

279
00:11:01,300 --> 00:11:03,300
We also want to tell debhelper that,

280
00:11:03,300 --> 00:11:05,300
we want to use

281
00:11:05,300 --> 00:11:07,300
the latest and greatest version of

282
00:11:07,300 --> 00:11:09,300
it. It was

283
00:11:09,300 --> 00:11:11,300
complaining about that to at the beginning,

284
00:11:11,300 --> 00:11:13,300
but I'm not going to scroll that high up.

285
00:11:13,300 --> 00:11:15,300
Which we can do by,

286
00:11:15,300 --> 00:11:17,300
echoing a '9' into a file called

287
00:11:17,300 --> 00:11:19,300
debian/compat .

288
00:11:19,300 --> 00:11:21,300
Now, lets see what happens.

289
00:11:23,300 --> 00:11:25,300
Well, this is

290
00:11:25,300 --> 00:11:27,300
much, much,

291
00:11:27,300 --> 00:11:29,300
improved.

292
00:11:31,300 --> 00:11:33,300
It compilied and now it is doing,

293
00:11:33,300 --> 00:11:35,300
somethings and it

294
00:11:35,300 --> 00:11:37,300
it is also asking for my password.

295
00:11:39,300 --> 00:11:41,300
No, I'm not going to sign it right now.

296
00:11:45,300 --> 00:11:47,300
So, it did stuff.

297
00:11:47,300 --> 00:11:49,300
It also built,

298
00:11:51,300 --> 00:11:53,300
a debian package for us,

299
00:11:53,300 --> 00:11:55,300
which is great.

300
00:11:55,300 --> 00:11:57,300
But I thing

301
00:11:57,300 --> 00:11:59,300
is, a lot of

302
00:11:59,300 --> 00:12:01,300
things missing from this.

303
00:12:01,300 --> 00:12:03,300
For example,

304
00:12:03,300 --> 00:12:05,100
we can run lintian,

305
00:12:05,100 --> 00:12:05,300
on the changes file
we can run lintian,

306
00:12:05,300 --> 00:12:07,300
on the changes file

307
00:12:07,300 --> 00:12:09,300
and it will tell us all kinds of things.

308
00:12:11,300 --> 00:12:13,300
A lot of bad, bad

309
00:12:13,300 --> 00:12:15,300
things about the package.

310
00:12:19,300 --> 00:12:21,300
Ok,

311
00:12:21,300 --> 00:12:23,300
let's see,

312
00:12:23,300 --> 00:12:25,300
we are missing the maintainer name, which I'm not going

313
00:12:25,300 --> 00:12:27,300
to fix right now.

314
00:12:27,300 --> 00:12:29,300
I'm not going to fix the

315
00:12:29,300 --> 00:12:31,300
changelog either, because I

316
00:12:31,300 --> 00:12:33,300
know better.

317
00:12:33,300 --> 00:12:35,300
It's missing a copyright file,

318
00:12:35,300 --> 00:12:37,300
which I'm not going to add

319
00:12:37,300 --> 00:12:39,300
either, because writing a

320
00:12:39,300 --> 00:12:41,300
copyright file could take an

321
00:12:41,300 --> 00:12:43,300
entire session of its own.

322
00:12:45,300 --> 00:12:47,300
I can add the standards version

323
00:12:47,300 --> 00:12:49,300
field.

324
00:12:53,300 --> 00:12:55,300
Which is as easy,

325
00:12:57,300 --> 00:12:59,300
as this, the standards

326
00:12:59,300 --> 00:13:01,300
version field,

327
00:13:03,300 --> 00:13:05,300
signals which version

328
00:13:05,300 --> 00:13:07,300
of policy this package was

329
00:13:07,300 --> 00:13:09,300
made to conform to.

330
00:13:11,300 --> 00:13:13,300
What is worse, is that

331
00:13:13,300 --> 00:13:15,300
we are missing dependencies.

332
00:13:15,300 --> 00:13:17,300
If we look into the package

333
00:13:19,300 --> 00:13:21,300
debian package.

334
00:13:23,300 --> 00:13:25,300
We will see that there is no depends

335
00:13:25,300 --> 00:13:27,300
line, if we try to install this

336
00:13:27,300 --> 00:13:29,300
It may work

337
00:13:29,300 --> 00:13:31,300
and on my computer it will because

338
00:13:31,300 --> 00:13:33,300
I already have all the dependancies installed.

339
00:13:35,300 --> 00:13:37,300
But since it's a compiled

340
00:13:37,300 --> 00:13:39,300
thing, it will at least

341
00:13:39,300 --> 00:13:41,300
need libc,

342
00:13:41,300 --> 00:13:43,300
and probably a few other

343
00:13:43,300 --> 00:13:45,300
things as well.

344
00:13:45,300 --> 00:13:47,300
So, we do

345
00:13:47,300 --> 00:13:49,300
another kind of magic.

346
00:13:49,300 --> 00:13:51,300
And add

347
00:13:51,300 --> 00:13:53,300
the depends line to

348
00:13:53,300 --> 00:13:55,300
the binary section.

349
00:13:55,300 --> 00:13:57,300
Now,

350
00:13:59,300 --> 00:14:01,300
is this line of magic,

351
00:14:01,300 --> 00:14:03,300
which looks like shell

352
00:14:03,300 --> 00:14:05,300
variable except,

353
00:14:05,300 --> 00:14:07,300
they are not.

354
00:14:07,300 --> 00:14:09,300
The way it works,

355
00:14:09,300 --> 00:14:11,300
is when debhelper

356
00:14:11,300 --> 00:14:13,300
runs, it will

357
00:14:15,300 --> 00:14:17,300
find all the

358
00:14:17,300 --> 00:14:19,300
packages that your binary

359
00:14:19,300 --> 00:14:21,300
is dependant on. At least if they are

360
00:14:21,300 --> 00:14:23,300
in 'C' and

361
00:14:23,300 --> 00:14:25,300
fill

362
00:14:25,300 --> 00:14:27,300
this variable out,

363
00:14:27,300 --> 00:14:29,300
with the results.

364
00:14:29,300 --> 00:14:31,300
It something

365
00:14:31,300 --> 00:14:33,300
like 'ldd'

366
00:14:33,300 --> 00:14:35,300
improved.

367
00:14:41,300 --> 00:14:43,300
Here we see,

368
00:14:43,300 --> 00:14:45,300
the output of 'ldd'

369
00:14:45,300 --> 00:14:47,300
as you can see, this

370
00:14:47,300 --> 00:14:49,300
thing depends on quite a lot of

371
00:14:49,300 --> 00:14:51,300
things.

372
00:14:53,300 --> 00:14:55,300
Ranging from freetype

373
00:14:55,300 --> 00:14:57,300
to libX11

374
00:14:57,300 --> 00:14:59,300
to

375
00:14:59,300 --> 00:15:01,300
otherthings.

376
00:15:05,300 --> 00:15:07,300
Yes?

377
00:15:13,300 --> 00:15:15,300
One moment.

378
00:15:25,300 --> 00:15:27,300
[Question] Wouldn't you have to go through 'configure-ac',

379
00:15:27,300 --> 00:15:29,300
to figure all this stuff?

380
00:15:29,300 --> 00:15:31,300
[Gergely] We can,

381
00:15:31,300 --> 00:15:33,300
and we will just not

382
00:15:33,300 --> 00:15:35,300
right now.

383
00:15:35,300 --> 00:15:37,300
We need

384
00:15:37,300 --> 00:15:39,300
to figure out the

385
00:15:39,300 --> 00:15:41,300
dependices of the binary,

386
00:15:41,300 --> 00:15:43,300
if you go through,

387
00:15:43,300 --> 00:15:45,300
'configureare-ac' you can figure

388
00:15:45,300 --> 00:15:47,300
out the build dependices.

389
00:15:47,300 --> 00:15:49,300
Which will be useful to,

390
00:15:49,300 --> 00:15:51,300
and I'll get to that

391
00:15:51,300 --> 00:15:53,300
in about 5 minutes.

392
00:15:59,300 --> 00:16:01,300
To figure out the,

393
00:16:01,300 --> 00:16:03,300
runtime dependicies you can,

394
00:16:05,300 --> 00:16:07,300
use this 'sh.libs'

395
00:16:07,300 --> 00:16:09,300
depends line.

396
00:16:09,300 --> 00:16:11,300
It will be figured out

397
00:16:11,300 --> 00:16:13,300
automatically most of the time.

398
00:16:13,300 --> 00:16:15,300
To figure out,

399
00:16:15,300 --> 00:16:17,300
the build dependicies

400
00:16:17,300 --> 00:16:19,300
you have to do that manually.

401
00:16:21,300 --> 00:16:23,300
And as I said we will get

402
00:16:23,300 --> 00:16:25,300
to that in a moment.

403
00:16:27,300 --> 00:16:29,300
I'm not going to build the package,

404
00:16:29,300 --> 00:16:31,300
again because that takes a long time.

405
00:16:31,300 --> 00:16:33,300
I will show you

406
00:16:33,300 --> 00:16:35,300
another thing, a very

407
00:16:35,300 --> 00:16:37,300
useful tool callled 'sbuild'.

408
00:16:39,300 --> 00:16:41,300
Which works

409
00:16:41,300 --> 00:16:43,300
by setting up a clean

410
00:16:43,300 --> 00:16:45,300
environment to build your package in.

411
00:16:55,300 --> 00:16:57,300
The last time I ran

412
00:16:57,300 --> 00:16:59,300
'dpkg-buildpackage'

413
00:16:59,300 --> 00:17:01,300
it also built a source package

414
00:17:01,300 --> 00:17:03,300
I believe or if not?

415
00:17:03,300 --> 00:17:05,300
Yes, it did.

416
00:17:09,300 --> 00:17:11,300
'sbuild' works after

417
00:17:11,300 --> 00:17:13,300
setting up which is easy and

418
00:17:13,300 --> 00:17:15,300
and well documented in it's

419
00:17:15,300 --> 00:17:17,300
man page and other

420
00:17:17,300 --> 00:17:19,300
kinds of documentation.

421
00:17:19,300 --> 00:17:21,300
It sets up a clean,

422
00:17:21,300 --> 00:17:23,300
environment with only

423
00:17:23,300 --> 00:17:25,300
'build-essential' installed.

424
00:17:25,300 --> 00:17:27,300
You can give this tool,

425
00:17:27,300 --> 00:17:29,300
debian source

426
00:17:29,300 --> 00:17:31,300
control file. It will grab

427
00:17:31,300 --> 00:17:33,300
all the build dependicies, install

428
00:17:33,300 --> 00:17:35,300
it in the

429
00:17:35,300 --> 00:17:37,300
'chroot'

430
00:17:37,300 --> 00:17:39,300
amd try to build the package. It's very good

431
00:17:39,300 --> 00:17:41,300
at figuring out your build dependicies

432
00:17:41,300 --> 00:17:43,300
are and weather

433
00:17:43,300 --> 00:17:45,300
your package will build on

434
00:17:45,300 --> 00:17:47,300
the autobuilders or

435
00:17:47,300 --> 00:17:49,300
if it will not.

436
00:17:51,300 --> 00:17:53,300
This takes quite a long

437
00:17:53,300 --> 00:17:55,300
time because it will have to

438
00:17:55,300 --> 00:17:57,300
install the things.

439
00:17:57,300 --> 00:17:59,300
Except it won't because

440
00:17:59,300 --> 00:18:01,300
we don't have any build dependicies

441
00:18:01,300 --> 00:18:03,300
right now.

442
00:18:07,300 --> 00:18:09,300
Oh, we do

443
00:18:09,300 --> 00:18:11,300
because

444
00:18:11,300 --> 00:18:13,300
never mind.

445
00:18:13,300 --> 00:18:15,300
I'll just stop this.

446
00:18:19,300 --> 00:18:21,300
I forgot that

447
00:18:21,300 --> 00:18:23,300
I built the source

448
00:18:23,300 --> 00:18:25,300
earlier.

449
00:18:31,300 --> 00:18:33,300
Maybe this time?

450
00:18:41,300 --> 00:18:43,300
One momement,

451
00:18:43,300 --> 00:18:45,300
I'll fix this in a moment.

452
00:19:13,300 --> 00:19:15,300
Ok, lets see.

453
00:19:15,300 --> 00:19:17,300
We should have

454
00:19:17,300 --> 00:19:19,300
no build dependicies now.

455
00:19:19,300 --> 00:19:21,300
Whats the problem

456
00:19:21,300 --> 00:19:23,300
now?

457
00:19:51,300 --> 00:19:53,300
Ok, while I

458
00:19:53,300 --> 00:19:55,300
fix my environment,

459
00:19:55,300 --> 00:19:57,300
lets skip

460
00:19:57,300 --> 00:19:59,300
the next step.

461
00:19:59,300 --> 00:20:01,300
If I had compiled this thing without

462
00:20:01,300 --> 00:20:03,300
out build dependicies, it would fail

463
00:20:03,300 --> 00:20:05,300
in a clean environment.

464
00:20:07,300 --> 00:20:09,300
What we will do next is,

465
00:20:09,300 --> 00:20:11,300
go through 'configure-ac' and figure out

466
00:20:11,300 --> 00:20:13,300
what this thing needs.

467
00:20:21,300 --> 00:20:23,300
Well, lets see.

468
00:20:23,300 --> 00:20:25,300
It needs,

469
00:20:25,300 --> 00:20:27,300
'pkg-config',

470
00:20:27,300 --> 00:20:29,300
because that is what provides

471
00:20:29,300 --> 00:20:31,300
this macro.

472
00:20:31,300 --> 00:20:33,300
It will need,

473
00:20:35,300 --> 00:20:37,300
I'm not sure how to pronounce this.

474
00:20:37,300 --> 00:20:39,300
errr, lib-ca-ca somthing.....

475
00:20:39,300 --> 00:20:41,300
It's like aalib

476
00:20:41,300 --> 00:20:43,300
but with colours. It also

477
00:20:43,300 --> 00:20:45,300
needs,

478
00:20:45,300 --> 00:20:47,300
'imlib2'.

479
00:20:47,300 --> 00:20:49,300
Lets add those

480
00:20:49,300 --> 00:20:51,300
to the build dependency.

481
00:20:55,300 --> 00:20:57,300
And, it also needs,

482
00:20:57,300 --> 00:20:59,300
debhelper because we are using that.

483
00:21:01,300 --> 00:21:03,300
Since, we are using compat level 9

484
00:21:03,300 --> 00:21:05,300
we need 'debhelper'

485
00:21:05,300 --> 00:21:07,300
version 9 or later.

486
00:21:07,300 --> 00:21:09,300
We need,

487
00:21:09,300 --> 00:21:11,300
this

488
00:21:17,300 --> 00:21:19,300
and this should

489
00:21:19,300 --> 00:21:21,300
do.

490
00:21:23,300 --> 00:21:25,300
Rebuild the source package again and

491
00:21:25,300 --> 00:21:27,300
I forgot to tell it, to not sign the package.

492
00:21:29,300 --> 00:21:31,300
There we go.

493
00:21:37,300 --> 00:21:39,300
Lets see how it worked.

494
00:21:43,300 --> 00:21:45,300
Right,

495
00:21:45,300 --> 00:21:47,300
now it figured out

496
00:21:47,300 --> 00:21:49,300
that it needs

497
00:21:49,300 --> 00:21:51,300
quite a few pacakges.

498
00:21:57,300 --> 00:21:59,300
It can also download

499
00:22:01,300 --> 00:22:03,300
the build dependicies from the internet.

500
00:22:03,300 --> 00:22:05,300
I have them downloaded already,

501
00:22:05,300 --> 00:22:07,300
which is why it didn't do that.

502
00:22:07,300 --> 00:22:09,300
Then it,

503
00:22:09,300 --> 00:22:11,300
installs all of them and

504
00:22:11,300 --> 00:22:13,300
will try to compile the package

505
00:22:13,300 --> 00:22:15,300
and make a binary out of it.

506
00:22:15,300 --> 00:22:17,300
If it all succeeds, it will

507
00:22:17,300 --> 00:22:19,300
copy the result

508
00:22:19,300 --> 00:22:21,300
into the same directory,

509
00:22:21,300 --> 00:22:23,300
which we ran the tool from.

510
00:22:25,300 --> 00:22:27,300
If it doesn't work,

511
00:22:27,300 --> 00:22:29,300
then it will

512
00:22:29,300 --> 00:22:31,300
leave

513
00:22:31,300 --> 00:22:33,300
the logfile of the whole

514
00:22:33,300 --> 00:22:35,300
build in the same directory

515
00:22:35,300 --> 00:22:37,300
which we ran it from.

516
00:22:37,300 --> 00:22:39,300
Sadly, it takes a little while

517
00:22:39,300 --> 00:22:41,300
on my laptop because

518
00:22:41,300 --> 00:22:43,300
it is kind of old and

519
00:22:43,300 --> 00:22:45,300
slow, but we are all ready at the

520
00:22:45,300 --> 00:22:47,300
setting up stage.

521
00:22:49,300 --> 00:22:51,300
Meanwhile,

522
00:22:51,300 --> 00:22:53,300
do you have any

523
00:22:53,300 --> 00:22:55,300
questions, so far?

524
00:23:05,300 --> 00:23:07,300
[Question] The setup we see running

525
00:23:07,300 --> 00:23:09,300
thats setting it up in a sandbox

526
00:23:09,300 --> 00:23:11,300
or something. [Gergely] Yes.

527
00:23:11,300 --> 00:23:13,300
'sbuild',

528
00:23:13,300 --> 00:23:15,300
is a tool

529
00:23:15,300 --> 00:23:17,300
with which you can setup a

530
00:23:17,300 --> 00:23:19,300
'chroot'.

531
00:23:21,300 --> 00:23:23,300
A clean one,

532
00:23:23,300 --> 00:23:25,300
and it will

533
00:23:25,300 --> 00:23:27,300
do all the magic in there.

534
00:23:27,300 --> 00:23:29,300
It's also,

535
00:23:29,300 --> 00:23:31,300
useful if you are running,

536
00:23:31,300 --> 00:23:33,300
say, 'stable' or

537
00:23:33,300 --> 00:23:35,300
'testing' but want to build for a

538
00:23:35,300 --> 00:23:37,300
stable, because

539
00:23:37,300 --> 00:23:39,300
everything that goes into debian

540
00:23:39,300 --> 00:23:41,300
must be built on 'unstable'.

541
00:23:45,300 --> 00:23:47,300
[Question] Do you have any recommendations

542
00:23:47,300 --> 00:23:49,300
regarding the build environment? For, example using

543
00:23:49,300 --> 00:23:51,300
'pbuilder' over 'cowbuilder',

544
00:23:51,300 --> 00:23:53,300
or is it just a personal preference?

545
00:23:53,300 --> 00:23:55,300
[Gergely] It's just personal

546
00:23:55,300 --> 00:23:57,300
preference, I have used 'sbuild'

547
00:23:57,300 --> 00:23:59,300
ever since it was

548
00:23:59,300 --> 00:24:01,300
packaged. So, thats what

549
00:24:03,300 --> 00:24:05,300
I'm familiar with,

550
00:24:05,300 --> 00:24:07,300
but other

551
00:24:07,300 --> 00:24:09,300
other people are using 'pbuilder' or

552
00:24:09,300 --> 00:24:11,300
'cowbuilder' and

553
00:24:11,300 --> 00:24:13,300
I think there are maybe one or two

554
00:24:13,300 --> 00:24:15,300
more similiar tools.

555
00:24:15,300 --> 00:24:17,300
They all work, they all

556
00:24:17,300 --> 00:24:19,300
have different properties.

557
00:24:19,300 --> 00:24:21,300
You can choose which ever

558
00:24:21,300 --> 00:24:23,300
you like.

559
00:24:25,300 --> 00:24:27,300
It builds and now it's

560
00:24:27,300 --> 00:24:29,300
removing all the packages

561
00:24:29,300 --> 00:24:31,300
it installed before.

562
00:24:33,300 --> 00:24:35,300
We have a successful build but,

563
00:24:35,300 --> 00:24:37,300
'lintian' failed.

564
00:24:37,300 --> 00:24:39,300
Well, thats

565
00:24:39,300 --> 00:24:41,300
kind of expected because there is a lot of

566
00:24:41,300 --> 00:24:43,300
things missing from this package.

567
00:24:47,300 --> 00:24:49,300
oh, I'm stupid

568
00:24:49,300 --> 00:24:51,300
nevermind.

569
00:24:51,300 --> 00:24:53,300
So,

570
00:24:53,300 --> 00:24:55,300
we have a debian package.

571
00:24:55,300 --> 00:24:57,300
Right here, which we built.

572
00:25:01,300 --> 00:25:03,300
Lets try installing it.

573
00:25:11,300 --> 00:25:13,300
Ooooh,

574
00:25:13,300 --> 00:25:15,300
there are things in it.

575
00:25:17,300 --> 00:25:19,300
and if I

576
00:25:19,300 --> 00:25:21,300
run it.

577
00:25:21,300 --> 00:25:23,300
It works! It

578
00:25:23,300 --> 00:25:25,300
looks a bit silly [clapping] but it works

579
00:25:25,300 --> 00:25:27,300
[clapping]

580
00:25:29,300 --> 00:25:31,300
I just rememebered that I had this terminal

581
00:25:31,300 --> 00:25:33,300
window open, because I wanted to run it

582
00:25:33,300 --> 00:25:35,300
here, because it has

583
00:25:35,300 --> 00:25:37,300
smaller fonts and it

584
00:25:37,300 --> 00:25:39,300
looks much nicer this way.

585
00:25:45,300 --> 00:25:47,300
That was what I had,

586
00:25:47,300 --> 00:25:49,300
prepared.

587
00:25:53,300 --> 00:25:55,300
Oh, wait.

588
00:26:05,300 --> 00:26:07,300
So, if we run

589
00:26:07,300 --> 00:26:09,300
'lintian' on this thing, it

590
00:26:11,300 --> 00:26:13,300
tells us a few

591
00:26:13,300 --> 00:26:15,300
errors

592
00:26:15,300 --> 00:26:17,300
and warnings.

593
00:26:17,300 --> 00:26:19,300
Like, this binary

594
00:26:19,300 --> 00:26:21,300
doesn't have a man page,

595
00:26:21,300 --> 00:26:23,300
it's in section games but

596
00:26:23,300 --> 00:26:25,300
contains no games because games

597
00:26:25,300 --> 00:26:27,300
need to go into

598
00:26:27,300 --> 00:26:29,300
'/usr/games' not in

599
00:26:29,300 --> 00:26:31,300
'/usr/bin'.

600
00:26:31,300 --> 00:26:33,300
We can actually fix that easily.

601
00:26:33,300 --> 00:26:35,300
That will show,

602
00:26:35,300 --> 00:26:37,300
how to.

603
00:26:41,300 --> 00:26:43,300
We have

604
00:26:43,300 --> 00:26:45,300
a package which should

605
00:26:45,300 --> 00:26:47,300
be installed

606
00:26:47,300 --> 00:26:49,300
into

607
00:26:49,300 --> 00:26:51,300
'/usr/games' instead of

608
00:26:51,300 --> 00:26:53,300
'/usr/bin'.

609
00:26:53,300 --> 00:26:55,300
Since we built only one

610
00:26:55,300 --> 00:26:57,300
binary,

611
00:26:57,300 --> 00:26:59,300
we can tell configure

612
00:26:59,300 --> 00:27:01,300
that

613
00:27:01,300 --> 00:27:03,300
binaries, should go into '/usr/games'

614
00:27:03,300 --> 00:27:05,300
not '/usr/bin'.

615
00:27:07,300 --> 00:27:09,300
With debhelper,

616
00:27:09,300 --> 00:27:11,300
using this short form we

617
00:27:11,300 --> 00:27:13,300
can do that by overriding,

618
00:27:13,300 --> 00:27:15,300
the configure step.

619
00:27:19,300 --> 00:27:21,300
That works

620
00:27:21,300 --> 00:27:23,300
by adding a new target

621
00:27:23,300 --> 00:27:25,300
to the

622
00:27:25,300 --> 00:27:27,300
'debian/rules' makefile.

623
00:27:27,300 --> 00:27:29,300
We simply call

624
00:27:29,300 --> 00:27:31,300
the original

625
00:27:31,300 --> 00:27:33,300
tool and

626
00:27:33,300 --> 00:27:35,300
pass it

627
00:27:35,300 --> 00:27:37,300
'--prefix=/usr/games' argument.

628
00:27:41,300 --> 00:27:43,300
This will do all the magic

629
00:27:43,300 --> 00:27:45,300
'dh_auto_configure'

630
00:27:45,300 --> 00:27:47,300
does.

631
00:27:47,300 --> 00:27:49,300
Which includes, adding

632
00:27:51,300 --> 00:27:53,300
hardening flags,

633
00:27:53,300 --> 00:27:55,300
adding

634
00:27:55,300 --> 00:27:57,300
all kinds of other

635
00:27:57,300 --> 00:27:59,300
options.

636
00:27:59,300 --> 00:28:01,300
We will also tell it,

637
00:28:01,300 --> 00:28:03,300
that we want to change

638
00:28:03,300 --> 00:28:05,300
the prefix.

639
00:28:09,300 --> 00:28:11,300
Another, thing

640
00:28:11,300 --> 00:28:13,300
about the 'dch'

641
00:28:13,300 --> 00:28:15,300
tool is,

642
00:28:15,300 --> 00:28:17,300
it can not only create

643
00:28:17,300 --> 00:28:19,300
changelog files it can

644
00:28:19,300 --> 00:28:21,300
add new

645
00:28:21,300 --> 00:28:23,300
entries into it.

646
00:28:23,300 --> 00:28:25,300
By using the

647
00:28:25,300 --> 00:28:27,300
'-i'

648
00:28:27,300 --> 00:28:29,300
option.

649
00:28:45,300 --> 00:28:47,300
Now we can build

650
00:28:47,300 --> 00:28:49,300
the package again.

651
00:28:57,300 --> 00:28:59,300
I stopped the build,

652
00:29:07,300 --> 00:29:09,300
Anyway, if it wasn't

653
00:29:09,300 --> 00:29:11,300
scrolling this fast, you could see the

654
00:29:11,300 --> 00:29:13,300
argument we

655
00:29:13,300 --> 00:29:15,300
added

656
00:29:15,300 --> 00:29:17,300
was actually passed.

657
00:29:21,300 --> 00:29:23,300
Anyway, if we

658
00:29:23,300 --> 00:29:25,300
look at the,

659
00:29:25,300 --> 00:29:27,300
Ok, not going to do that

660
00:29:27,300 --> 00:29:29,300
in midnight commander.

661
00:29:37,300 --> 00:29:39,300
There is another command called,

662
00:29:39,300 --> 00:29:41,300
'dpkg-deb'

663
00:29:41,300 --> 00:29:43,300
With which you can inspect,

664
00:29:43,300 --> 00:29:45,300
extract and

665
00:29:45,300 --> 00:29:47,300
reassemble

666
00:29:47,300 --> 00:29:49,300
debian packages.

667
00:29:49,300 --> 00:29:51,300
Right now we will use the

668
00:29:51,300 --> 00:29:53,300
'-c' option

669
00:29:53,300 --> 00:29:55,300
which means contents.

670
00:29:57,300 --> 00:29:59,300
To list what

671
00:29:59,300 --> 00:30:01,300
is inside it.

672
00:30:03,300 --> 00:30:05,300
Well,

673
00:30:05,300 --> 00:30:07,300
this worked a little

674
00:30:07,300 --> 00:30:09,300
except we didn't want to

675
00:30:09,300 --> 00:30:11,300
pass prefix because

676
00:30:11,300 --> 00:30:13,300
everything under prefix

677
00:30:13,300 --> 00:30:15,300
'/usr/games/' including

678
00:30:15,300 --> 00:30:17,300
the documentation! We only want

679
00:30:17,300 --> 00:30:19,300
to place the binaries

680
00:30:19,300 --> 00:30:21,300
there.

681
00:30:25,300 --> 00:30:27,300
So, it's not '--prefix=/usr/games'

682
00:30:27,300 --> 00:30:29,300
but

683
00:30:29,300 --> 00:30:31,300
'--bindir=/usr/games'.

684
00:30:31,300 --> 00:30:33,300
I think,

685
00:30:37,300 --> 00:30:39,300
yup.

686
00:30:45,300 --> 00:30:47,300
Ok, here we go

687
00:30:47,300 --> 00:30:49,300
again.

688
00:30:51,300 --> 00:30:53,300
This time instead of

689
00:30:53,300 --> 00:30:55,300
looking at the final

690
00:30:55,300 --> 00:30:57,300
package, we will have a look at

691
00:30:59,300 --> 00:31:01,300
the debian directory.

692
00:31:01,300 --> 00:31:03,300
As you can see there are a couple of new

693
00:31:03,300 --> 00:31:05,300
files there, like

694
00:31:07,300 --> 00:31:09,300
'debian/files' or

695
00:31:09,300 --> 00:31:11,300
the

696
00:31:11,300 --> 00:31:13,300
'cake-is-a-lie.debhelper.log'

697
00:31:13,300 --> 00:31:15,300
which is a log of

698
00:31:15,300 --> 00:31:17,300
the 'debhelper' commands

699
00:31:17,300 --> 00:31:19,300
which ran,

700
00:31:19,300 --> 00:31:21,300
or the 'cake-is-a-lie.substvars' file.

701
00:31:21,300 --> 00:31:23,300
There is also a directory

702
00:31:25,300 --> 00:31:27,300
called 'cake-is-a-lie'.

703
00:31:27,300 --> 00:31:29,300
In this

704
00:31:29,300 --> 00:31:31,300
directory are

705
00:31:33,300 --> 00:31:35,300
all the

706
00:31:35,300 --> 00:31:37,300
things

707
00:31:37,300 --> 00:31:39,300
installed which our package will

708
00:31:39,300 --> 00:31:41,300
include.

709
00:31:43,300 --> 00:31:45,300
If we go through that,

710
00:31:45,300 --> 00:31:47,300
will we see that under '/usr/games'

711
00:31:47,300 --> 00:31:49,300
is our program,

712
00:31:49,300 --> 00:31:51,300
there is documentation,

713
00:31:51,300 --> 00:31:53,300
and there are the pictures also,

714
00:31:53,300 --> 00:31:55,300
and there is a DEBIAN

715
00:31:55,300 --> 00:31:57,300
directory.

716
00:31:57,300 --> 00:31:59,300
In all captial letters,

717
00:31:59,300 --> 00:32:01,300
that directory is

718
00:32:01,300 --> 00:32:03,300
special

719
00:32:03,300 --> 00:32:05,300
it contains all the

720
00:32:07,300 --> 00:32:09,300
metadata

721
00:32:09,300 --> 00:32:11,300
which also goes into the

722
00:32:11,300 --> 00:32:13,300
final debian

723
00:32:13,300 --> 00:32:15,300
package. This is all

724
00:32:15,300 --> 00:32:17,300
created by 'debhelper'.

725
00:32:21,300 --> 00:32:23,300
If you want to quickly look at

726
00:32:23,300 --> 00:32:25,300
what goes into your package

727
00:32:25,300 --> 00:32:27,300
you can look

728
00:32:27,300 --> 00:32:29,300
under the debian directory,

729
00:32:29,300 --> 00:32:31,300
and find the

730
00:32:31,300 --> 00:32:33,300
directory with the same name as

731
00:32:33,300 --> 00:32:35,300
your binary package and see what is

732
00:32:35,300 --> 00:32:37,300
there. What is in there will go

733
00:32:37,300 --> 00:32:39,300
in your package.

734
00:32:43,300 --> 00:32:45,300
If we run 'lintian'

735
00:32:45,300 --> 00:32:47,300
on this again.

736
00:32:59,300 --> 00:33:01,300
Well, it complains about a lot less

737
00:33:01,300 --> 00:33:03,300
things.

738
00:33:05,300 --> 00:33:07,300
Our program is finally at the correct

739
00:33:07,300 --> 00:33:09,300
location.

740
00:33:09,300 --> 00:33:11,300
So, what I would advise,

741
00:33:11,300 --> 00:33:13,300
if you start

742
00:33:13,300 --> 00:33:15,300
to package something from scratch

743
00:33:15,300 --> 00:33:17,300
start with a very simple rules

744
00:33:17,300 --> 00:33:19,300
file that pretty much

745
00:33:19,300 --> 00:33:21,300
leaves everything to

746
00:33:21,300 --> 00:33:23,300
'debhelper' and

747
00:33:23,300 --> 00:33:25,300
after each interation

748
00:33:25,300 --> 00:33:27,300
run 'lintian' and try to

749
00:33:27,300 --> 00:33:29,300
correct the problems.

750
00:33:29,300 --> 00:33:31,300
If you need

751
00:33:31,300 --> 00:33:33,300
to change something,

752
00:33:33,300 --> 00:33:35,300
which 'debhelper' can't figure out,

753
00:33:35,300 --> 00:33:37,300
or something it

754
00:33:37,300 --> 00:33:39,300
figures out but wrongly.

755
00:33:39,300 --> 00:33:41,300
Just, add an override,

756
00:33:41,300 --> 00:33:43,300
you don't have to know

757
00:33:43,300 --> 00:33:45,300
all the magic that

758
00:33:45,300 --> 00:33:47,300
is behind 'debhelper'

759
00:33:47,300 --> 00:33:49,300
just a few tiny pieces.

760
00:33:49,300 --> 00:33:51,300
Which you need,

761
00:33:51,300 --> 00:33:53,300
for your package.

762
00:33:57,300 --> 00:33:59,300
That's pretty much my recommendation.

763
00:33:59,300 --> 00:34:01,300
I have found that,

764
00:34:01,300 --> 00:34:03,300
it works fairly well.

765
00:34:03,300 --> 00:34:05,300
Most of my packages are

766
00:34:05,300 --> 00:34:07,300
built this way.

767
00:34:11,300 --> 00:34:13,300
Any questions ?

768
00:34:17,300 --> 00:34:19,300
Here in the front.

769
00:34:25,300 --> 00:34:27,300
[Question] Where does

770
00:34:27,300 --> 00:34:29,300
'make' come into play?

771
00:34:33,300 --> 00:34:35,300
[Gergely] I am not quite sure why 'make' was chosen,

772
00:34:35,300 --> 00:34:37,300
originally for Debian rules.

773
00:34:39,300 --> 00:34:41,300
Some 10 years

774
00:34:41,300 --> 00:34:43,300
ago you only needed a file,

775
00:34:43,300 --> 00:34:45,300
it didn't have

776
00:34:45,300 --> 00:34:47,300
to be a makefile although it was

777
00:34:47,300 --> 00:34:49,300
recommended

778
00:34:49,300 --> 00:34:51,300
but then the policy was changed

779
00:34:53,300 --> 00:34:55,300
to require it being a

780
00:34:55,300 --> 00:34:57,300
make file and I'm not quite sure why.

781
00:34:57,300 --> 00:34:59,300
It's a

782
00:34:59,300 --> 00:35:01,300
mostly likely

783
00:35:01,300 --> 00:35:03,300
habit,

784
00:35:03,300 --> 00:35:05,300
or historical reasons.

785
00:35:11,300 --> 00:35:13,300
Does that answer your question?

786
00:35:19,300 --> 00:35:21,300
[Questioner] Maybe my

787
00:35:21,300 --> 00:35:23,300
question was wrong,

788
00:35:23,300 --> 00:35:25,300
What is the difference between 'dpkg-buildpackage'

789
00:35:25,300 --> 00:35:27,300
and make ?

790
00:35:27,300 --> 00:35:29,300
[Gergely] Oh. Well the main

791
00:35:29,300 --> 00:35:31,300
difference is

792
00:35:31,300 --> 00:35:33,300
that 'dpkg-buildpackage'

793
00:35:33,300 --> 00:35:35,300
does a few other things.

794
00:35:35,300 --> 00:35:37,300
Like,

795
00:35:37,300 --> 00:35:39,300
generating a changes file for you,

796
00:35:39,300 --> 00:35:41,300
it can also build

797
00:35:41,300 --> 00:35:43,300
source package

798
00:35:43,300 --> 00:35:45,300
and

799
00:35:45,300 --> 00:35:47,300
it can do a couple

800
00:35:47,300 --> 00:35:49,300
of other things but the main

801
00:35:49,300 --> 00:35:51,300
is generating

802
00:35:51,300 --> 00:35:53,300
the changes file,

803
00:35:53,300 --> 00:35:55,300
the changes file lists,

804
00:35:55,300 --> 00:35:57,300
well we can just

805
00:35:57,300 --> 00:35:59,300
have a look at it.

806
00:36:01,300 --> 00:36:03,300
No.

807
00:36:11,300 --> 00:36:13,300
The changes

808
00:36:13,300 --> 00:36:15,300
file is what you,

809
00:36:15,300 --> 00:36:17,300
actually upload

810
00:36:17,300 --> 00:36:19,300
to the Debian servers,

811
00:36:19,300 --> 00:36:21,300
along with the rest.

812
00:36:21,300 --> 00:36:23,300
It lists all the

813
00:36:23,300 --> 00:36:25,300
files that belong to this

814
00:36:25,300 --> 00:36:27,300
version of the package

815
00:36:27,300 --> 00:36:29,300
including the source,

816
00:36:29,300 --> 00:36:31,300
if there is any.

817
00:36:33,300 --> 00:36:35,300
This is something that 'make'

818
00:36:35,300 --> 00:36:37,300
can't do, this is

819
00:36:37,300 --> 00:36:39,300
all

820
00:36:39,300 --> 00:36:41,300
done by,

821
00:36:43,300 --> 00:36:45,300
'dpkg-buildpackage' or

822
00:36:45,300 --> 00:36:47,300
actually a tool that it calls

823
00:36:47,300 --> 00:36:49,300
for you.

824
00:36:51,300 --> 00:36:53,300
We can

825
00:36:53,300 --> 00:36:55,300
do something like Debian rules

826
00:36:55,300 --> 00:36:57,300
binary,

827
00:36:59,300 --> 00:37:01,300
if I where in the right directory,

828
00:37:01,300 --> 00:37:03,300
that is.

829
00:37:03,300 --> 00:37:05,300
Which we will do

830
00:37:05,300 --> 00:37:07,300
nothing right now because it's already built,

831
00:37:07,300 --> 00:37:09,300
but I can,

832
00:37:09,300 --> 00:37:11,300
clean and I can run binary

833
00:37:11,300 --> 00:37:13,300
and it will do all the things that

834
00:37:13,300 --> 00:37:15,300
it did before.

835
00:37:15,300 --> 00:37:17,300
'dkpg-buildpackage'

836
00:37:17,300 --> 00:37:19,300
does call this command aswell,

837
00:37:19,300 --> 00:37:21,300
the difference is that,

838
00:37:21,300 --> 00:37:23,300
now I have a deb file,

839
00:37:23,300 --> 00:37:25,300
and that is it.

840
00:37:25,300 --> 00:37:27,300
I don't have a source

841
00:37:27,300 --> 00:37:29,300
tarball, I don't have

842
00:37:29,300 --> 00:37:31,300
the debian tarball,

843
00:37:31,300 --> 00:37:33,300
I don't have the debian

844
00:37:33,300 --> 00:37:35,300
source control file, I don't have the

845
00:37:35,300 --> 00:37:37,300
changes file and I don't

846
00:37:37,300 --> 00:37:39,300
have any of the signed either.

847
00:37:39,300 --> 00:37:41,300
'dpkg-buildpackage'

848
00:37:41,300 --> 00:37:43,300
does that

849
00:37:43,300 --> 00:37:45,300
for you.

850
00:37:47,300 --> 00:37:49,300
Any other questions ?

851
00:37:49,300 --> 00:37:51,300
Another here.

852
00:37:53,300 --> 00:37:55,300
[Question] I have never

853
00:37:55,300 --> 00:37:57,300
packaged anything but I have

854
00:37:57,300 --> 00:37:59,300
some code that has,

855
00:37:59,300 --> 00:38:01,300
the Debian rules for ubuntu.

856
00:38:01,300 --> 00:38:03,300
Is there any difference ?

857
00:38:03,300 --> 00:38:05,300
[Gergely] Not much.

858
00:38:05,300 --> 00:38:07,300
[Questioner] Could it be a start to learn to package ?

859
00:38:07,300 --> 00:38:09,300
[Gergely] Yes. [Questioner] And if it's

860
00:38:09,300 --> 00:38:11,300
a python package ?

861
00:38:11,300 --> 00:38:13,300
[Gergely] Well, that's a little bit different.

862
00:38:15,300 --> 00:38:17,300
You will most

863
00:38:17,300 --> 00:38:19,300
likely

864
00:38:19,300 --> 00:38:21,300
need to adjust the

865
00:38:21,300 --> 00:38:23,300
dependicies by hand, I'm not

866
00:38:23,300 --> 00:38:25,300
quite sure

867
00:38:25,300 --> 00:38:27,300
but you can't figure out python

868
00:38:27,300 --> 00:38:29,300
dependicies automatically.

869
00:38:31,300 --> 00:38:33,300
But otherwise it's very similiar.

870
00:38:33,300 --> 00:38:35,300
I believe.

871
00:38:35,300 --> 00:38:37,300
But, if you have a debian

872
00:38:37,300 --> 00:38:39,300
rules files from ubuntu

873
00:38:39,300 --> 00:38:41,300
that is a good start.

874
00:38:41,300 --> 00:38:43,300
[Questioner] Okay, thanks.

875
00:38:53,300 --> 00:38:55,300
[Gergely] If there are no more questions then,

876
00:38:57,300 --> 00:38:59,300
I think this is it.

877
00:38:59,300 --> 00:39:01,300
I can be

878
00:39:01,300 --> 00:39:03,300
algernon@debian.org

879
00:39:03,300 --> 00:39:05,300
or on IRC,

880
00:39:07,300 --> 00:39:09,300
if you have any packaging

881
00:39:09,300 --> 00:39:11,300
questions feel free to

882
00:39:11,300 --> 00:39:13,300
turn to me and

883
00:39:13,300 --> 00:39:15,300
I will be happy to answer,

884
00:39:15,300 --> 00:39:17,300
if I can.

885
00:39:17,300 --> 00:39:19,300
If not I'll try to find

886
00:39:19,300 --> 00:39:21,300
appropriate documention.

887
00:39:23,300 --> 00:39:29,300
[Applause]
