We observe that a system of irreducible, fiber-linear, first class constraints on T * M is equivalent to the definition of a foliation Lie algebroid over M . The BFV formulation of the constrained system is given by the Hamiltonian lift of the Vaintrob description (E[1], Q) of the Lie algebroid to its cotangent bundle T * E[1]. Affine deformations of the constraints are parametrized by the first Lie algebroid cohomology H 1 Q and lead to irreducible constraints also for much more general Lie algebroids such as Dirac structures; the modified BFV function follows by the addition of a representative of the deformation charge.Adding a Hamiltonian to the system corresponds to a metric g on M . Evolution invariance of the constraint surface introduces a connection ∇ on E and one reobtains the compatibility of g with (E, ρ, ∇) found previously in the literature. The covariantization of the Hamiltonian to a function on T * E[1] serves as a BFV-Hamiltonian, iff, in addition, this connection is compatible with the Lie algebroid structure, turning (E, ρ, [·, ·], ∇) into a Cartan-Lie algebroid. The BV formulation of the system is obtained from BFV by a (time-dependent) AKSZ procedure.