How to calculate the normal matrix?
The normal matrix is the transpose inverse of the modelview matrix. So in GLSL it would be
mat4 normalMatrix = transpose(inverse(modelView));
However you should NOT calculate the normal matrix in the shader. Doing that in the shader wastes a lot of precious GPU cycles. Matrix inversion is not a cheap operation to start with and doing it in the shader forces the GPU to perform the calculation for each and every vertex again and again. Precalculate it on the CPU and pass it as a uniform.