If you can get 80% of the functionality you need from a packaged solution, then buy it. Otherwise, build it.
The problem is that the remaining 20% often costs more to build and maintain than the packaged 80%. And it's usually not clear if or why that will happen when you start. Vendor "Build versus Buy" white papers are generally better at telling you where they make their money than they are at helping you make the right decision. Analyst reports provide broad direction but are usually viewing the situation from a platitudinous 50,000 foot level. In reality, your decision to "build from scratch", "build on top of a base package", or "buy complete" or "outsource" hinges on your organization's unique situation and criteria.