How to upload package with dependencies to my PPA?

I made a package for my PPA and uploaded it. It built without any problems.

Then I made another package that depended on the first and uploaded it. It failed because it couldn't find the files in the first package. This leads me to believe that the first package wasn't even installed.

How can I make sure the first package is installed before it tries to build the second package?

The control file for the first package (libjsoncpp):

Source: jsoncpp
Priority: extra
Maintainer: Nathan Osman 
Build-Depends: debhelper (>= 7)
Standards-Version: 3.8.3
Section: libs
Homepage: http://jsoncpp.sf.net

Package: jsoncpp-dev
Section: libdevel
Architecture: any
Depends: libjsoncpp (= ${binary:Version})
Description: JSON parsing library for C++
 jsoncpp is a C++ library that makes it easy to
 read / write JSON data.
 .
 This package contains the development tools necessary
 to create applications that use jsoncpp.

Package: libjsoncpp
Section: libs
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: JSON parsing library for C++
 jsoncpp is a C++ library that makes it easy to
 read / write JSON data.

The control file for the second (libsopp):

Source: sopp
Priority: extra
Maintainer: Nathan Osman 
Build-Depends: debhelper (>= 7)
Standards-Version: 3.8.3
Section: libs
Homepage: http://stackoverflow.quickmediasolutions.com

Package: sopp-dev
Section: libdevel
Architecture: any
Depends: libsopp (= ${binary:Version}), jsoncpp-dev
Description: A C++ library for interfacing with StackExchange sites.
 so++ is a C++ library that wraps the functionality of the StackOverflow
 API. It provides access to all of the StackExchange sites.
 .
 This package contains the development files necessary to write software
 that uses so++.

Package: libsopp
Section: libs
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, libjsoncpp
Description: A C++ library for interfacing with StackExchange sites.
 so++ is a C++ library that wraps the functionality of the StackOverflow
 API. It provides access to all of the StackExchange sites.

Solution 1:

Your second package (sopp) needs to specify that it needs the first to build; the dependency you have specified (with Depends:) will only handle installation.

To add a build dependency, add this to the top (Source:) section of your control file:

Build-Depends: jsoncpp-dev

You should then be able to drop jsoncpp from the Depends line, as the shlibs:Depends macro should work that out itself.