summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Sbuild.hs
diff options
context:
space:
mode:
authorSean Whitton2016-05-16 10:48:25 -0700
committerSean Whitton2016-05-16 10:48:25 -0700
commit57b6b2c8b57fbc5cd6fc3ebb174c7a343870ea1e (patch)
tree5504ec40d3c9e4507d09e2446655e909667cc228 /src/Propellor/Property/Sbuild.hs
parent718c2bb387e83aa05169ff7c09f4600577941b20 (diff)
add Sbuild.hs
Diffstat (limited to 'src/Propellor/Property/Sbuild.hs')
-rw-r--r--src/Propellor/Property/Sbuild.hs55
1 files changed, 55 insertions, 0 deletions
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 <spwhitton@spwhitton.name>
+
+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"]