-
Notifications
You must be signed in to change notification settings - Fork 63
Add rpkg spec file for epel 7/8 #153
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
v1k-t0r
wants to merge
4
commits into
zabbix-tools:master
Choose a base branch
from
v1k-t0r:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,3 +43,4 @@ src/**/Makefile | |
| stamp-h1 | ||
| zabbix-*/ | ||
| zabbix_agent_bench | ||
| .idea/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| %define main_version 4.0 | ||
| %define minor_version 12 | ||
| %define module_dir src/modules | ||
|
|
||
| Name: {{{ git_dir_name }}} | ||
| Version: {{{ git_tag_last }}} | ||
| Release: {{{ git_commits_since_last_tag_add1 }}}%{?dist} | ||
| Summary: PostgreSQL monitoring module for Zabbix | ||
|
|
||
| Group: Applications/Internet | ||
| License: GPLv2 | ||
| URL: https://github.com/cavaliercoder/libzbxpgsql | ||
| VCS: {{{ git_dir_vcs }}} | ||
|
|
||
| Source: {{{ git_dir_pack }}} | ||
|
|
||
| Requires: zabbix-agent >= 4.0.0, zabbix-agent < 4.1.0 | ||
| # minimum libpq version based on latest patch of RHEL 5 | ||
| Requires : postgresql-libs >= 8.1.23 | ||
|
|
||
| BuildRequires: systemd, gcc, libtool, libconfig-devel, postgresql-devel | ||
| Requires(post): systemd | ||
| Requires(preun): systemd | ||
|
|
||
| %description | ||
| libzbxpgsql is a comprehensive PostgreSQL discovery and monitoring module for the Zabbix monitoring agent written in C. | ||
|
|
||
| %global debug_package %{nil} | ||
|
|
||
| %prep | ||
| {{{ git_dir_setup_macro }}} | ||
| curl -o /tmp/zbx.rpm https://repo.zabbix.com/zabbix/%{main_version}/rhel/%{?rhel}/SRPMS/zabbix-%{main_version}.%{minor_version}-1.el%{?rhel}.src.rpm | ||
| rpm -i /tmp/zbx.rpm | ||
| %setup -qTcn zabbix-%{main_version}.%{minor_version} | ||
| tar --strip-components=1 -xf %{_topdir}/SOURCES/zabbix-%{main_version}.%{minor_version}.tar.gz | ||
| echo 'LoadModule=%{name}.so' > %{_topdir}/SOURCES/%{name}.conf | ||
| cp -r %{_topdir}/BUILD/%{name}- %{_topdir}/BUILD/zabbix-%{main_version}.%{minor_version}/src/modules | ||
|
|
||
| %build | ||
| ./configure | ||
| cd src/modules/%{name}- | ||
| ./autogen.sh | ||
| %configure --with-zabbix=%{_topdir}/BUILD/zabbix-%{main_version}.%{minor_version} | ||
| make | ||
|
|
||
| %install | ||
| install --directory %{buildroot}%{_libdir}/zabbix/modules/ | ||
| install --directory %{buildroot}/etc/zabbix/zabbix_agentd.d/ | ||
|
|
||
| install -m 0755 %{_topdir}/BUILD/zabbix-%{main_version}.%{minor_version}/%{module_dir}/%{name}-/src/.libs/%{name}.so %{buildroot}%{_libdir}/zabbix/modules/ | ||
| install -m 0644 %{_topdir}/BUILD/zabbix-%{main_version}.%{minor_version}/src/modules/%{name}-/conf/%{name}.conf %{buildroot}/etc/zabbix/ | ||
| install -m 0644 %{_topdir}/SOURCES/%{name}.conf %{buildroot}/etc/zabbix/zabbix_agentd.d/ | ||
|
|
||
| %clean | ||
| rm -rf %{buildroot} | ||
|
|
||
| %files | ||
| /%{_libdir}/zabbix/modules/ | ||
| /etc/zabbix/%{name}.conf | ||
| /etc/zabbix/zabbix_agentd.d/%{name}.conf | ||
|
|
||
| %post | ||
| /usr/bin/systemctl try-restart zabbix-agent.service >/dev/null 2>&1 || : | ||
|
|
||
| %postun | ||
| /usr/bin/systemctl try-restart zabbix-agent.service >/dev/null 2>&1 || : | ||
|
|
||
| %changelog | ||
| {{{ git_changelog }}} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| function git_commits_no { | ||
| total_commits="$(git rev-list --all --count)" | ||
| echo -n "$total_commits" | ||
| } | ||
|
|
||
| function git_tag_last { | ||
| tag_last="$(git describe --abbrev=0 | tr -d v)" | ||
| echo -n "$tag_last" | ||
| } | ||
|
|
||
| function git_commits_since_last_tag_add1 { | ||
| commits_since_since_last_tag="$(expr $(git rev-list `git rev-list --tags --no-walk --max-count=1`..HEAD --count) \+ \1)" | ||
| echo -n $commits_since_since_last_tag | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to run
./configurein the root of Zabbix sources to be safe and avoid issues like #145.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated