\documentclass[12pt]{article}
\usepackage{filecontents}
\usepackage{graphicx}
\usepackage{ifpdf}

% Tell pdfLaTeX to treat our .eps file as a .mps file.
\ifpdf
  \DeclareGraphicsExtensions{.png,.pdf,.jpg,.mps,.tif,.eps}
  \DeclareGraphicsRule{.eps}{mps}{*}{}
\fi

\begin{document}

The \texttt{filecontents} package makes me happy.

\begin{filecontents*}{smiley.eps}
%!PS-Adobe-3\begin{scriptsize}
.
\end{scriptsize}0 EPSF-3.0
%%BoundingBox: 0 0 105 105 
%%HiResBoundingBox: 0 0 105 105 
%%Creator: MetaPost 1.208
%%CreationDate: 2010.09.13:1836
%%Pages: 1
%%BeginProlog
%%EndProlog
%%Page: 1 1
 1 1 0 setrgbcolor
newpath 102.5 52.5 moveto
102.5 24.8867 80.1133 2.5 52.5 2.5 curveto
24.8867 2.5 2.5 24.8867 2.5 52.5 curveto
2.5 80.1133 24.8867 102.5 52.5 102.5 curveto
80.1133 102.5 102.5 80.1133 102.5 52.5 curveto
 closepath fill
newpath 102.5 52.5 moveto
 closepath fill
 0 0 0 setrgbcolor 0 5 dtransform truncate idtransform setlinewidth pop
 [] 0 setdash 1 setlinejoin 10 setmiterlimit
newpath 102.5 52.5 moveto
102.5 24.8867 80.1133 2.5 52.5 2.5 curveto
24.8867 2.5 2.5 24.8867 2.5 52.5 curveto
2.5 80.1133 24.8867 102.5 52.5 102.5 curveto
80.1133 102.5 102.5 80.1133 102.5 52.5 curveto
 closepath stroke
 0 setlinecap
newpath 102.5 52.5 moveto 0 0 rlineto stroke
newpath 46.10161 72.5 moveto
46.10161 66.97661 41.6211 62.5 36.10161 62.5 curveto
30.5781 62.5 26.10161 66.97661 26.10161 72.5 curveto
26.10161 78.02339 30.5781 82.5 36.10161 82.5 curveto
41.6211 82.5 46.10161 78.02339 46.10161 72.5 curveto
 closepath fill
newpath 46.10161 72.5 moveto
 closepath fill
newpath 82.5 72.5 moveto
82.5 66.97661 78.02339 62.5 72.5 62.5 curveto
66.97661 62.5 62.5 66.97661 62.5 72.5 curveto
62.5 78.02339 66.97661 82.5 72.5 82.5 curveto
78.02339 82.5 82.5 78.02339 82.5 72.5 curveto
 closepath fill
newpath 82.5 72.5 moveto
 closepath fill
 0 setlinejoin
newpath 92.5 47.6992 moveto
92.5 36.418 74.5273 17.6992 52.3555 17.6992 curveto
30.1875 17.6992 12.2148 36.418 12.2148 47.6992 curveto stroke
showpage
%%EOF
\end{filecontents*}






\begin{center}
  \includegraphics{smiley}
\end{center}

\end{document}









