Patches applied as 604cd06e357ee31d7c7be922d9f615b60fe99db9 and following with a few modifications (package moved at the right place in the file, a few simplifications and fixes). Thanks.