I am writing this post after a long time. We all face this problem specially during rainy or monsoon season. Our spices turn out into cakes due to absorption of moisture from air. And most of the time we throw away such spices. But now we have a solution.
Next time when it happens just heat away such spices in microwave at a low temperature for about 30 second. This way they will become fresh and crispy.