Packaging sounds most correct to me. The most important defining property of a software library is that it's a self-contained, well, package.
Software libraries and the constructs used to organise and distribute them are often termed "packages": Here's Java's, Python's and Perl's. Even languages that don't have them as an explicit language feature speak of "implementing packages" as in Lua.
All of a guide on "How to Package Your Python Code", a "Lua Packaging Guide" and various questions on StackOverflow tagged "packaging"various questions on StackOverflow tagged "packaging" use the word to mean putting code into a form useable by others.