How to evenly unwrap / texture long extruded objects with folds and uneven segments? I've some difficulties to find a satisfactory unwrap solution for this kind of long angled object with uneven segments:

  

I'm only interested in the brown faces which are delimited by two seams. 

The solution must preserve the relative length of each straight segment, so that the texture containing a repeated pattern can be mapped evenly on the whole length (the sample is a ceramic baseboard).

Here is the result with a cube projection and a checker texture, other methods provide different results, but the distortion is always present:

  

I can't find a solution, except purely manual, to create the UV map while ensuring all segments:


Are oriented in the same direction on the map,
Have their length proportional to their actual size, to prevent texture distortion.


These constraints seem quite common, is there a standard approach?

Intuitively, I'm expecting the most simple method to lead to overlapping variable length rectangles, in the same direction, anchored at a corner (or a very large single rectangle).
First step:

See the different values under "Scale" on the right side?
Your model is stretched in different directions.



for unwrapping to work correctly, apply the scale (the numbers for x,y and z should all be 1).
select your object -> ctrl+a -> Apply Scale



Next

As you don't care about the blue backside, create a seam on the outside of the blue Part.
alt+shift+rmb might help a lot in edge select mode (shift+tab).



If you unwrap now, the image will still be distorted. so we need to add one more little step:

We need to create seems in every corner. You don't need to go all the way to the bottom though – only as long as the tilted faces on the top go. This way your texture is continuous all the way through (you might or might not want that – if you don't, extend the seams to the bottom).



now select everything -> u -> unwrap

depending on the project i often get better results if I change the unwrapping method to "conformal" on the left panel.



The final UV in the Image Editor (The blue backsides on the bottom aren't 100% straight, but you don't care, right?):



And the Object in Material View:






Let me know, if you have any questions.