Link to thread: Safety of software installation from source code
Why is it "too broad" ?
I thought I was very specific.. can't see what should I add..
The issue with your question ("How do I know if a certain source code that is located in a certain website is truly the source code of a "known" software") is that there are an infinite number of answers, and none of them are clear-cut going to answer the question. We are not a generic discussion forum site. We are geared for Q&A with a point of trying to get a precise answer for questions. Cases such as what you are asking have wide ranging, numerous, and broad approaches which do not fit with the style of this site (please read the Help Center about what kinds of questions you can ask here).
There are many cases where the package in the repositories links to a now-dead upstream website, when in reality the project name changed and now exists somewhere else. Or, it's just literally a 'dead package' that is unmaintained but upstream developers for that project continue on (this is quite frequently an issue).
Regardless, there's no way to give you an answer that'll clearly answer the question, and it's impossible to define what is 'safe' or not when you start compiling source code yourself (the idea of 'caveat emptor' and 'use at your own risk' both apply in these cases)
Folks here take pride in answering questions well, and that's why we close questions where we can't do that.
I think Android Dev answered your question with a comment
"You could always audit the source code yourself"
That's pretty much it I think. Before downloading anything, read the source code and whatever scripts are provided to compile and install, and make sure they aren't going to do anything you don't want them to do (I think the definition of safe is also somewhat subjective, and that's another issue with your question...) otherwise, there's just no way to know.
But that's not a helpful answer unless we tell you how to do that, and it would take too long. It would take many books. And I'm pretty sure nobody here actually does that every time they install something from source. I just cross my fingers.
We prefer questions that can be answered, not just discussed.
If you want to start a discussion thread, Ubuntu Forums is the place...