As long as you have a few inches behind the speakers and a way for the bass to "get out" (ie space between the top of the speaker and the next shelf, or beside the speakers etc...) the rear porting shouldn't be an issue.

The big issue with putting bookshelf speakers on a real bookshelf is the "boxy" sound you can get, basically an emphasis at a frequency determined by the space between shelves, across the shelf, between back of speaker and back wall of shelves, etc. All of these frequencies are much higher than anything that comes out of the port, eg. 550 Hz if you have 12" between shelves. Sort of an "awww" resonance.

I always had good results with speakers on shelves myself. I put the speakers on high shelves so there wasn't much stuff piled around them, turned the speakers upside down to keep the tweeter close to ear level, and used shelves with open sides and back wherever possible. Also made sure that the front of the speaker was at least 1/2" in front of the shelf; more if I could get away with it.

If you put the speakers in a shelving arrangement that is essentially a box, they're probably gonna sound boxy


M60ti, VP180, QS8, M2ti, EP500, PC-Plus 20-39
M5HP, M40ti, Sierra-1
LFR1100 active, ADA1500-4 and -8