Wild boar were certainly a main prey species for lions in the Atlas Mountains, but also red deer (Barbary deer) and barbary sheep, plus oryx, addax and small gazelles(Cuvier’s gazelle, Dorcas gazelle, Dama gazelle).
As human inhabitants became more numerous the temptation for predating livestock grew. Lions were a threat to the mixed flocks (sheep and goats) which were kept in mountainous areas by pastoralists. Flocks would not be left overnight near wooded areas or places known to be inhabited by predators, and would be moved closer to villages or to open ground at least.
Flocks up in the higher ground that would stay out but if the herder was wary they would put up rough stockades of thorn bushes as protection from leopards, jackals and hyenas. This appears likely because the same type of temporary construction was used by local guides taking people travelling through the mountains if the had to stay overnight in a remote areas in the 1800s and early 1900s.
Cattle were also vulnerable and many accounts mention their demise at the jaws of lions. Additionally on the domestic front were pack animals, the camels and mules used by travellers and pastoralists.
It would not be unusual for a rough stone shed or shelter to be made near regular pastures (especially in cattle pastures) for farmers to stay in overnight – more common in lowlands hills though. If a flock had been attacked previously, the farmer would stay in the hope the visiting predator would venture in again and could be shot. There are certainly accounts of this ‘stake out’ approach in Tunisia and Algeria in the 1800s.
Black, SA (2016) The Challenges and Relevance of Exploring the Genetics of North Africa’s “Barbary Lion” and the Conservation of Putative Descendants in Captivity. International Journal of Evolutionary Biology vol 2-16, Article ID 6901892 9 pages https://doi.org/10.1155/2016/6901892.
Examining the extinction of the Barbary lion and its implications for felid conservation. PLoS ONE 8(4):e60174
Yamaguchi, N. and B. Haddane, B. (2002) “The North African Barbary lion and the Atlas lion project,” in International Zoo News, vol. 49, pp. 465–481, 2002