Fabrication of hydroxyapatite ceramic with controlled porosity