From 087036ff7eeb173ed65080f1ae562cad2067be4d Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Fri, 9 Jan 2015 10:16:36 +0100 Subject: Initial commit --- gbp.mdwn | 358 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 358 insertions(+) create mode 100644 gbp.mdwn (limited to 'gbp.mdwn') diff --git a/gbp.mdwn b/gbp.mdwn new file mode 100644 index 0000000..6e45a23 --- /dev/null +++ b/gbp.mdwn @@ -0,0 +1,358 @@ +--- +title: Debian Pakete in Git entwickeln +tags: [Debian, Git] +author: Guido Günther +rights: (c) 2014 Guido Günther, CC BY-SA +... + +# Warum + +* Versionskontrolle +* Mehrere Branches: experimental, sid, stable, backports +* Arbeit im Team + +--- + +# Warum II + +Erleichterung wiederkehrender Aufgaben + +* Bestehendes Debian Paket importieren - um mal schnell was zu ändern +* ändern, bauen, testen, ändern, bauen, testen, ändern, ... +* Neue Upstream Version importieren +* debian/changelog schreiben +* Patches hinzufügen, aktualisieren, entfernen + +--- + +# Die Werkzeuge + +* git-buildpackage +* git +* cowdancer aka cowbuilder +* pristine-tar + +
+gbp benutzt jede Menge andere Tools: +dpkg-buildpackage, debuild, cowbuilder, ... +
+ +--- + +# gbp supercommand + +* buildpackage - Bauen von Paketen +* import-orig - Upstream Tarball importieren +* import-dsc - Debian Paket importieren +* config - gbp Konfiguration anzeigen + +
+Die wichtigsten Tools +
+ +--- + +# gbp supercommand II + +* dch - Changelog generieren +* pq - Patches managen +* import-dscs - mehrere Versionen importieren + +
+Sollte man kennen, erleichtern das Leben +
+ +--- + +# gbp supercommand III + +* clone - Git Repository clonen +* pull - Git Repository aktualsieren +* create-remote-repo - Remote repository erzeugen + +* (import-srpm) +* (pq-rpm) + +
+ * Eher selten + * RPM support +
+ +--- + +# Layout + +![Gbp Branches](branches.png) + +
+* Packaging Branch, Uptream Branch, Tags +
+ +--- + +# Layout + +* Packaging Branch - pro Debian Release +* Upstream Branch +* pristine-tar Branch - ein mal pro Repository + +![pristine-tar](pristine_tar.png) + +--- + +# Vorbereitungen + +--- + +## Konfiguration + + cat < ~/.gbp.conf + [DEFAULT] + sign-tags = True + keyid = 0xB999CDB58C8DDBD2 + pristine-tar = True + + [buildpackage] + postbuild = lintian $GBP_CHANGES_FILE + cleaner = /bin/true + pbuilder = True + EOF + +--- + +## Konfiguration II + +* /etc/git-buildpackage/gbp.conf +* ~/.gbp.conf +* Im Repsitory + * .gbp.conf + * debian/gbp.conf + * .git/gbp.conf +* Anzeigen mit + + gbp config + +--- + +## Chroots erstellen + + git-pbuilder create + DIST=wheezy git-pbuilder create + DIST=wheezy-backports git-pbuilder create + +--- + +# Wie anfangen? + +## Mit bestehendem Paket + + gbp import-dsc python-dateutil_1.4.3-2.dsc + gbp import-dsc --download http://.../python-dateutil_1.4.3-2.dsc + gbp import-dsc --download python-dateutil + +--- + +# Debian Paket bauen + + gbp buildpackge [--git-ignore-new] + +--- + +## Der Ablauf + +* Repository aufräumen +* Orig Tarball erstellen (von Tag) +* Builder aufrufen +* Hooks aufrufen + +--- + +![gbp buildpackage](gbp-buildpackage.png) + +--- + +# Neue Upstream Version importieren + +--- + +## Aus Tarball + + gbp import-orig python-dateutil_1.4.3.orig.tar.gz + gbp import-orig --uscan + +--- + +# Upstream benutzt Git + +* Debian Branch erstellen + + gbp checkout -b debian/sid + +* Konfiguration anpassen + + [DEFAULT] + debian-branch = debian/sid + upstream-tag = v%(version)s + upstream-branch = master + +* ``gbp import-orig`` entfällt +* sonst alles beim alten + +--- + +## Neue Upstream Version paketieren + + gbp checkout debian/sid + git merge v1.0.0 + gbp dch --snapshot --auto + gbp buildpackage --git-pristinte-tar-commit + +--- + +# ChangeLogs + +--- + +## Commit Message + + commit a629df279795cd703b1815f3363541256ddbab6a + Author: Guido Günther + Date: Sat May 10 10:48:41 2014 +0200 + + Set safer env vars + + We can't expect to have a $HOME and we don't want to default to anything + than the test driver. + + Closes: #734975, #738383 + +## debian/changelog + * [a629df2] Set safer env vars. We can't expect to have a $HOME and we don't + want to default to anything than the test driver. + (Closes: #734975, #738383) + +--- + +## Konfiguration + + cat <> ~/.gbp.conf + + [dch] + meta = True + id-length = 7 + full = True + git-author = True + multimaint-merge = True + EOF + +--- + +## Changlogs erstellen + + gbp dch --snapshot --auto + gbp dch --release --auto + +--- + +# Patches + +--- + +## Das Konzept + +* Debian Source Format 3.0 (quilt) + * hat Patches in debian/patches + * werden während des Builds angewendet + + cat <> debian/source/local-options + unapply-patches + EOF + +* "``gbp pq import``" importiert diese in Git Branch +* "``gbp pq export``" exportiert diese wieder + +
+* Am Beispiel von libvirt vorführen +* --commit +* drop +* gbp pq apply --topic=foo +
+ +--- + +### Vorteile +* orientiert sich stark an der Arbeit mit Quilt +* patches leicht an Upstream mailbar +* Upstream Sourcen immer unmodifiziert +* Patches leicht kategorisierbar (Gbp-Pq: Topic topic) + +### Nachteile +* Upstream kann nicht einfach cherry-picken +* Bei Merges muss man PQ selber pflegen + +--- + +## Konfiguration + + cat <> ~/.gbp.conf + + [pq] + patch-numbers = False + EOF + +--- + +## Alternativen + +* Gepatchter Packaging Branch + + cat <> debian/source/local-options + auto-commit + single-debian-patch + + cat <> debian/.gitignore + patches/ + + * dpkg-source packt alle Änderungen zum Upsteam-Tarball in + ``debian/patches/debian-changes`` + +* Alternative Tools: git-dpm, TopGit, TNT + +--- + +# Bestehende Historie importieren + + gbp import-dscs --debsnap python-libvirt + gbp import-dscs path/to/*.dsc + +--- + +# Debugging + +* alle Log-Meldungen von gbp beginnen mit 'gbp:' +* --[git]-verbose +* gbp config im Repository ausführen +* gbp --help + +--- + +# Weitere Tools + +* gitpkg +* git-dpm +* dgit + +![Popcon VC build tools](popcon-vc-build-tools.png) + +--- + +# Fragen? Kommentare? + + +* Website: [https://honk.sigxcpu.org/piki/projects/git-buildpackage/]() +* Manual: [http://honk.sigxcpu.org/projects/git-buildpackage/manual-html/gbp.html]() +* Mailing Liste: [http://lists.sigxcpu.org/mailman/listinfo/git-buildpackage]() +* [https://wiki.debian.org/GitPackagingWorkflow]() +* [https://wiki.debian.org/GitPackaging]() +* [https://wiki.debian.org/git-pbuilder]() + -- cgit v1.2.3