I recommend that you read Leviticus 25:44. This tells the ancient Israelites whom they may enslave and whom they may not (generally other Israelites) and for how long. This biblical passage was oft cited by southerners as a justification for slavery.
After reading the above Text, you may wish to read Exodus 21:20 and 21:21. This tells the ancient Israelites that they will be punished if they beat their slaves and slave girls to death. However, if those ancients were to beat their slaves or slave girls to death slowly over several days, they will suffer no punishment, because they are his property.
Very enlightened, wouldn't you say?
"Show me just what Mohammed brought that was new, and there you will find things only evil and inhuman, such as his command to spread by the sword the faith he preached." - Manuel II Palelologus
What I do know is that slavery was already an established institution in Israelite society when the Scriptures were being written, and if you follow the moral teachings, which were, I believe, gradually revealed, you will see over a span of time stronger and stronger teachings that incrementally limit or are in tension with slavery ("remember that you, too, were slaves in Egypt" "do not oppress the stranger or the foreigner..") up through, say, Philemon, where Paul tells Philemon to accept his runaway slave Onesimus back, not as a slave but as a dear brother.