Uploading Package to PPA
After creating a Launchpad account:
Docker build, cloning the MariaDB repository and mapping it to the docker container
mkdir mariadb-source
cd mariadb-source
vi Dockerfile
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
Run
docker build . -t ubuntu-17.10-packaging
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
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
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
Upload the key's fingerprint here: Upload ImportingYourPGPKey fingerprint here+editpgpkeys
gpg --export [your-key-id] > ~/debian-packaging/pub.key
gpg --export-secret-key [your-key-id] > ~/debian-packaging/secret.key
gpg -k
^Should show the key
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
docker run -v ~/debian-packaging/:/repo -it ubuntu-17.10-packaging bash
apt-get install devscripts
gpg --import pub.key
gpg --import secret.key
gpg -k
cd /repo/mariadb-10.1 && git fetch && git checkout pristine-tar && git checkout ubuntu-17.10
git clean -dffx && git reset --hard HEAD
export DEB_BUILD_OPTIONS="parallel=10 nocheck"
orexport DEB_BUILD_OPTIONS="parallel=5 nocheck"
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
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
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
Docker tutorial available here:edit#slide=id.p4
This page is licensed: CC BY-SA / Gnu FDL
Last updated
Was this helpful?