If one wishes to smell a fragrant fruit to enjoy its scent, then he first recites the Beracha, "Baruch Ata…Ha’noten Re’ah Tob Ba’perot." Even if the fruit is grown and used primarily for eating, and not for its fragrance, nevertheless, one who wishes to smell it to enjoy its fragrance first recites this Beracha. Even if the fragrance emanates mainly from the peel, nevertheless, this Beracha is recited. Common examples include lemons, apples and melons. One who wishes to enjoy the fragrance of such a fruit recites this Beracha. Hacham Ovadia Yosef added that on Shabbat, it is recommended to smell a fragrant fruit in order to help fulfill the requirement to recite 100 Berachot each day (which is more difficult on Shabbat, when the Amida prayer contains only seven Berachot).
The Shulhan Aruch rules that one recites this Beracha also when smelling cloves. The common practice, however, as noted by the Ben Ish Hai (Rav Yosef Haim of Baghdad, 1833-1909), is to recite over whole cloves the Beracha of "Boreh Aseh Besamim," and this custom is accepted by several Poskim, including Hacham Ovadia Yosef.
The Beracha of "Boreh Aseh Besamim" is recited also before smelling other fragrant items taken from trees or bushes, such as Hadasim, roses, rosewater (the liquid extracted from roses), gardenias and cinnamon sticks.
When one smells a plant which grows directly from the ground, and not from a tree or bush, he recites the Beracha of "Boreh Asbeh Besamim." These include plants such as mint and daffodils.
Some Poskim ruled that if somebody smells fresh bread to enjoy its fragrance, then he recites the Beracha, "Ha’noten Re’ah Tob Ba’pat." However, Hacham Ovadia Yosef ruled that since this requirement is uncertain, we apply the famous rule of "Safek Berachot Le’hakel" – that a Beracha is not recited in situations of uncertainty – and so one does not recite a Beracha before smelling bread.
There is a debate among the Poskim as to whether one who smells ground coffee beans for their fragrance recites a Beracha. Several Poskim, including the Kaf Ha’haim (Rav Yaakob Haim Sofer, Baghdad-Jerusalem, 1870-1939), as well as Rabbi Moshe Levi (Israel, 1961-2000) in his Birkat Hashem, maintained that one does not recite a Beracha in this case. Others, however, argued that since coffee beans are, essentially, fruit taken from the coffee tree, one who smells ground coffee recites the same Beracha required when smelling any fragrant fruit – "Ha’noten Re’ah Tob Ba’perot." Hacham Ovadia Yosef (as cited in Yalkut Yosef, English edition, p. 349, based on Hazon Ovadia – Berachot, p. 329) ruled that those who wish to recite a Beracha before smelling ground coffee have a Halachic basis for doing so.
Summary: If one smells a fragrant fruit to enjoy its scent – such as a lemon or apple – he first recites the Beracha, "Ha’noten Re’ah Tob Ba’perot." According to some Poskim, one recites this Beracha also before smelling ground coffee to enjoy its aroma. Before smelling plants originating from trees or bushes – such as whole cloves, Hadasim, roses, rosewater (the liquid extracted from roses), gardenias and cinnamon sticks – one recites the Beracha, "Boreh Aseh Besamim." Before smelling plants that grow directly from the ground – such as mint or daffodils – one recites the Beracha, "Boreh Asbeh Besamim." One who smells fresh bread to enjoy its fragrance does not recite a Beracha.