-# The binary sequences will call 'debian/rules install' before running
-# the standard sequence.
-$sequences{binary} = ['rules:install', 'rules:binary-arch', 'rules:binary-indep'];
-$sequences{'binary-indep'} = ['rules:install-indep', @b];
-$sequences{'binary-arch'} = ['rules:install-arch', @ba, @b];
+$sequences{clean} = [qw{
+ dh_testdir
+ dh_auto_clean
+ dh_clean
+}];
+$sequences{'build-indep'} = [@bd];
+$sequences{'build-arch'} = [@bd];
+if (! compat(8)) {
+ # From v9, sequences take standard rules targets into account.
+ $sequences{build} = [@bd_minimal, rules("build-arch"), rules("build-indep")];
+ $sequences{'install-indep'} = [rules("build-indep"), @i];
+ $sequences{'install-arch'} = [rules("build-arch"), @i];
+ $sequences{'install'} = [rules("build"), rules("install-arch"), rules("install-indep")];
+ $sequences{'binary-indep'} = [rules("install-indep"), @b];
+ $sequences{'binary-arch'} = [rules("install-arch"), @ba, @b];
+ $sequences{binary} = [rules("install"), rules("binary-arch"), rules("binary-indep")];
+}
+else {
+ $sequences{build} = [@bd];
+ $sequences{'install'} = [@{$sequences{build}}, @i];
+ $sequences{'install-indep'} = [@{$sequences{'build-indep'}}, @i];
+ $sequences{'install-arch'} = [@{$sequences{'build-arch'}}, @i];
+ $sequences{binary} = [@{$sequences{install}}, @ba, @b];
+ $sequences{'binary-indep'} = [@{$sequences{'install-indep'}}, @b];
+ $sequences{'binary-arch'} = [@{$sequences{'install-arch'}}, @ba, @b];
+}