You could define MY_P="${PN}_${PV}" and use this here and in $S