summaryrefslogtreecommitdiff
path: root/debian.md
blob: 272747972387a2188128de494354a511299ddc58 (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
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
# Introduction

* Why?
* How?

-----------------------------------------------------------------------------

# Why?

* install repeatedly (test environments)
* install on many hosts (scap)
* others need to install

-----------------------------------------------------------------------------

# Overview

![](debian.svg)


-----------------------------------------------------------------------------

# In commands

~~~sh
$ git archive HEAD | gzip > ../heippa_0.6.orig.tar.gz
$ dpkg-buildpackage -us -uc
$ lintian
$ ls -l ..
heippa
heippa_0.6-1_amd64.buildinfo
heippa_0.6-1_amd64.changes
heippa_0.6-1_amd64.deb
heippa_0.6-1.debian.tar.xz
heippa_0.6-1.dsc
heippa_0.6.orig.tar.gz
heippa-dbgsym_0.6-1_amd64.deb
$ 
~~~

-----------------------------------------------------------------------------

# `debian/changelog`

~~~{.text .numberLines}
heippa (0.6-1) unstable; urgency=medium

  * Trigger release build

 -- Lars W <liw@liw.fi>  Tue, 17 Jul 2018 23:11:24 +0300
~~~

Use the `dch` command to add a new entry. Formatting MUST be followed
strictly.

-----------------------------------------------------------------------------

# `debian/control`

~~~{.text .numberLines}
Source: heippa
Maintainer: Lars Wirzenius <liw@liw.fi>
Section: misc
Priority: optional
Standards-Version: 3.9.2
Build-Depends: debhelper (>= 7.3.8)

Package: heippa
Architecture: any
Depends: ${misc:Depends}, ${shlibs:Depends}
Description: short desc
 Long desc.
~~~


-----------------------------------------------------------------------------

# `debian/rules`

~~~{.makefile .numberLines}
#!/usr/bin/make -f

%:
        dh $@

override_dh_auto_install:
        dh_install
~~~

-----------------------------------------------------------------------------

# `debian/install`

~~~{.text .numberLines}
heippa usr/bin
~~~

-----------------------------------------------------------------------------

# Hands on!

* `http://git.liw.fi/heippa/`

* Debian with the following installed:
  - build-essential
  - lintian
  - fakeroot
  - anything listed as a build-dependency in debian/control
  - should probably have root

* `ssh guestX@95.217.208.205` for a suitable X (1..10)
  - declare which one you choose
  - password on chat



-----------------------------------------------------------------------------

# Scap `debian/rules`

~~~{.makefile .numberLines}
#!/usr/bin/make -f
export PYBUILD_NAME=scap
export DEB_BUILD_OPTIONS=nocheck

PKG_VERSION = $(shell dpkg-parsechangelog -S Version)

%:
        dh $@ --with python2,bash-completion \
		  --buildsystem=pybuild

override_dh_auto_configure:
        dh_auto_configure
        echo "__version__ = '$(PKG_VERSION)'" \
		  > scap/version.py
~~~

-----------------------------------------------------------------------------

# What next?

* upload to an APT repository?

  - `dput` or `dupload`
  - requires permission from the repository admins

* setting up your own APT repository?

  - reprepro or aptly, probably
  - not for the faint of heart

* make a package?

  - you _will_ run into trouble, don't be shy to ask for help
  - WMF employs several current and former Debian developers


-----------------------------------------------------------------------------

# Further reading

<https://wiki.debian.org/Packaging>

<https://www.debian.org/devel/>

-----------------------------------------------------------------------------

# Legalese

Copyright 2020 Wikimedia Foundation

This content is licensed under the Creative Commons
Attribution-ShareAlike 4.0 International ([CC BY-SA 4.0][]) licence.

[CC BY-SA 4.0]: https://creativecommons.org/licenses/by-sa/4.0/


---
title: "Debian packaging"
author: "Lars Wirzenius / Wikimedia Foundation"
date: "Version for 2020-05-18"
...