Skip to content

Package mongosync_insights as offline RPM#181

Open
dsdlt wants to merge 3 commits intomasterfrom
dsanchez/rpm-packaging
Open

Package mongosync_insights as offline RPM#181
dsdlt wants to merge 3 commits intomasterfrom
dsanchez/rpm-packaging

Conversation

@dsdlt
Copy link
Collaborator

@dsdlt dsdlt commented Mar 24, 2026

Summary

  • remove python-magic / libmagic dependency
  • add pure-Python file type detection
  • add PyInstaller + RPM packaging flow for air-gapped customers
  • add systemd service and packaging docs
  • disable RPM .build-id generation to avoid conflicts with RHEL system packages

Testing

  • built RPM on RHEL 9
  • validated/fixed .build-id install conflicts
  • ready for review

dsdlt added 3 commits March 24, 2026 13:32
- Replace python-magic (libmagic) with pure-Python magic-byte MIME detection
  so no system library (libmagic1 / file-libs) is needed
- Add text/plain and application/json to ALLOWED_MIME_TYPES (fixes
  uncompressed .log/.json file validation)
- Patch Flask app to resolve templates/images via sys._MEIPASS when running
  as a PyInstaller bundle
- Add PyInstaller spec file (mongosync_insights.spec) for one-dir builds
- Add build_rpm.sh script: creates venv, runs PyInstaller, packages as RPM
  via fpm — output is a single .rpm with embedded Python and all deps
- Add systemd service file with env-file support (/etc/mongosync-insights/env)
- Add PACKAGING.md with build, install, configure, and run instructions
- Update README.md: remove libmagic install steps, add RPM install option
- Remove python-magic from requirements.txt
…m packages

PyInstaller bundles system .so files (libz, libssl, libncurses, etc.) whose
.build-id symlinks conflict with RHEL packages like zlib, openssl-libs, and
ncurses-libs. Remove .build-id directories from the staging area and add
--exclude '**/.build-id' to the fpm invocation.
The previous find+exclude approach was insufficient — rpmbuild itself
auto-generates .build-id symlinks for every ELF binary it encounters.
Add --rpm-rpmbuild-define '_build_id_links none' to tell rpmbuild to
skip .build-id generation entirely, preventing conflicts with system
packages like zlib, openssl-libs, ncurses-libs, etc.
@dsdlt dsdlt requested a review from BigMarcio March 24, 2026 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant