Regarding a Shul:
1. If the Seforim on the shelves have become disordered and out of place during the week – can one re-sort them on Shabos so that they are all in their correct places.
2. If Seforim are lying scattered around the Shul – can one return them to their correct place on Shabנos
1. Seforim may not be sorted and ordered on Shabbos. According to many poskim, the essential prohibition of borer is a prohibition of sorting, and the condition of “waste from food” is only intended to reveal that the act is an act of sorting and not an act of eating. Therefore, seforim should not be sorted on Shabbos. See Tosafos, Shabbos 74a; Biur Halachah 319:3; Shulchan Shlomo 319:4.
2. If Seforim are lying around the shul, it is permitted to place them in their correct place. This is not an act of sorting, but rather an act of tidying up, and the fact that the seforim are placed in their correct place does not transform the act into an act of sorting.