[buildd-tools-devel] Bug#859867: Bug#859867: Bug#859867: Please add a package which automatically configures sbuild for Debian packaging

Michael Stapelberg stapelberg at debian.org
Tue Aug 1 21:15:04 UTC 2017


Alright! Patch attached and provided inline, for your convenience:

>From b29b1faf6bafb4b6e51b4e99d0febc81abbb543c Mon Sep 17 00:00:00 2001
From: Michael Stapelberg <stapelberg at debian.org>
Date: Tue, 1 Aug 2017 23:13:36 +0200
Subject: [PATCH] add sbuild-debian-developer-setup package

---
 bin/Makefile.am                              |  1 +
 bin/sbuild-debian-developer-setup            | 49
++++++++++++++++++++++++++++
 debian/control                               | 16 +++++++++
 debian/sbuild-debian-developer-setup.install |  1 +
 4 files changed, 67 insertions(+)
 create mode 100755 bin/sbuild-debian-developer-setup
 create mode 100644 debian/sbuild-debian-developer-setup.install

diff --git a/bin/Makefile.am b/bin/Makefile.am
index 138fc0b3..0fcbda09 100644
--- a/bin/Makefile.am
+++ b/bin/Makefile.am
@@ -28,6 +28,7 @@ bin_SCRIPTS = \
  sbuild-abort \
  sbuild-apt \
  sbuild-checkpackages \
+ sbuild-debian-developer-setup   \
  sbuild-update \
  sbuild-upgrade \
  sbuild-distupgrade \
diff --git a/bin/sbuild-debian-developer-setup
b/bin/sbuild-debian-developer-setup
new file mode 100755
index 00000000..82341d28
--- /dev/null
+++ b/bin/sbuild-debian-developer-setup
@@ -0,0 +1,49 @@
+#!/usr/bin/perl
+#
+# Set up sbuild so that packages for Debian unstable can be built and
+# maintenance is done automatically via a daily update cronjob.
+# Copyright © 2017 Michael Stapelberg <stapelberg at debian.org>.
+#
+# 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 2 of the License, or
+# (at your option) any later version.
+#
+# This program 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
+# <http://www.gnu.org/licenses/>.
+#
+#######################################################################
+
+use strict;
+use warnings;
+use autodie qw(:all);
+use v5.10;
+
+if (!defined($ENV{SUDO_USER})) {
+    die "Please run sudo $0";
+}
+
+system("adduser", "--quiet", "--", $ENV{SUDO_USER}, "sbuild");
+
+chomp(my $arch = `dpkg --print-architecture`);
+
+system("sbuild-createchroot",
+       "--command-prefix=eatmydata",
+       "--include=eatmydata",
+       "--alias=UNRELEASED",
+       "--alias=sid",
+       "unstable",
+       "/srv/chroot/unstable-$arch-sbuild",
+       "http://localhost:3142/deb.debian.org/debian");
+
+open(my $fh, ">", "/etc/cron.d/sbuild-debian-developer-setup-update-all");
+say $fh q|@daily root /usr/share/doc/sbuild/examples/sbuild-update-all|;
+close($fh);
+
+say "Now run `newgrp sbuild', or log out and log in again.";
diff --git a/debian/control b/debian/control
index 7249e630..7b4bd21b 100644
--- a/debian/control
+++ b/debian/control
@@ -75,6 +75,22 @@ Description: Tool for building Debian binary packages
from Debian sources
  build-essential packages, plus those in the package build
  dependencies.

+Package: sbuild-debian-developer-setup
+Architecture: all
+Depends: sbuild,
+         apt-cacher-ng,
+         lintian,
+         ${misc:Depends},
+         ${perl:Depends},
+         ${shlibs:Depends}
+Description: Convenience script to set up an sbuild environment for Debian
Developers
+ Run "sudo sbuild-debian-developer-setup" to add the current user to the
sbuild
+ group, create an schroot for building packages for Debian unstable, and
create
+ a cronjob which updates said schroot daily.
+ .
+ This script assumes you are on an un-metered internet connection (daily
schroot
+ updates might be costly otherwise).
+
 Package: buildd
 Architecture: all
 Depends: adduser,
diff --git a/debian/sbuild-debian-developer-setup.install
b/debian/sbuild-debian-developer-setup.install
new file mode 100644
index 00000000..406b3af9
--- /dev/null
+++ b/debian/sbuild-debian-developer-setup.install
@@ -0,0 +1 @@
+usr/bin/sbuild-debian-developer-setup
-- 
2.13.2


On Tue, Aug 1, 2017 at 11:05 AM, Johannes Schauer <josch at debian.org> wrote:

> Quoting Michael Stapelberg (2017-08-01 11:04:16)
> > That works for me :).
> >
> > How shall we proceed? Should I prepare a patch against the sbuild
> package?
>
> Yes please!
>
> Put the patch into this bug and then we can talk about it. :)
>



-- 
Best regards,
Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/buildd-tools-devel/attachments/20170801/ed4779e7/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-add-sbuild-debian-developer-setup-package.patch
Type: text/x-patch
Size: 4102 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/buildd-tools-devel/attachments/20170801/ed4779e7/attachment-0001.bin>


More information about the Buildd-tools-devel mailing list