In this paper, we study the problem of nonparametric adaptive estimation of the spectral density f of a stationary Gaussian sequence. For this purpose, we consider a collection of finite-dimensional linear spaces (e.g. linear spaces spanned by wavelets or piecewise polynomials on possibly irregular grids or spaces of trigonometric polynomials). We estimate the spectral density by a projection estimator based on the periodogram and built on a data-driven choice of linear space from the collection. This data-driven choice is made via the minimization of a penalized projection contrast. The penalty function depends on \|f\|∞, but we give results including the estimation of this bound. Moreover, we give extensions to the case of unbounded spectral densities (long-memory processes). In all cases, we state non-asymptotic risk bounds in L2-norm for our estimator, and we show that it is adaptive in the minimax sense over a large class of Besov balls.