Inhaltsverzeichnis
Vorbereitungen
Installiert müssen folgende Tools sein zum Bauen von Debianpaketen.
# apt-get install build-essential debhelper dh-make quilt fakeroot lintian
Danach legt man sich ein Arbeitsverzeichnis an (als User) nachdem Schema Paketname/Paketname-Version.Unterversion
$ mkdir -p lvmsnap/lvmsnap-1.0
Erstellen der Steuerungsdateien
Ein Grundgerüst erstellt man mit dh_make
.
$ cd lvmsnap/lvmsnap-1.0 $ dh_make -c gpl --createorig
Anpassen der Steuerungsdateien
Folgende Dateien sind jetzt vorhanden.
-rw-rw---- 1 michael michael 280 Dez 9 21:10 changelog -rw-rw---- 1 michael michael 2 Dez 9 18:32 compat -rw-rw---- 1 michael michael 586 Dez 9 21:58 control -rw-rw---- 1 michael michael 1079 Dez 9 21:37 copyright -rw-rw---- 1 michael michael 0 Dez 9 18:32 docs -rw-rw---- 1 michael michael 41 Dez 10 20:29 install -rwxr-xr-x 1 michael michael 852 Dez 9 18:32 rules drwxr-x--- 2 michael michael 4096 Dez 9 19:32 source
changelog
Version um 1 erhöhen und Beschreibung was geändert wurde anpassen (Achtung auf das Format penibel achten).
lvmsnap (1.0-1) unstable; urgency=low * Changes by the build process -- Michael Singer <info@bluelupo.net> Wed, 09 Dec 2015 21:00:00 +0100 lvmsnap (1.0-0) unstable; urgency=low * Initial release -- Michael Singer <info@bluelupo.net> Wed, 09 Dec 2015 18:33:33 +0100
compat
Bleibt unverändert.
control
Auch hier genau auf das Format achten.
Source: lvmsnap Section: misc Priority: optional Maintainer: Michael Singer <info@bluelupo.net> Build-Depends: debhelper (>= 9) Standards-Version: 3.9.6 Homepage: http://mywiki.bluelupo.net Package: lvmsnap Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: Bluelupo's LVM backup script Bluelupo's backup script for systems runs with lvm2. The script creates 1:1 backup copies of logical volumes using snapshots. The script can be configured individually with a conf file. The backups are as on a NAS, which is attached to the file system via NFS, stores.
copyright
Platzhalter durch sinnvolle Werte ersetzen und genau auf das Format achten.
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: lvmsnap Source: http://mywiki.bluelupo.net Files: * Copyright: 2015 Michael Singer info@bluelupo.net License: GPL-3.0+ Files: debian/* Copyright: 2015 Michael Singer <info@bluelupo.net> License: GPL-3.0+ License: GPL-3.0+ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. . This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. . On Debian systems, the complete text of the GNU General Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".
docs
Bleibt unverändert.
install
Den Installationsort der zu installierenden Dateien festlegen, das muss debiankonform sein.
bl_lvmsnap usr/bin lvmsnap.conf etc
rules
Für das paketieren von Shell-Scripten ist nicht mehr erforderlich.
DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/default.mk %: dh $@
source/format
Die ursprüngliche Zeile „3.0 (quilt)“ funktioniert nicht mit dem Bau von Shell-Scripten.
1.0
Zu paketierende Dateien kopieren
$ cp bl_lvmsnap <Arbeitsverzeichnis>/lvmsnap/lvmsnap-1.0 $ cp lvmsnap.conf <Arbeitsverzeichnis>/lvmsnap/lvmsnap-1.0
Paket bauen
$ cd <Arbeitsverzeichnis>/lvmsnap/lvmsnap-1.0 $ dpkg-buildpackage -us -uc
Danach sollten eine Ebene höher im Verzeichnisbaum die Source- und Binärpakete liegen.
$ cd .. $ ls -l drwxrwx--- 3 michael michael 4096 Dez 10 20:28 lvmsnap-1.0 -rw-rw---- 1 michael michael 1135 Dez 10 20:29 lvmsnap_1.0-1_amd64.changes -rw-r--r-- 1 michael michael 6380 Dez 10 20:29 lvmsnap_1.0-1_amd64.deb -rw-r--r-- 1 michael michael 758 Dez 10 21:07 lvmsnap_1.0-1.dsc -rw-r--r-- 1 michael michael 1317 Dez 10 21:08 lvmsnap_1.0-1_source.build -rw-r--r-- 1 michael michael 1115 Dez 10 21:08 lvmsnap_1.0-1_source.changes -rw-r--r-- 1 michael michael 6702 Dez 10 21:07 lvmsnap_1.0-1.tar.gz -rw-rw---- 1 michael michael 4624 Dez 9 18:32 lvmsnap_1.0.orig.tar.xz
Debian-Test durchführen
Mit dem Tool lintian
kann man das so eben erstellte Paket, auf Konfigurationsfehler die die Debian-Richtlinien verletzen, testen.
$ lintian -EvIL +pedantic *changes N: Using profile debian/main. N: Setting up lab in /tmp/temp-lintian-lab-bl57eoHEnF ... N: Unpacking packages in group lvmsnap/1.0-1 N: ---- N: Processing changes file lvmsnap (version 1.0-1, arch source amd64) ... N: ---- N: Processing source package lvmsnap (version 1.0-1, arch source) ... W: lvmsnap source: native-package-with-dash-version N: ---- N: Processing binary package lvmsnap (version 1.0-1, arch amd64) ... P: lvmsnap: no-upstream-changelog W: lvmsnap: binary-without-manpage usr/bin/bl_lvmsnap