The F-word has some rather unusual derivations over the years. It pretty much means what it means today. There are some interesting nautical and sailor-like derivations in the literature. One is the term fucksail, which was a foresail (like the jib sail) on a sailing ship, as translated from the Scottish. The Old Norse word fukja ended up as another salty word, windfucker. But the main, big mack daddy of linguistics was the more Germanic fricken, which meant "to strike, bonk, or copulate." Pretty much what you thought it was.
Now take the situation of a big old wooden mast on a big old wooden boat. The mast had to go right through the deck to the bottom of the boat. The mast was tipsey so they used all these ropes and lines to stay the mast. The last thing was to secure the deck or cabin around there the mast went through - or it would leak.
So using a bunch of wooden wedges and a large wooden hammer called a top-mall, you'd pound in the wedges. The wedge, the hammer, and the guy doing the pounding were known as fuckers, who actually were quite good at setting large masts. Indeed, one possible meaning of the F-word is "to wedge." Anyway, you had to shave the wedges right so they all matched up just so, and that's how you fucked a mast right.
As a final act of water-proofing and good seamanship, you had to securely wrap canvas around the wedges and paint it, a practice related to the word fucksail, which also meant a woman's skirt. Unfortunately, there is a connection.