Uploading Package to PPA

After creating a Launchpad account:

Docker build, cloning the MariaDB repository and mapping it to the docker container

  1. mkdir mariadb-source

  2. cd mariadb-source

  3. vi Dockerfile

  4. Copy the following contents to Dockerfile:

# MariaDB 10.3 Ubuntu 17.10 build environment
# Published as mariadb-10-3-ubuntu-17.10-build-env
FROM ubuntu:17.10
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
apt-get install -y --no-install-recommends \
systemd \
devscripts \
build-essential \
lsb-release \
equivs \
git \
curl \
git-buildpackage \
nano \
vim \
pristine-tar

RUN curl -skO https://raw.githubusercontent.com/ottok/mariadb-10.1/ubuntu-17.10/debian/control

ENV GIT_SSL_NO_VERIFY true

RUN mk-build-deps -t 'apt-get -y -o Debug::pkgProblemResolver=yes --no-install-recommends' -i control

ENV container docker
ENV DEBIAN_FRONTEND noninteractive
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
  1. Run docker build . -t ubuntu-17.10-packaging

  2. Do git clone of the latest repository:

cd && mkdir debian-packaging && cd debian-packaging && git clone https://salsa.debian.org/mariadb-team/mariadb-10.1.git

Generate, publish and upload PGP key

  1. Generate OpenPGP key with the following command:

$ gpg --gen-key

  • select (1) RSA and RSA

  • Keysize: accept 2048

  • Valid for: accept 0

  • Type name, email and comment (comment is optional)

  • Type 0

  • Type passphrase (twice)

  • Follow instructions to help generate a random key

  • Keep the Key ID and fingerprint text, they are needed in the next step

Set generated key as default in ~/.bashrc

$ nano ~/.bashrc

[.. add this ..]

export GPGKEY=<key_id>

Restart GPG-agent and source '/.bashrc', or restart session

  1. Publish the key to the key server:

gpg --keyserver keyserver.ubuntu.com --send-keys 12345678 and substitute 12345678 with your key's id

  • If this gives timeout error, keep re-trying after a while

  1. Upload the key's fingerprint here: Upload ImportingYourPGPKey fingerprint here+editpgpkeys

  2. gpg --export [your-key-id] > ~/debian-packaging/pub.key

  3. gpg --export-secret-key [your-key-id] > ~/debian-packaging/secret.key

gpg -k

^Should show the key

  1. Open /etc/devscripts.conf

And look for this line:

DEBSIGN_MAINT

Uncomment it and add your name there

export DEBEMAIL=[your-email-id]

From inside the container

  1. docker run -v ~/debian-packaging/:/repo -it ubuntu-17.10-packaging bash

  2. apt-get install devscripts

  3. gpg --import pub.key

  4. gpg --import secret.key

  5. gpg -k

  6. cd /repo/mariadb-10.1 && git fetch && git checkout pristine-tar && git checkout ubuntu-17.10

  7. git clean -dffx && git reset --hard HEAD

  8. export DEB_BUILD_OPTIONS="parallel=10 nocheck" or export DEB_BUILD_OPTIONS="parallel=5 nocheck"

  9. Go to /repo folder (Inside docker) and delete all the files except mariadb-10.1 folder:

rm *

gbp buildpackage

For re-running the set up container

  1. To generate an ID, run:docker commit <container-id> This will generate an ID.

For restarting the same container again use this ID:docker run -v ~/debian-packaging/:/repo -it <ID> bash

  1. Last command for uploading package to PPA:

backportpackage -u <your-ppa-address> -d <ubuntu-version-to-backport-to> -S ~<a-version-suffix-name-for-this-package> <the-most-recent-dsc-file>

Example:

backportpackage -u ppa:cvicentiu/mariadb-10.0-dev2 -d bionic -S ~testtry mariadb-10.1_10.1.30-0ubuntu0.17.10.1.dsc

Run this command in the /repo folder, where the .dsc file is located It should ask for the gpg key password again

This page is licensed: CC BY-SA / Gnu FDL

Last updated

Was this helpful?