@Mouaad This patch look nice. Could you push it to Alioth along with the patch adding default-jdk? Thank you!
Would be better if you use some sed command to process the version string. You can retrieve the package version by including "/usr/share/dpkg/pkg-info.mk" and access the variable DEB_VERSION_UPSTREAM. You can find more related variable by reading that .mk file.