Minecraft wiki entry for Pumpkin_and_melon_farming, associated text: 16 dirt
8 jack-o-lanterns, or glowstone (for lighting)
8 iron
28 Redstone + an extra 10 - 13
At least 50 generic blocks per crop layer, an extra 43 blocks for the build as a whole.