Chop the aubergine into medium-size cubes, then sprinkle it with 3-4 Tbsp of large salt, Mix together, then place in a sieve. Place the sieve in a bowl or in the sink. Put a plate on top of the aubergine chunks and then something heavy on top of the plate. Leave it to release its water for about 2 hours. This allows the aubergines to brown well and not suck up as much oil.
Roast the capsicums in the oven for 40 minutes at 180 degrees C (350F). Take them out and put them in a paper bag to allow the skins to be peeled off easily. Now, this is what I did as I like them very cooked, but you can also cut them into slices raw and cook them with the aubergines in one of the later steps if you prefer.
Peel the tomatoes and chop them into chunks. If the capers are packed in salt, rinse them.
Boil the celery for 3 minutes, then saute it in olive oil for 5 minutes. Pour it into a sieve and let the oil drain off while cooking everything else to make the caponata a little lighter.
Slice the onions into medium/fine slices, then saute them in a separate pan at a low heat from 15 minutes, stirring often. Then should become translucent, but not browned.
Add the capers, pine-nuts and olives and stir.
Add the tomatoes, and cook uncovered on a low heat for 20 minutes, stirring occasionally.
Rinse the aubergine chunks and pat them dry. Fry them in another pan until they are browned. (If using raw capsicum, this is the time to cook them).
Add everything together and mix.
Dissolve the sugar in the vinegar and pour it over the mixture. Stir then leave it on the heat for 3 or 4 minutes until the vinegar smell has gone.
If you have some fresh basil, sprinkle some leaves over the top. The dish generally doesn't need salting because of the capers and aubergines that have been sitting in salt.