Here's the formulation of the linear program and the Gurobi code to solve it:

**Decision Variables:**

* `x`: Number of packages of LED lightbulbs produced.
* `y`: Number of packages of Halogen lightbulbs produced.

**Objective Function:**

Maximize profit: `30x + 50y`

**Constraints:**

* **Plastics Machine Constraint:** `6x + 9y <= 500`
* **Wiring Machine Constraint:** `12x + 10y <= 500`
* **Non-negativity Constraints:** `x >= 0`, `y >= 0`


```python
import gurobipy as gp
from gurobipy import GRB

# Create a new model
m = gp.Model("lightbulb_production")

# Create decision variables
x = m.addVar(vtype=GRB.CONTINUOUS, name="LED")
y = m.addVar(vtype=GRB.CONTINUOUS, name="Halogen")

# Set objective function
m.setObjective(30*x + 50*y, GRB.MAXIMIZE)

# Add constraints
m.addConstr(6*x + 9*y <= 500, "plastics_constraint")
m.addConstr(12*x + 10*y <= 500, "wiring_constraint")

# Optimize model
m.optimize()

# Print results
if m.status == GRB.OPTIMAL:
    print(f"Optimal Solution Found:")
    print(f"Number of LED packages: {x.x}")
    print(f"Number of Halogen packages: {y.x}")
    print(f"Maximum Profit: ${m.objVal}")
elif m.status == GRB.INFEASIBLE:
    print("The model is infeasible.")
else:
    print(f"Optimization terminated with status {m.status}")

```
