Wash the eggplant/aubergine. If you don't want to keep all the peel, use a peeler to make alternate stripes of black and white lengthwise. Cut into 1-in/2-cm cubes. Place in a colander and sprinkle with salt. Leave for 30 minutes to drain.
Heat the oil in a large saucepan. Stir in the onion and cook over moderate heat until soft, 5-7 minutes. Stir in the garlic and tomatoes and cook for 10 minutes more. Stir in the vinegar, sugar and a good grinding of black pepper. Simmer until the sauce reduces and darkens, 10-15 minutes more. Turn off the heat.
Meanwhile, blanch the celery stalks in a large pot of boiling water until just tender. Drain and chop into 1-in/2-cm pieces. Add the celery to the tomato sauce with the olives and capers.
Rinse the eggplant/aubergine pieces to remove the salt. Squeeze out the excess water with your fingers and pat the pieces dry using paper or cloth towels. Heat the oil to 360°F/185°C and deep fry the eggplant/aubergine in batches until golden. Drain on paper towels.
Add the fried eggplant/aubergine to the sauce. Stir gently and taste for seasoning. Stir in the basil. Let the caponata stand for at least 30 minutes before serving at room temperature.