From 57b6b2c8b57fbc5cd6fc3ebb174c7a343870ea1e Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Mon, 16 May 2016 10:48:25 -0700 Subject: add Sbuild.hs --- src/Propellor/Property/Sbuild.hs | 55 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 src/Propellor/Property/Sbuild.hs (limited to 'src/Propellor/Property') diff --git a/src/Propellor/Property/Sbuild.hs b/src/Propellor/Property/Sbuild.hs new file mode 100644 index 00000000..7739a3bf --- /dev/null +++ b/src/Propellor/Property/Sbuild.hs @@ -0,0 +1,55 @@ +{-| +Maintainer: Sean Whitton + +Build and maintain schroots for use with sbuild. + +Suggested usage in @config.hs@: + +> & Sbuild.built (Debian Unstable) "i386" +> & Sbuild.updated (Debian Unstable) "i386" `period` Weekly +> & Sbuild.usableBy (User "spwhitton") +> & Sbuild.shareAptCache +> & Schroot.overlaysInTmpfs + +In @~/.sbuildrc@: + +> $run_piuparts = 1; +> $piuparts_opts = ['--schroot=unstable-i386-sbuild']; +> +> $external_commands = { +> 'post-build-commands' => [ +> [ +> 'adt-run', +> '--changes', '%c', +> '---', +> 'schroot', 'unstable-i386-sbuild', +> ], +> ], +> }; + +We use @sbuild-createchroot(1)@ to create a chroot to the specification of +@sbuild-setup(7)@. This differs from the approach taken by picca's Sbuild.hs, +which uses 'Propellor.Property.Debootstrap' to construct the chroot. This is to +ensure that the clean package build environment is standardised. +-} + +module Propellor.Property.Sbuild where + +import Propellor.Base +import qualified Propellor.Property.Apt as Apt + +-- | Update a schroot's installed packages and apt indexes. +updated :: System -> Architecture -> Property DebianLike +updated = undefined +-- TODO autoclean/clean only if shareAptCache property not present + +-- | Bind-mount @/var/cache/apt/archives@ in all sbuild chroots so that the host +-- system and the chroot share the apt cache. +-- +-- This speeds up builds by avoiding unnecessary downloads of build +-- dependencies. +shareAptCache :: Property DebianLike +shareAptCache = undefined + +installed :: Property DebianLike +installed = Apt.installed ["sbuild"] -- cgit v1.2.3