The Catechism of the Catholic Church states:
2211 The political community has a duty to honor the family, to assist it, and to ensure especially [...] the protection of security and health, especially with respect to dangers like drugs, pornography, alcoholism, etc.;
2290 The virtue of temperance disposes us to avoid every kind of excess: the abuse of food, alcohol, tobacco, or medicine. Those incur grave guilt who, by drunkenness or a love of speed, endanger their own and others' safety on the road, at sea, or in the air.
2291 The use of drugs inflicts very grave damage on human health and life. Their use, except on strictly therapeutic grounds, is a grave offense. Clandestine production of and trafficking in drugs are scandalous practices. They constitute direct co-operation in evil, since they encourage people to practices gravely contrary to the moral law.
Unfortunately, the Catechism does not provide a definition for the word drug or a description of what constitutes a distinction between drug and medicine. Paragraph 2290 includes food and does not therefore instruct abstinence but temperance, as it states, even with substances such as alcohol, tobacco, and medicines, which according to most definitions are indeed drugs. In addition, Paragraph 2291 excepts from the prohibition on drugs strictly therapeutic use. This seems to conflate the two terms drug and medicine, even though the use of one is prohibited and the use of the other is condoned with temperance.
In many western cultures, prohibition and control of substances is a relatively new practice, at least in terms of the lifetime of the Church. Is the prohibition of these substances by the church contemporaneous?
How has the position of the Catholic Church changed over time, from the Early Church Fathers until now, in condoning, instructing temperance, or commanding strict abstinence from the use of substances that perish with use, either for medical treatment or purposes other than medical treatment?
Edit to assist answers for bounty: I'm looking for a well sourced answer that gives an overview of the progression of moral and practical teachings concerning drugs, especially citing those traditional sources that mention substances or uses specifically, and considers any such progression alongside drug (or anti-drug) policies of nations like the US and the UK. An excellent answer would demonstrate how the use of some substances that were once permitted with temperance are now prohibited (or vice versa) if that is the case, or demonstrate that the church has always deferred the definition of "illicit drugs" to local churches and their (secular) legal systems, etc.