A fascinating read on making simple syrup that is shelf-stable, and some surprisingly fascinating food safety lessons: http://cocktailjen.blogspot.com/2007/04/not-so-simple-syrup.html
In short:
Stir sugar into water in a 1:1 ratio
bring to boil
Add a dash of cream of tartar
simmer for 15 minutes
Let cool. If it hardens, add more water, repeat.
You now have shelf-stable simple syrup.
Add a shot of neutral spirit (vodka, etc) at the end, after removing from heat, to help preserve these syrups.
Add rosemary: 3-4 sprigs fresh rosemary during simmering