Step 1: Use the condition that the curve passes through \(P(-2,0)\).
Since the curve touches the \(x\)-axis at
\[
P(-2,0),
\]
the point lies on the curve.
Therefore,
\[
0=a(-2)^3+b(-2)^2+c(-2)+5.
\]
So,
\[
0=-8a+4b-2c+5.
\]
Hence,
\[
-8a+4b-2c+5=0.
\]
Step 2: Use the touching condition.
Since the curve touches the \(x\)-axis at \(P(-2,0)\), the tangent at this point is the \(x\)-axis.
Therefore,
\[
\frac{dy}{dx}=0
\]
at
\[
x=-2.
\]
Now,
\[
y=ax^3+bx^2+cx+5.
\]
Differentiating,
\[
\frac{dy}{dx}=3ax^2+2bx+c.
\]
At \(x=-2\),
\[
0=3a(-2)^2+2b(-2)+c.
\]
So,
\[
0=12a-4b+c.
\]
Hence,
\[
c=4b-12a.
\]
Step 3: Substitute \(c=4b-12a\) in the first equation.
From Step 1,
\[
-8a+4b-2c+5=0.
\]
Substitute
\[
c=4b-12a.
\]
Then,
\[
-8a+4b-2(4b-12a)+5=0.
\]
Simplifying,
\[
-8a+4b-8b+24a+5=0.
\]
Thus,
\[
16a-4b+5=0.
\]
So,
\[
4b=16a+5.
\]
Hence,
\[
b=4a+\frac54.
\]
Step 4: Find \(c\).
Using
\[
c=4b-12a,
\]
we get
\[
c=4\left(4a+\frac54\right)-12a.
\]
Therefore,
\[
c=16a+5-12a.
\]
Hence,
\[
c=4a+5.
\]
Step 5: Final conclusion.
Therefore,
\[
\boxed{4a+5}.
\]