layout: true name: inverse class: center, middle, inverse .footnote[ \#nycbug ### [@schmonz](https://twitter.com/schmonz) ] --- layout: true name: twitterhandle .footnote[ \#nycbug ### [@schmonz](https://twitter.com/schmonz) ] --- template: inverse # One Weird Trick To Simplify Package Management ## Amitai Schlair, The NetBSD Project ### New York City BSD User Group, 2014/03/05 --- layout: false template: twitterhandle .right-column[ ## We all use third-party software * install * configure * audit * update * uninstall * enhance or supersede system software ] --- .right-column[ ## Some patterns we know * development tools * operational tools * network services ] --- .right-column[ ## Package managers help us * port code to our platform * integrate into our system * provide consistent abstractions around arbitrary complexity * in other words, an API to managing software installations * automate more * think less * screw up less * try new things * _save time_ * _focus on what matters_ ] --- .right-column[ ## Package managers disappoint us * outdated versions * overly aggressively updated versions * outdated security-audit info * current audit info, but no fix * bad packaging decisions: * leaky package abstractions (rough edges poking through) * surprising differences vs. artisanal hand-installation * incomplete integration with the system * _don't save us as much time as we'd like_ ] --- .right-column[ ## Some software-management needs we have * manage installation of one piece of software * OR a whole bunch * manage installations for ourselves only * OR for everybody * manage one system * OR a whole bunch * manage from pre-built binaries * OR from source * manage a single platform * OR multiple OSes and architectures ] --- .right-column[ ## We're all BSD adherents here * don't just "solve" the immediate problem * zoom out and consider implications * solve whatever permitted the problem to crop up * solve a larger category that includes the problem ] --- .right-column[ ## We will always need software * how long do you plan to keep using computers? * it's worth optimizing your tools and habits * don't just accept what's expedient for today's problem * zoom out and consider how you'd solve related problems * what if your answer to "how do I manage third-party software" didn't depend on hardware, OS, level of access, or anything else? * what if you didn't have to think about it because you knew an answer that's always right? * (what if you could manage software installations in the same way on every computer you'll ever have?) * Linux, Solaris, OS X, *BSD, Windows... * i386, powerpc, arm... * 32- and 64-bit * ... * what if you could reclaim those cognitive resources for the rest of your life and spend them instead on things that matter to you? ] --- .right-column[ ## Cross-platform package managers * I bet there are some, and Wikipedia lists a few * I've pretty much only ever used `pkgsrc` ] --- .right-column[ ## Drawbacks of pkgsrc * hard to learn all the usage options in detail * hard to change internals (very complicated implementation, no tests) * hard to get involved (`send-pr`, CVS, etc.) * for maximum benefit, you must sometimes do hard things * (without that, only most of the benefit) * I have ideas about all these things (someday, more than ideas) ] --- .right-column[ ## Benefits of pkgsrc * immediately feels familiar to any BSD user * buildlink * wrappers * automatically makes software more portable * a good ] --- .right-column[ ## Example: where I use pkgsrc * my web/mail server (NetBSD VPS at Panix) * my home server (ReadyNAS NV+) * my home desktop (2006 Mac Pro, OS X 10.6) * my work desktop (RH-derived Linux, no root access) * a few consulting gigs ago (Windows) * on occasion, other people's computers (family, etc.) * binary packages better for me in this case * this laptop (2013 MacBook Air, OS X 10.9) ] --- .right-column[ ## Forsooth! A live demo * while you're watching, do this: * `cvs -danoncvs@anoncvs.netbsd.org:/cvsroot checkout pkgsrc` ] --- .right-column[ ## Your turn * `cd pkgsrc/bootstrap` * `./bootstrap --unprivileged` * `cd ../editors/ce && make install` ] --- .right-column[ ## One weird trick * Think big * Invest time to save time * Use `pkgsrc` * Help us make it even better ]