A simple set of two reaction-diffusion equations is analyzed near the threshold for the appearance of spatially periodic solutions in one dimension. Exact amplitude equations are derived to second order in the deviation from the threshold. Wavevector selection is studied analytically for parameters varying slowly in space from supercritical to subcritical conditions. The nonuniversality of the selection process is demonstrated explicitly for nonpotential cases. The effect of boundary conditions on restricting the available band of wavevectors is studied for solutions which fall below their bulk value near the boundary (type I). The existence of another class of static solutions (type II), remaining finite at the boundary even near threshold, is demonstrated.