https://bugzilla.redhat.com/show_bug.cgi?id=1818670 Robert-André Mauchin <zebob.m@xxxxxxxxx> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED CC| |zebob.m@xxxxxxxxx Assignee|nobody@xxxxxxxxxxxxxxxxx |zebob.m@xxxxxxxxx Flags| |fedora-review? --- Comment #7 from Robert-André Mauchin <zebob.m@xxxxxxxxx> --- Most of these are already packaged, the work to be done would be low. Anyhow EPEL would need to be vendored as we don't have macros available there. A few remarks: - You need a logrotate file for your log - Don't use /opt for the home of the Sensu user, but %{_sharedstatedir}/sensu: %pre backend getent group sensu >/dev/null || groupadd -r sensu getent passwd sensu >/dev/null || \ useradd -r -g sensu -d %{_sharedstatedir}/sensu -s /sbin/nologin \ -c "Sensu User" sensu exit 0 %pre agent getent group sensu >/dev/null || groupadd -r sensu getent passwd sensu >/dev/null || \ useradd -r -g sensu -d %{_sharedstatedir}/sensu -s /sbin/nologin \ -c "Sensu User" sensu exit 0 - You should use macros for the various directories used in the SPEC: %install install -m 0755 -vd %{buildroot}%{_sbindir} install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_sbindir}/ install -m 0755 -vd %{buildroot}%{_tmpfilesdir} install -m 0755 -vd %{buildroot}%{_unitdir} install -m 0755 -vd %{buildroot}%{_sysconfdir}/sensu install -m 0755 -vd %{buildroot}%{_sharedstatedir}/sensu install -m 0755 -vd %{buildroot}%{_localstatedir}/cache/sensu install -m 0755 -vd %{buildroot}%{_localstatedir}/log/sensu install -m 0755 -vd %{buildroot}%{_rundir}/sensu install -m 0755 -vd %{buildroot}%{_sysconfdir}/logrotate.d install -pm 0644 %{SOURCE2} %{buildroot}%{_unitdir}/sensu-backend.service install -pm 0640 %{SOURCE4} %{buildroot}%{_sysconfdir}/sensu/backend.yml install -pm 0644 %{SOURCE3} %{buildroot}%{_unitdir}/sensu-agent.service install -pm 0640 %{SOURCE5} %{buildroot}%{_sysconfdir}/sensu/agent.yml install -pm 0644 %{SOURCE6} %{buildroot}%{_tmpfilesdir}/%{name}.conf install -pm 0644 %{SOURCE7} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}.conf Here are SPEC to use bundled dependencies: First for Fedora: https://koji.fedoraproject.org/koji/taskinfo?taskID=46060718 ===================================================================================================== # Generated by go2rpm 1 %bcond_without check %bcond_without vendor # https://github.com/sensu/sensu-go %global goipath github.com/sensu/sensu-go Version: 5.21.0 %gometa %global common_description %{expand: Sensu is an open source monitoring tool for ephemeral infrastructure and distributed applications. It is an agent based monitoring system with built-in auto-discovery, making it very well-suited for cloud environments. Sensu uses service checks to monitor service health and collect telemetry data. It also has a number of well defined APIs for configuration, external data input, and to provide access to Sensu's data. Sensu is extremely extensible and is commonly referred to as "the monitoring router".} %global golicenses LICENSE %global godocs CHANGELOG.md CODE_OF_CONDUCT.md CONTRIBUTING.md\\\ FAQ.md README.md Name: sensu-go Release: 3%{?dist} Summary: Simple, Scalable, Multi-cloud monitoring License: MIT URL: %{gourl} Source0: %{gosource} # git clone https://github.com/sensu/sensu-go # cd sensu-go # git checkout v%%{version} # go mod vendor # tar czvf vendor-%%{version}.tar.gz vendor/ Source1: vendor-%{version}.tar.gz Source2: sensu-backend.service Source3: sensu-agent.service Source4: backend.yml Source5: agent.yml Source6: %{name}-tmpfiles.conf Source7: %{name}-logrotate.conf BuildRequires: systemd-rpm-macros Requires: logrotate Requires(pre): shadow-utils %if %{without vendor} BuildRequires: golang(github.com/AlecAivazis/survey) BuildRequires: golang(github.com/atlassian/gostatsd) BuildRequires: golang(github.com/atlassian/gostatsd/pkg/statsd) BuildRequires: golang(github.com/coreos/etcd/clientv3) BuildRequires: golang(github.com/coreos/etcd/clientv3/concurrency) BuildRequires: golang(github.com/coreos/etcd/embed) BuildRequires: golang(github.com/coreos/etcd/etcdserver/api/v3client) BuildRequires: golang(github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes) BuildRequires: golang(github.com/coreos/etcd/etcdserver/etcdserverpb) BuildRequires: golang(github.com/coreos/etcd/mvcc/mvccpb) BuildRequires: golang(github.com/coreos/etcd/pkg/transport) BuildRequires: golang(github.com/coreos/etcd/pkg/types) BuildRequires: golang(github.com/coreos/etcd/store) BuildRequires: golang(github.com/coreos/etcd/version) BuildRequires: golang(github.com/coreos/pkg/capnslog) BuildRequires: golang(github.com/dave/jennifer/jen) BuildRequires: golang(github.com/dgrijalva/jwt-go) BuildRequires: golang(github.com/docker/docker/pkg/term) BuildRequires: golang(github.com/echlebek/timeproxy) BuildRequires: golang(github.com/emicklei/proto) BuildRequires: golang(github.com/ghodss/yaml) BuildRequires: golang(github.com/go-resty/resty/v2) BuildRequires: golang(github.com/gogo/protobuf/gogoproto) BuildRequires: golang(github.com/gogo/protobuf/proto) BuildRequires: golang(github.com/golang/protobuf/proto) BuildRequires: golang(github.com/golang/snappy) BuildRequires: golang(github.com/google/uuid) BuildRequires: golang(github.com/gorilla/mux) BuildRequires: golang(github.com/gorilla/websocket) BuildRequires: golang(github.com/graph-gophers/dataloader) BuildRequires: golang(github.com/graphql-go/graphql) BuildRequires: golang(github.com/graphql-go/graphql/gqlerrors) BuildRequires: golang(github.com/graphql-go/graphql/language/ast) BuildRequires: golang(github.com/graphql-go/graphql/language/location) BuildRequires: golang(github.com/graphql-go/graphql/language/parser) BuildRequires: golang(github.com/graphql-go/graphql/language/source) BuildRequires: golang(github.com/hashicorp/go-version) BuildRequires: golang(github.com/json-iterator/go) BuildRequires: golang(github.com/mgutz/ansi) BuildRequires: golang(github.com/mholt/archiver/v3) BuildRequires: golang(github.com/mitchellh/go-homedir) BuildRequires: golang(github.com/mitchellh/mapstructure) BuildRequires: golang(github.com/NYTimes/gziphandler) BuildRequires: golang(github.com/olekukonko/tablewriter) BuildRequires: golang(github.com/prometheus/client_golang/prometheus) BuildRequires: golang(github.com/prometheus/client_golang/prometheus/promhttp) BuildRequires: golang(github.com/prometheus/client_model/go) BuildRequires: golang(github.com/robertkrimen/otto) BuildRequires: golang(github.com/robertkrimen/otto/parser) BuildRequires: golang(github.com/robfig/cron/v3) BuildRequires: golang(github.com/sensu/lasr) BuildRequires: golang(github.com/shirou/gopsutil/host) BuildRequires: golang(github.com/shirou/gopsutil/net) BuildRequires: golang(github.com/sirupsen/logrus) BuildRequires: golang(github.com/spf13/cobra) BuildRequires: golang(github.com/spf13/pflag) BuildRequires: golang(github.com/spf13/viper) BuildRequires: golang(github.com/stretchr/testify/mock) BuildRequires: golang(github.com/stretchr/testify/require) BuildRequires: golang(github.com/willf/pad/utf8) BuildRequires: golang(go.etcd.io/bbolt) BuildRequires: golang(golang.org/x/crypto/bcrypt) BuildRequires: golang(golang.org/x/net/context) BuildRequires: golang(golang.org/x/time/rate) BuildRequires: golang(google.golang.org/grpc) BuildRequires: golang(google.golang.org/grpc/grpclog) BuildRequires: golang(gopkg.in/h2non/filetype.v1) BuildRequires: golang(gopkg.in/h2non/filetype.v1/types) BuildRequires: golang(gopkg.in/yaml.v2) %if %{with check} # Tests BuildRequires: golang(github.com/coreos/etcd/integration) BuildRequires: golang(github.com/echlebek/crock) BuildRequires: golang(github.com/gogo/protobuf/jsonpb) BuildRequires: golang(github.com/graphql-go/graphql/testutil) BuildRequires: golang(github.com/prometheus/client_golang/prometheus/testutil) BuildRequires: golang(github.com/stretchr/testify/assert) %endif %endif %description %{common_description} %package backend Summary: Sensu Go Backend Service %description backend The Sensu backend is a service that manages check requests and event data. Every Sensu backend includes an integrated transport for scheduling checks using subscriptions, an event processing pipeline that applies filters, mutators, and handlers, an embedded etcd datastore for storing configuration and state, a Sensu API, a Sensu dashboard, and the sensu-backend command line tool. %package agent Summary: Sensu Go Agent Service %description agent The Sensu agent is a lightweight client that runs on the infrastructure components you want to monitor. Agents register with the Sensu backend as monitoring entities with type: "agent". Agent entities are responsible for creating check and metrics events to send to the backend event pipeline. %package cli Summary: Sensu Go CLI %description cli The Sensu GO (sensuctl) command line utility to interact with Sensu Go Backend. %prep %goprep %{?with_vendor: -k} %if %{with vendor} %setup -q -T -D -a 1 -n %{extractdir} %endif %build export LDFLAGS="-X \"github.com/sensu/sensu-go/version.Version=%{version}+oss_fc%fedora\" \ -X \"github.com/sensu/sensu-go/version.BuildDate=`date +%Y-%m-%d`\"" for cmd in cmd/* ; do %gobuild -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd done rm -f %{gobuilddir}/bin/loadit %install install -m 0755 -vd %{buildroot}%{_sbindir} install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_sbindir}/ install -m 0755 -vd %{buildroot}%{_tmpfilesdir} install -m 0755 -vd %{buildroot}%{_unitdir} install -m 0755 -vd %{buildroot}%{_sysconfdir}/sensu install -m 0755 -vd %{buildroot}%{_sharedstatedir}/sensu install -m 0755 -vd %{buildroot}%{_localstatedir}/cache/sensu install -m 0755 -vd %{buildroot}%{_localstatedir}/log/sensu install -m 0755 -vd %{buildroot}%{_rundir}/sensu install -m 0755 -vd %{buildroot}%{_sysconfdir}/logrotate.d install -pm 0644 %{SOURCE2} %{buildroot}%{_unitdir}/sensu-backend.service install -pm 0640 %{SOURCE4} %{buildroot}%{_sysconfdir}/sensu/backend.yml install -pm 0644 %{SOURCE3} %{buildroot}%{_unitdir}/sensu-agent.service install -pm 0640 %{SOURCE5} %{buildroot}%{_sysconfdir}/sensu/agent.yml install -pm 0644 %{SOURCE6} %{buildroot}%{_tmpfilesdir}/%{name}.conf install -pm 0644 %{SOURCE7} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}.conf %if %{with check} %check %gocheck -t api/core/v2 %endif %pre backend getent group sensu >/dev/null || groupadd -r sensu getent passwd sensu >/dev/null || \ useradd -r -g sensu -d %{_sharedstatedir}/sensu -s /sbin/nologin \ -c "Sensu User" sensu exit 0 %pre agent getent group sensu >/dev/null || groupadd -r sensu getent passwd sensu >/dev/null || \ useradd -r -g sensu -d %{_sharedstatedir}/sensu -s /sbin/nologin \ -c "Sensu User" sensu exit 0 %post backend %systemd_post sensu-backend.service %post agent %systemd_post sensu-agent.service %preun backend %systemd_preun sensu-backend.service %preun agent %systemd_preun sensu-agent.service %postun backend %systemd_postun sensu-backend.service %postun agent %systemd_postun sensu-agent.service %files cli %license LICENSE %doc CHANGELOG.md CODE_OF_CONDUCT.md CONTRIBUTING.md FAQ.md README.md %{_sbindir}/sensuctl %files backend %license LICENSE %attr(-,sensu,sensu) %dir %{_sharedstatedir}/sensu/ %attr(755, sensu, sensu) %dir %{_sysconfdir}/sensu/ %attr(755, sensu, sensu) %dir %{_localstatedir}/cache/sensu/ %attr(755, sensu, sensu) %dir %{_localstatedir}/log/sensu/ %ghost %attr(755, sensu, sensu) %{_rundir}/sensu/ %config(noreplace) %attr(644, sensu, sensu) %{_sysconfdir}/sensu/backend.yml %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}.conf %{_unitdir}/sensu-backend.service %{_sbindir}/sensu-backend %{_tmpfilesdir}/%{name}.conf %exclude %{_sysconfdir}/sensu/agent.yml %files agent %license LICENSE %attr(-,sensu,sensu) %dir /var/lib/sensu/ %attr(755, sensu, sensu) %dir %{_sysconfdir}/sensu/ %attr(755, sensu, sensu) %dir %{_localstatedir}/cache/sensu/ %attr(755, sensu, sensu) %dir %{_localstatedir}/log/sensu/ %ghost %attr(755, sensu, sensu) %{_rundir}/sensu/ %config(noreplace) %attr(644, sensu, sensu) %{_sysconfdir}/sensu/agent.yml %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}.conf %{_unitdir}/sensu-agent.service %{_sbindir}/sensu-agent %{_tmpfilesdir}/%{name}.conf %exclude %{_sysconfdir}/sensu/backend.yml %changelog * Wed Apr 01 2020 Devin Acosta <devin@linuxstack.cloud> - 5.21.0-3 - Fixed Configs being overwritten, added +oss_el7|8 to version * Sun Mar 29 2020 Devin Acosta <devin@linuxstack.cloud> - 5.21.0-2 - Added SPEC to create sensu-go-backend/sensu-go-agent RPMS * Sun Mar 29 2020 Devin Acosta <devin@linuxstack.cloud> - 5.21.0-1 - Initial package ===================================================================================================== For EPEL7: https://koji.fedoraproject.org/koji/taskinfo?taskID=46060716 EPEL8: https://koji.fedoraproject.org/koji/taskinfo?taskID=46060714 ===================================================================================================== %define gobuild(o:) %{expand: # https://bugzilla.redhat.com/show_bug.cgi?id=995136#c12 %global _dwz_low_mem_die_limit 0 %ifnarch ppc64 go build -buildmode pie -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-}%{?currentgoldflags} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags %{?__golang_extldflags}' -compressdwarf=false" -a -v -x %{?**}; %else go build -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-}%{?currentgoldflags} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags %{?__golang_extldflags}' -compressdwarf=false" -a -v -x %{?**}; %endif } # https://github.com/sensu/sensu-go %global goipath github.com/sensu/sensu-go Version: 5.21.0 %global common_description %{expand: Sensu is an open source monitoring tool for ephemeral infrastructure and distributed applications. It is an agent based monitoring system with built-in auto-discovery, making it very well-suited for cloud environments. Sensu uses service checks to monitor service health and collect telemetry data. It also has a number of well defined APIs for configuration, external data input, and to provide access to Sensu's data. Sensu is extremely extensible and is commonly referred to as "the monitoring router".} %global golicenses LICENSE %global godocs CHANGELOG.md CODE_OF_CONDUCT.md CONTRIBUTING.md\\\ FAQ.md README.md Name: sensu-go Release: 3%{?dist} Summary: Simple, Scalable, Multi-cloud monitoring License: MIT URL: https://github.com/sensu/sensu-go Source0: https://github.com/sensu/sensu-go/archive/v%{version}/%{name}-%{version}.tar.gz # git clone https://github.com/sensu/sensu-go # cd sensu-go # git checkout v%%{version} # go mod vendor # tar czvf vendor-%%{version}.tar.gz vendor/ Source1: vendor-%{version}.tar.gz Source2: sensu-backend.service Source3: sensu-agent.service Source4: backend.yml Source5: agent.yml Source6: %{name}-tmpfiles.conf Source7: %{name}-logrotate.conf # e.g. el6 has ppc64 arch without gcc-go, so EA tag is required ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 aarch64 %{arm}} # If go_compiler is not set to 1, there is no virtual provide. Use golang instead. BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang} %if 0%{?el7} BuildRequires: systemd %else BuildRequires: systemd-rpm-macros %endif Requires: logrotate Requires(pre): shadow-utils %description %{common_description} %package backend Summary: Sensu Go Backend Service %description backend The Sensu backend is a service that manages check requests and event data. Every Sensu backend includes an integrated transport for scheduling checks using subscriptions, an event processing pipeline that applies filters, mutators, and handlers, an embedded etcd datastore for storing configuration and state, a Sensu API, a Sensu dashboard, and the sensu-backend command line tool. %package agent Summary: Sensu Go Agent Service %description agent The Sensu agent is a lightweight client that runs on the infrastructure components you want to monitor. Agents register with the Sensu backend as monitoring entities with type: "agent". Agent entities are responsible for creating check and metrics events to send to the backend event pipeline. %package cli Summary: Sensu Go CLI %description cli The Sensu GO (sensuctl) command line utility to interact with Sensu Go Backend. %prep %autosetup -p1 -n %{name}-%{version} %setup -q -T -D -a 1 -n %{name}-%{version} %build export GO111MODULE=on export GOFLAGS=-mod=vendor export LDFLAGS="-X \"github.com/sensu/sensu-go/version.Version=%{version}+oss_el%{epel}\" \ -X \"github.com/sensu/sensu-go/version.BuildDate=`date +%Y-%m-%d`\"" for cmd in cmd/* ; do %gobuild -o _bin/$(basename $cmd) ./$cmd done rm -f _bin/loadit %install install -m 0755 -vd %{buildroot}%{_sbindir} install -m 0755 -vp _bin/* %{buildroot}%{_sbindir}/ install -m 0755 -vd %{buildroot}%{_tmpfilesdir} install -m 0755 -vd %{buildroot}%{_unitdir} install -m 0755 -vd %{buildroot}%{_sysconfdir}/sensu install -m 0755 -vd %{buildroot}%{_sharedstatedir}/sensu install -m 0755 -vd %{buildroot}%{_localstatedir}/cache/sensu install -m 0755 -vd %{buildroot}%{_localstatedir}/log/sensu install -m 0755 -vd %{buildroot}%{_rundir}/sensu install -m 0755 -vd %{buildroot}%{_sysconfdir}/logrotate.d install -pm 0644 %{SOURCE2} %{buildroot}%{_unitdir}/sensu-backend.service install -pm 0640 %{SOURCE4} %{buildroot}%{_sysconfdir}/sensu/backend.yml install -pm 0644 %{SOURCE3} %{buildroot}%{_unitdir}/sensu-agent.service install -pm 0640 %{SOURCE5} %{buildroot}%{_sysconfdir}/sensu/agent.yml install -pm 0644 %{SOURCE6} %{buildroot}%{_tmpfilesdir}/%{name}.conf install -pm 0644 %{SOURCE7} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}.conf %pre backend getent group sensu >/dev/null || groupadd -r sensu getent passwd sensu >/dev/null || \ useradd -r -g sensu -d %{_sharedstatedir}/sensu -s /sbin/nologin \ -c "Sensu User" sensu exit 0 %pre agent getent group sensu >/dev/null || groupadd -r sensu getent passwd sensu >/dev/null || \ useradd -r -g sensu -d %{_sharedstatedir}/sensu -s /sbin/nologin \ -c "Sensu User" sensu exit 0 %post backend %systemd_post sensu-backend.service %post agent %systemd_post sensu-agent.service %preun backend %systemd_preun sensu-backend.service %preun agent %systemd_preun sensu-agent.service %postun backend %systemd_postun sensu-backend.service %postun agent %systemd_postun sensu-agent.service %files cli %license LICENSE %doc CHANGELOG.md CODE_OF_CONDUCT.md CONTRIBUTING.md FAQ.md README.md %{_sbindir}/sensuctl %files backend %license LICENSE %attr(-,sensu,sensu) %dir %{_sharedstatedir}/sensu/ %attr(755, sensu, sensu) %dir %{_sysconfdir}/sensu/ %attr(755, sensu, sensu) %dir %{_localstatedir}/cache/sensu/ %attr(755, sensu, sensu) %dir %{_localstatedir}/log/sensu/ %ghost %attr(755, sensu, sensu) %{_rundir}/sensu/ %config(noreplace) %attr(644, sensu, sensu) %{_sysconfdir}/sensu/backend.yml %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}.conf %{_unitdir}/sensu-backend.service %{_sbindir}/sensu-backend %{_tmpfilesdir}/%{name}.conf %exclude %{_sysconfdir}/sensu/agent.yml %files agent %license LICENSE %attr(-,sensu,sensu) %dir /var/lib/sensu/ %attr(755, sensu, sensu) %dir %{_sysconfdir}/sensu/ %attr(755, sensu, sensu) %dir %{_localstatedir}/cache/sensu/ %attr(755, sensu, sensu) %dir %{_localstatedir}/log/sensu/ %ghost %attr(755, sensu, sensu) %{_rundir}/sensu/ %config(noreplace) %attr(644, sensu, sensu) %{_sysconfdir}/sensu/agent.yml %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}.conf %{_unitdir}/sensu-agent.service %{_sbindir}/sensu-agent %{_tmpfilesdir}/%{name}.conf %exclude %{_sysconfdir}/sensu/backend.yml %changelog * Wed Apr 01 2020 Devin Acosta <devin@linuxstack.cloud> - 5.21.0-3 - Fixed Configs being overwritten, added +oss_el7|8 to version * Sun Mar 29 2020 Devin Acosta <devin@linuxstack.cloud> - 5.21.0-2 - Added SPEC to create sensu-go-backend/sensu-go-agent RPMS * Sun Mar 29 2020 Devin Acosta <devin@linuxstack.cloud> - 5.21.0-1 - Initial package ===================================================================================================== SRPMs: https://eclipseo.fedorapeople.org/sensu-go/ Please see if this works for you and if you'd be able to take ownership and maintain the SPECs. -- You are receiving this mail because: You are on the CC list for the bug. You are always notified about changes to this product and component _______________________________________________ package-review mailing list -- package-review@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe send an email to package-review-leave@xxxxxxxxxxxxxxxxxxxxxxx Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/package-review@xxxxxxxxxxxxxxxxxxxxxxx