Correct post/pre scripts extraction

Methods get_*_section_key() only return the first line of the pre/post
sections of spec files. This patch corrects that so the whole section
is returned instead.

Also factorize the code by replace the get_*_section_key() methods with
a unique one: get_script_section_key().

Signed-off-by: Kévin THIERRY <kevin.thierry@open.eurogiciel.org>
Add post install scripts to recipes

Note that only the first "%post" section found in spec files is
treated, the other ones are ignored. This issue should be taken care of.

Signed-off-by: Kévin THIERRY <kevin.thierry@open.eurogiciel.org>
Add pre, preun and postun scripts to recipes

Note that only the first reference to a section found in spec files are
treated, the other ones are ignored. This issue should be taken care of.

Signed-off-by: Kévin THIERRY <kevin.thierry@open.eurogiciel.org>
Remove ${D} from post/pre scripts

The correct path is generated in the recipe when macros are used in the
spec file. Correcting the spec files is the way to go so we remove the
addition of the "${D}" prefix.

Also clean code.

Signed-off-by: Kévin THIERRY <kevin.thierry@open.eurogiciel.org>
Add full support for pre/post install script

Spec file sections %pre, %post, %preun, and %postun are now added in
recipes.

All sections of pre/post install/uninstall scripts are now added to the
recipes.

Signed-off-by: Kévin THIERRY <kevin.thierry@open.eurogiciel.org>
Correct issue with %prep and %pre

%prep section in spec files was used as a %pre section. This commit
correct this issue.

Signed-off-by: Kévin THIERRY <kevin.thierry@open.eurogiciel.org>