Preheat oven to 350 degrees F (175 degrees C). Line a rimmed baking sheet with parchment paper.
Arrange pineapple slices in an even layer on prepared baking sheet.
Roast pineapple in the preheated oven until tender, about 45 minutes. Let cool until easily handled, 20 to 30 minutes.
Transfer cooled pineapple to a container. Top with rum.
Split vanilla bean lengthwise with the tip of a sharp knife. Holding the pod open, scrape seeds from each half using the flat side of your knife. Add seeds and scraped pods to the container. Stir in raisins, cinnamon sticks, orange zest, vanilla extract, peppercorns, allspice berries, nutmeg, star anise, and cardamom.
Seal container and store in a cool, dark place. Mix every day, removing any spice that becomes too dominant for your taste, until rum reaches desired flavor, 5 days to 2 weeks. Strain through a fine-mesh sieve. Strain again through a coffee filter. Discard whole spices; reserve strained fruit.