Skip to content

pkg: package complete contrib dir in new separate package #2614

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Please refer to the [NEWS](NEWS.md) for a list of changes which have an affect o

### Packaging
- Replace `/opt/intelmq` example paths in bots with variable `VAR_STATE_PATH` for correct paths in LSB-path setups like with packages (PR#2587 by Sebastian Wagner).
- New deb-package `intelmq-contrib` with all `contrib/` scripts and documentation (PR#2614 by Sebastian Wagner).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see the documentation in the packaged files 🤔 man pages generated from mkdocs would be something cool

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see the documentation in the packaged files 🤔

all contents of contrib/ are part of the package in the same structure, including their READMEs.


### Tests
- `intelmq.tests.lib.test_pipeline.TestAmqp.test_acknowledge`: Skip on all Python versions when running on CI (PR#2602 by Sebastian Wagner).
Expand Down
18 changes: 18 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Depends: bash-completion,
${misc:Depends},
${sphinxdoc:Depends},
${python3:Depends}
Recommends: intelmq-contrib
Suggests: python3-geoip2 (>= 2.2.0),
python3-imbox (>= 0.8),
python3-psycopg2 (>= 2.5.5),
Expand All @@ -73,3 +74,20 @@ Description: Solution for IT security teams for collecting and processing securi
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Package: intelmq-contrib
Architecture: all
Depends: intelmq,
${misc:Depends},
${python3:Depends}
Suggests:
Description: Contributed scripts for IntelMQ
Extensions, scripts, additional programs and examples
.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
9 changes: 9 additions & 0 deletions debian/intelmq-contrib.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
contrib/eventdb/ /usr/share/intelmq/contrib/
contrib/example-extension-package/ /usr/share/intelmq/contrib/
contrib/feeds-config-generator/ /usr/share/intelmq/contrib/
contrib/logcheck/ /usr/share/intelmq/contrib/
contrib/logrotate/ /usr/share/intelmq/contrib/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before approval, could you please clarify two things to me?

The two contrib directories: logrotate and malware_name_mapping looks to me like something that eventually should be included in the main package, shouldn't it? I thought those two things should be installed by defaults (or maybe there are separated files?). For the rest, I have no doubts (tbh, I could even just skip packaging them at all)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The two contrib directories: logrotate and malware_name_mapping looks to me like something that eventually should be included in the main package, shouldn't it? I thought those two things should be installed by defaults (or maybe there are separated files?).

Regarding logrotate:
Maybe it's more complex. If the administrator chooses not to use logrotate, but systemd logging?
The logrotate rules had a semi-official status. Although they are in contrib (unofficial stuff), we used them in the packages (basically "official").
This PR actually doesn't remove the logrotate config from the main package. It is only added additionally to the contrib package, duplicating the content. I removed that line.
See also #1772

Regarding the malware name mapping scripts:
The maintenance and future of these scripts and the mapping itself are unclear, so I would have my concerns if we included them in the main package.
Follow-up question: Where do we draw the line between the main package and contributed stuff, without bloating the main package with small (potentially broken) scripts?

For the rest, I have no doubts (tbh, I could even just skip packaging them at all)

The rest is not of importance to me either, but it was cheap to add them as well.

contrib/malware_name_mapping/ /usr/share/intelmq/contrib/
contrib/prettyprint/ /usr/share/intelmq/contrib/
contrib/systemd/ /usr/share/intelmq/contrib/
contrib/tmpfiles.d/ /usr/share/intelmq/contrib/
10 changes: 5 additions & 5 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ build:
# These tests frequently fail on Ubuntu and Debian systems.
# On some systems this command will be executed twice, so -f
rm -rf intelmq/tests/bots/collectors/tcp/
# remove program not needed for packages
rm -f intelmq/bin/intelmqsetup

override_dh_auto_build:
dh_auto_build
Expand All @@ -49,16 +51,14 @@ override_dh_auto_install: $(BOTDOCS)
mkdir -p $(DOCS_DIR)/bots/$$(dirname $$readme); \
cp intelmq/bots/$$readme $(DOCS_DIR)/bots/$$(dirname $$readme); \
done
# remove program not needed for packages
rm debian/intelmq/usr/bin/intelmqsetup
# create directory layout and empty state file
ROOT_DIR=debian/intelmq/ PYTHONPATH=. python3 intelmq/bin/intelmqsetup.py --skip-ownership --state-file debian/intelmq/var/lib/intelmq/state.json --skip-api --skip-manager

override_dh_install:
dh_install
install -Dm 644 contrib/logcheck/ignore debian/intelmq/etc/logcheck/ignore.d.server/intelmq
install -Dm 644 contrib/logcheck/violations debian/intelmq/etc/logcheck/violations.d/intelmq
install -Dm 644 contrib/logcheck/logcheck.logfiles debian/intelmq/etc/logcheck/logcheck.logfiles.d/intelmq
install -Dm 644 contrib/logcheck/ignore debian/intelmq-contrib/etc/logcheck/ignore.d.server/intelmq
install -Dm 644 contrib/logcheck/violations debian/intelmq-contrib/etc/logcheck/violations.d/intelmq
install -Dm 644 contrib/logcheck/logcheck.logfiles debian/intelmq-contrib/etc/logcheck/logcheck.logfiles.d/intelmq

override_dh_systemd_start:
dh_systemd_start --restart-after-upgrade
Loading