Harding Bros through their shop onboard have the sole franchise to sell tobacco and alcohol "duty free" and you can only collect it or have it delivered at the end of your cruise. P&O no longer sell "duty free". I would endorse what ms Hill has said, only to add that branded Scotch for a litre bottle is £6 to £6.50 on Gibraltar and £10 to £15 onboard. With Courvoisier VSOP the differences are quite startling - £20 on Gibraltar and £32 onboard!
The Spanish taxes only apply to purchases when you are in Spanish ports or Spanish waters. With regards to duty free shops if you mean for alcohol you will only be allowed to buy duty free on the ship that will be delivered to your cabin at the end of the cruise for you to bring home and not to drink onboard. If you havent been before just be aware that Gibraltar is very cheap for spirits and cigarettes cheaper than onboard but you cannot bring loads home through customs think its 1 litre of spirits per person a lot make the mistake and buy loads.
If you start and finish a cruise in a Spanish port then you will be charged the VAT equivalent on every purchase when you are on the ship. If you are just visiting a Spanish port then the ship will charge you the Spanish VAT whilst it is in their territorial waters. If you like wine with your meal then make sure you have ordered extra the day before you are due to dock in a Spanish port. I personally will not book a cruise that starts and finishes in any Spanish port. If we all did the same then the Spanish government may rethink their draconian rulings on the VAT (I think they call their VAT equivalent IVA).