- Building packages at MongoDB
- Today's process:
- Adding a binary to the packages
- If it's a
env.Library()
orenv.Program()
call, likemongod
- If it's an external binary
- If it's a text file like a new LICENSE, config file, or man page
- If it needs to be in the tarball packages
- If it needs to be in the RPM packages
- If it needs to be in the Debian packages
- If it needs to be in the MSI package
- If it's a
- Adding a binary to the packages
- Generative Packaging Process:
- Today's process:
Additional consideration to all of these stages must be taken if the
file is enterprise only and will then require changes to packager
and packager_enterprise
scripts. Since today neither of those
scripts have access to the information SCons does and so have no
way to know what files should go where / should be packaged.
- Regardless of where the corresponding code exists in the source
tree the
env.Program
call must exist insrc/mongo/SConscript
- Normalize the file name based on Platform using about 42 lines of Python
- Call env.Install specifying exactly where the binary should end up
- Inside
src/mongo/SConscript
- Convert path to an
env.File
call - Call
env.Install
specifying exactly where the binary should end up
- Inside
src/mongo/SConscript
- Add it to the list of MODULEBANNERS via
env.Append(MODULE_BANNERS=['path/to/my/new/doc/file'])
- Add to global variable inside SConscript
distBinaries
- Verify there is a PostAction on posix systems to chmod the
binary such that it is executable. (only needed for non
env.Program/Library
calls like the tools orinstall_compass
) - Add a corresponding
--transform
flag specifying the transformation the binary must undergo to end up in the correct final installed location. - For example if you wanted to add
liboplog.so
to the tarball (ex. for a dynamic build) you would need to add:--transform $BUILD_DIR/mongo/db/repl=$SERVER_DIST_BASENAME/lib
- If the path of the source code (and therefore the output binary) changes you also make sure to keep this list of strings up to date with changes in any other SConscripts
- Follow the steps for adding to tarball packages, this package is dependent on the existence of the binaries in the tarball.
- Add the binary to the list of files installed under
%{_bindir}
in the spec file - Add any documentation or text files to the appropriate location in the spec file
- Repeat steps 2 and 3 for all TEN spec files
- Additionally, if generating a new package wire up dependencies manually in all ten spec files.
- Follow the steps for adding to tarball packages, this package is dependent on the existence of the binaries in the tarball.
- Add a
cp -v $(CURDIR)/path/to/my/file /debian/package-name/installed/location
command to the install section of the rules file - Add a corresponding rm command line to the clean section of the rules file.
- Repeat steps 2 and 3 for all FOUR rules files.
- Additionally, if generating a new package wire up dependencies manually in all four Debian control files.
- Add a Component tag in BinaryFragment.wxs
- Add an appropriate file tag to the Component tag specifying the complete path to your binary
- Make sure they have unique
Id
andGuid
fields - Set any other fields as required for WIX integration
- Create a Feature tag in FeatureFragment.wxs
- Create ComponentRef tags to point the feature to your Component's
- Wherever you have made the env.Program call add the keyword
argument
COMPONENT_TAG='mycomponent'
and the file will be packaged and installed into the correct packages with package dependency tracking.
- Call
env.AutoInstall
with thetarget='$INSTALL_DIR/bin
andsource=['pathtofile']
and the keyword argumentCOMPONENT_TAG='mycomponent'
and the file will be packaged and installed into the correct packages with package dependency tracking.
- Nothing further required.