Put the aubergine in a colander, sprinkle liberally with salt and cover with a plate or saucer. Put a heavy weight on top, then leave for 30 minutes.
Rinse the aubergine under cold running water, then drain thoroughly. Heat the oil in a large flameproof casserole dish, add the aubergine and onion, and cook gently, stirring frequently, until softened.
Add the garlic, pepper, courgettes and tomatoes. Stir well to mix, then pour in 300ml/10fl oz water and bring to the boil, stirring. Reduce the heat, then add the tomato purée, chilli powder and sugar. Season with salt and pepper.
Cover and simmer gently for 30 minutes, stirring occasionally and adding more water if the mixture becomes dry. Taste and adjust the seasoning, before serving hot.