README.md 5.19 KB
Newer Older
Lafont François's avatar
Lafont François committed
1
# Install the environment to build the package
lafont's avatar
lafont committed
2

Lafont François's avatar
Lafont François committed
3 4 5
**Warning:** you can build the package only on **Debian Jessie**.

These commands should be launched **only once**:
lafont's avatar
lafont committed
6

lafont's avatar
lafont committed
7 8
```sh
apt-get update
lafont's avatar
lafont committed
9
apt-get install -y git ca-certificates openssl make
10
git clone "https://git.backbone.education/lafont/xia-packaging"
lafont's avatar
lafont committed
11 12 13
cd xia-packaging/
./make install_env
```
lafont's avatar
lafont committed
14

Lafont François's avatar
Lafont François committed
15 16
In the following, it is assumed that these commands have
been already launched.
lafont's avatar
lafont committed
17 18


Lafont François's avatar
Lafont François committed
19
# Build the package with the current version mentioned in the `debian/changelog`
lafont's avatar
lafont committed
20

Lafont François's avatar
Lafont François committed
21
To build the package with the current version mentioned in
Lafont François's avatar
Lafont François committed
22
the `debian/changelog` file (ie in its first line), a tag
Lafont François's avatar
Lafont François committed
23 24 25
with the same version must exist in the "watch" page of the
upstream sources. In this case, you can build the package
with :
lafont's avatar
lafont committed
26

lafont's avatar
lafont committed
27
```sh
Lafont François's avatar
Lafont François committed
28
cd xia-packaging/
lafont's avatar
lafont committed
29

Lafont François's avatar
Lafont François committed
30 31 32
# For each build.
./make build
```
lafont's avatar
lafont committed
33

Lafont François's avatar
Lafont François committed
34
And the package (ie the `.deb` file) will be in the current
Lafont François's avatar
Lafont François committed
35
directory:
lafont's avatar
lafont committed
36 37

```sh
Lafont François's avatar
Lafont François committed
38
ls -lh
lafont's avatar
lafont committed
39 40 41
```


42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
# Specific case of the DANE repository

To build the package for the DANE repository, there are
particular and historical differences with the official
Debian repository (all differences are showed in the
`./hack-danerepo` script). To build the package for the DANE
repository, the only difference is to not use the command
`./make build` but use instead :

```sh
./make build4danerepo
```

That's all.


Lafont François's avatar
Lafont François committed
58
# Build the package with a version not yet mentioned in the `debian/changelog`
lafont's avatar
lafont committed
59

Lafont François's avatar
Lafont François committed
60 61
First, you have to create a new release entry in the
`debian/changelog` file :
62 63 64 65 66 67 68 69

```sh
# You must set several environment variables.
export EDITOR="vim" # take "nano" if you prefer.
export DEBEMAIL="pascal.fautrero@ac-versailles.fr"
export EMAIL="pascal.fautrero@ac-versailles.fr"
export DEBFULLNAME="Pascal Fautrero"

Lafont François's avatar
Lafont François committed
70
# Go to the `src/` directory in the git repository.
71 72 73 74 75 76 77 78 79 80
cd xia-packaging/src/

# Create a new entry in the `debian/changelog` file.
# In this example, `1.0~beta5` is the upstream version
# and `3` is the package revision for this upstream version.
# Of course each version number must increase over time.
# You MUST respect this syntax `<upstream version>-<package revision>`.
dch --newversion '1.0~beta5-3'
```

Lafont François's avatar
Lafont François committed
81 82
When your editor is opened, you can notice the `UNRELEASED`
string in the first line of the `debian/changelog` file.
83

Lafont François's avatar
Lafont François committed
84 85 86
After the command above, you can edit the file and append
explanations about this new release. When it's finished, you
must save and quit your editor. Then, run this command:
87 88 89 90 91

```sh
dch --release
```

Lafont François's avatar
Lafont François committed
92 93 94 95 96 97 98 99 100 101 102 103 104
Now, you can notice that the `UNRELEASED` string in the
first line is replaced by the `unstable` string. It's OK,
save and quit your editor. Now, the package source is ready
for a new release. You can commit and push.

After the commit and push, you can build the package:

```sh
cd ..
./make build
```


105
# Put the package in the "DANE" repository
Lafont François's avatar
Lafont François committed
106

Lafont François's avatar
Lafont François committed
107
To put the package in
108
[the "DANE" repository](http://repository.crdp.ac-versailles.fr/),
Lafont François's avatar
Lafont François committed
109
you have to be able to make a scp to the private IP of
Lafont François's avatar
Lafont François committed
110 111
`repository@repository.crdp.ac-versailles.fr` via a SSH key.
Your SSH public key must be put in the file
Lafont François's avatar
Lafont François committed
112 113 114 115 116 117 118
`/home/repository/.ssh/authorized_keys` of this server:


```sh
# To build the package.
cd xia-packaging/ && ./make build

Lafont François's avatar
Lafont François committed
119 120 121
# Of course, you have to use a VPN.
IP='<Private IP of repository.crdp.ac-versailles.fr>'

Lafont François's avatar
Lafont François committed
122 123
cat > /tmp/.dput.cf <<EOF
[xia]
Lafont François's avatar
Lafont François committed
124
fqdn = $IP
Lafont François's avatar
Lafont François committed
125 126 127 128 129 130 131 132 133 134 135
login = repository
method = scp
incoming = /var/www/debian/incoming/xia
allow_unsigned_uploads = 1

EOF

# "*" to match the version number.
dput -c /tmp/.dput.cf xia xia_*_amd64.changes
```

Lafont François's avatar
Lafont François committed
136 137 138 139
After this last command, you have to wait for 5 minutes
approximatively before the package is updated in the APT
repository.

Lafont François's avatar
Lafont François committed
140 141 142 143 144
**Remark:** you can upload the package in a different host
than the one you built the package. You just need these files:
* `xia_<version>_all.deb`
* `xia_<version>_amd64.changes`

Lafont François's avatar
Lafont François committed
145 146 147 148 149 150 151

# Put the package in the "mentors" repository

To do that, you must be a maintainer of the package (ie you
must be present in the `Maintainer` field or in the
`Uploaders` field of the `src/debian/control` file) and you
must have a valid `~/.gnupg` directory on this current host.
152

153 154 155 156 157 158 159
Furthermore, you have to build the package via the command:

```sh
# You have to sign the package during the build with your PGP key.
cd xia-packaging/ && ./make build_sign
```

lafont's avatar
lafont committed
160 161 162 163
If you want to upload the package to `mentors.debian.net`,
you can launch these commands:

```sh
Lafont François's avatar
Lafont François committed
164 165
# You have to sign the package with your GPG key.
cd xia-packaging/ && ./make build_sign
lafont's avatar
lafont committed
166 167 168 169 170 171 172 173 174 175 176 177 178

cat > /tmp/.dput.cf <<EOF
[mentors]
fqdn = mentors.debian.net
incoming = /upload
method = http
allow_unsigned_uploads = 0
progress_indicator = 2
# Allow uploads for UNRELEASED packages
allowed_distributions = .*

EOF

179
dput -c /tmp/.dput.cf mentors xia_*_amd64.changes
lafont's avatar
lafont committed
180 181
```

182

Lafont François's avatar
Lafont François committed
183 184 185 186 187 188 189 190 191 192
# Install and test the package quickly

You can install and test the package quickly on Debian
Wheezy, Debian Jessie and Ubuntu Trusty Tahr. You just need
to launch these commands as *root*:

```sh
wget -q "http://repository.crdp.ac-versailles.fr/crdp.gpg" -O - | apt-key add -
echo "deb http://repository.crdp.ac-versailles.fr/debian xia main" | tee /etc/apt/sources.list.d/xia.list
apt-get update
Lafont François's avatar
Lafont François committed
193 194

# If you just want to install Xia but not Inkscape and its Xia plugin:
Lafont François's avatar
Lafont François committed
195
apt-get install xia
Lafont François's avatar
Lafont François committed
196 197 198

# Or if you want to install Xia with Inkscape and its Xia plugin:
apt-get install --install-suggests xia
Lafont François's avatar
Lafont François committed
199 200 201 202 203
```