# Generated by go2rpm 1.9.0 %bcond_without check %global debug_package %{nil} %global shortname unpoller # https://github.com/unpoller/unpoller %global goipath github.com/unpoller/unpoller Version: 2.11.2 %gometa -f %global common_description %{expand: Collect ALL UniFi Controller, Site, Device & Client Data - Export to InfluxDB or Prometheus.} %global golicenses LICENSE pkg/datadogunifi/LICENSE.datadogunifi\\\ pkg/influxunifi/LICENSE.influxunifi\\\ pkg/inputunifi/LICENSE.inputunifi\\\ pkg/lokiunifi/LICENSE.lokiunifi\\\ pkg/mysqlunifi/LICENSE.mysqlunifi\\\ pkg/poller/LICENSE.poller\\\ pkg/promunifi/LICENSE.promunifi\\\ pkg/webserver/LICENSE.webserver %global godocs CODE_OF_CONDUCT.md CONTRIBUTING.md examples/MANUAL.md\\\ README.md pkg/datadogunifi/README.datadogunifi.md\\\ pkg/influxunifi/README.influxunifi.md\\\ pkg/inputunifi/README.inputunifi.md\\\ pkg/lokiunifi/README.lokiunifi.md\\\ pkg/mysqlunifi/README.mysqlunifi.md\\\ pkg/poller/README.poller.md\\\ pkg/promunifi/README.promunifi.md\\\ pkg/webserver/README.webserver.md Name: %{goname} Release: %autorelease Summary: Collect ALL UniFi Controller, Site, Device & Client Data - Export to InfluxDB or Prometheus License: MIT URL: %{gourl} Source0: %{gosource} Source1: %{shortname}.service Source2: %{shortname}.sysusers BuildRequires: systemd-rpm-macros Requires(pre): shadow-utils %description %{common_description} %gopkg %prep %goprep for license in pkg/*/LICENSE; do pkgname=$(echo "$license" | cut -d/ -f2) mv "$license" "$license"."$pkgname" done for readme in pkg/*/README.md; do pkgname=$(echo "$readme" | cut -d/ -f2) mv "$readme" "$(dirname "$readme")"/README."$pkgname".md done %generate_buildrequires %go_generate_buildrequires %build %gobuild -o %{gobuilddir}/bin/unpoller %{goipath} %install %gopkginstall install -m 0755 -vd %{buildroot}%{_bindir} install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ install -Dpm 0644 examples/up.conf.example %{buildroot}%{_sysconfdir}/%{shortname}/up.conf install -Dpm 0644 %{S:1} %{buildroot}%{_unitdir}/%{shortname}.service install -Dpm 0644 %{S:2} %{buildroot}%{_sysusersdir}/%{shortname}.conf %if %{with check} %check %gocheck %endif %pre %sysusers_create_compat %{S:2} %post %systemd_post %{shortname}.service %preun %systemd_preun %{shortname}.service %postun %systemd_postun_with_restart %{shortname}.service %files %config(noreplace) %{_sysconfdir}/%{shortname}/up.conf %doc CODE_OF_CONDUCT.md CONTRIBUTING.md examples/MANUAL.md README.md %doc pkg/datadogunifi/README.datadogunifi.md %doc pkg/influxunifi/README.influxunifi.md pkg/inputunifi/README.inputunifi.md %doc pkg/lokiunifi/README.lokiunifi.md pkg/mysqlunifi/README.mysqlunifi.md %doc pkg/poller/README.poller.md pkg/promunifi/README.promunifi.md %doc pkg/webserver/README.webserver.md %license LICENSE pkg/datadogunifi/LICENSE.datadogunifi %license pkg/influxunifi/LICENSE.influxunifi pkg/inputunifi/LICENSE.inputunifi %license pkg/lokiunifi/LICENSE.lokiunifi pkg/mysqlunifi/LICENSE.mysqlunifi %license pkg/poller/LICENSE.poller pkg/promunifi/LICENSE.promunifi %license pkg/webserver/LICENSE.webserver %{_bindir}/* %{_sysusersdir}/%{shortname}.conf %{_unitdir}/%{shortname}.service %gopkgfiles %changelog %autochangelog