Lebanon's parliament has abolished the death penalty, becoming the first Middle Eastern country to replace it with life imprisonment and hard labour.