In this paper we propose a mathematical program able to optimize the product portfolio scope of a software product line and sketch both a development and a release planning. Our model is based on the description of customer needs in terms of goals. We show that this model can be instantiated in several contexts such as a market customization strategy or a mass-customization strategy. It can deal with Software Product Line development from scratch as well as starting from a legacy software base. We demonstrate its applicability with an example based on a case study.