The spirit here is a reference to the breath of life which was breathed into the nostrils of man so that man could become a living soul. (Genesis 2:7) The breath of life will be gone with the wind, so to speak when man passes away. There is nothing eternal about man but Sheol aka the grave. (Psalm 49:12,20)
Regarding Daniel 12:2, that's a reference to the Jews in exile. If you read Isaiah 53:8,9 when Jews are forced into exile, it is as if they are cut off from the land of the living and graves are assigned to them among the nations. At the end of the exile, HaShem opens up their metaphorical graves and brings them back to the Land of Israel as if to enjoy eternal life. But many of them choose to remain in exile to their reproach and abhorrent shame.
yeah, the spirit also translates as mind too ruach.
jesus speak of how it enlivens here. like mind over matter..
The Spirit gives life; the flesh counts for nothing. The words I have spoken to you--they are full of the Spirit and life.