pkgbuild – building solaris packages using rpm …€¦ · pkgbuild – building solaris packages...
TRANSCRIPT
1
pkgbuild – building Solaris packages using RPM-like recipes
Damien Carbery, Laszlo (Laca) PeterDesktop teamSun Microsystems
1
2
Building SVr4 packages the old way
• Build the code any way you want> typical OSS package: ./configure; make; make install
• Write a pkginfo file:> package metainfo, like name, version, description
• Write a prototype file:> list of files and attributes
• Write a dependency file• Run pkgmk
3
Problems
• Lots of typing> boring> error prone
• Building a new version of the same package?> lots of typing again
• So tedious, people try to avoid packaging> binary tarballs> worse: “make install” (build from source)
4
Building package the RPM way
• Building and packaging in one step• Simple text based build recipe (spec file):> metainfo (name, version, description, etc.)> sources and code changes (patches)> build instructions (tiny shell scriptlets)> package contents (globs)
• Reproducible build
5
rpmbuild + Svr4 → pkgbuild
• Uses rpm-like spec files• rpmbuild CLI and messages• Builds the code just like rpmbuild• Produces SVr4 packages• Need a package?> write a spec file> run pkgbuild or pkgtool
6
rpmbuild + Svr4 → pkgbuild
• Uses rpm-like spec files• rpmbuild CLI and messages• Builds the code just like rpmbuild• Produces SVr4 packages• Need a package?> write a spec file> run pkgbuild or pkgtool
> DONE!
7
What's inside a spec file?
• Source code availability (URL)• Local code changes (unified or context diffs)• Build instructions• Lists of files to package up (globs)• Package scripts• Metainfo• Build-time and package dependencies• changelog
8
Differences from rpmbuild
• Solaris specific metainfo• Support for class action scripts• Volatile/editable files• Multilevel spec files> %include - like #include in C> %use - combine multiple modules into a package (and
reduce # of packages).
10
pkgbuild/pkgtool differences
• pkgtool copies source files and patches to SOURCES, and %use'd and %include'd files to SPECS. It doesn't copy the main spec file (the one specified on the command line).• pkgbuild does not copy any files – it expects the
files in SOURCES and SPECS.• pkgbuild does not create log file – displays output
on stdout.
11
Advantages of spec files
• all info in one place• simple human and machine readable format• lots of docs and expertise available• easy to rebuild individual packages• easy to upgrade to a new version
13
More Solaris spec files!
• JDS project• xfce project at opensolaris.org• spec-files-extra (a.k.a. SFE)> 200+ community contributed spec files> popular open source apps like emacs > spec files moved from SFE to JDS and vice versa
14
Does SFE compete with Blastwave?
• No, different target audience• SFE only targets Solaris Nevada (SX:CE/SX:DE)• Builds based on the latest Solaris and GNOME bits• No duplication of Solaris components• Blastwave provides a build machine for SFE
15
Would you like to help?
• Write a spec file for your favourite app• Build existing spec files• Report bugs• Update packages to the latest version available
16
More info
• http://pkgbuild.sf.net/• http://pkgbuild.sf.net/spec-files-extra• http://opensolaris.org/os/project/jds• http://opensolaris.org/os/project/xfce