I've read about people that will dig a hole in the ground, and then bury a barrel in that hole. They cut the top and bottom out of the barrel. This allows the fire to rest on the dirt floor, and then they fashion a tight fitting lid for the top of the barrel.
The barrel is buried flush with the ground. Then you add rocks to the barrel to fill it about 1/4 of the way. Now build a huge fire on those rocks. Once the fire has burned down to coals and the rocks are good and hot, throw green leaves and/or grass on top of the rocks. You can use dry grass, but you should soak it in water first.
The meat should be wrapped in a porous burlap sack, and then thrown directly on top of the grass and leaves. The sack keeps the leaves off the meat, but also allows steam and smoke to penetrate and get to the meat.
The purpose of the leaves and grass is to keep the meat from being in direct contact with the coals where it could scorch or burn. Also, you get the aromatic quality of the smoldering leaves that are in direct contact with the embers.
Once the meat is lying on the leaves, you put the lid on the barrel, and then cover the lid with dirt. Let it sit for 20 or so hours, then dig it up and eat it.
Making a barrel pit makes your pit far more re-usable and easier to maintain.
However, you can do this without the barrel. You simply dig a big hole, fill it with rocks or bricks and start a huge fire. Once the fire is down to embers, throw on your green leaves and grass, add the meat, then cover the whole pit with a couple of blankets, and then cover the whole thing up with dirt.