How to enable lighting in 3.1

The 3.1 specification says glEnable’s target GL_LIGHTING (page 297, paragraph 1)is deprecated. So, which is the recommended way to do lighting in 3.1?

btw: I think the specification should not only give a list of deprecated features but also give their recommended replacements.

I suppose you need to use shaders for lighting.

Pretty much everything is replaced by shaders, except for vertex transformations and other matrix manipulations, those you have to do yourself.

Vertex transformations? Aren’t they also replaced by vertex shader?

Well, sure you have to apply them at the last stage there as usual, but you have to build the matrices yourself on the cpu.

Or in other words, glFrustum, glLoadIdentity, glLoadMatrix, glLoadTransposeMatrix, glMatrixMode, glMultMatrix, glMultTransposeMatrix, glOrtho, glPopMatrix, glPushMatrix, glRotate, glScale, and glTranslate and so on are no longer there.