Skip to content

Instantly share code, notes, and snippets.

@itxx00
Created July 13, 2015 10:28
Show Gist options
  • Save itxx00/e056a5f566311ef84c08 to your computer and use it in GitHub Desktop.
Save itxx00/e056a5f566311ef84c08 to your computer and use it in GitHub Desktop.
falcon-agent spec
Name: falcon-agent
Version: 0.4
Release: 1%{?dist}
Summary: falcon-agent
Group: system/daemon
License: GPL
URL: http://open-falcon.com/
Source0: http://open-falcon.com/download/%{name}-%{version}.tar.gz
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
Requires: chkconfig
%description
This is a linux monitor agent. Just like zabbix-agent and tcollector.
%prep
%setup -q
%build
%install
rm -rf %{buildroot}
install -d %{buildroot}/opt/%{name}
install -pm 755 falcon-agent %{buildroot}/opt/%{name}/falcon-agent
install -d %{buildroot}/opt/%{name}/public
cp -rp public/* %{buildroot}/opt/%{name}/public
install -d %{buildroot}%{_initrddir}
install -pm 755 falcon-agent.init %{buildroot}%{_initrddir}/falcon-agent
install -m 644 cfg.json %{buildroot}/opt/%{name}/cfg.json
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%dir /opt/%{name}
/opt/%{name}/falcon-agent
/opt/%{name}/public/*
%{_initrddir}/falcon-agent
%config(noreplace) /opt/%{name}/cfg.json
%post
# Register the tengine service
if [ $1 -eq 1 ]; then
/sbin/chkconfig --add falcon-agent
fi
%preun
if [ $1 -eq 0 ]; then
/sbin/service falcon-agent stop > /dev/null 2>&1
/sbin/chkconfig --del falcon-agent
fi
%changelog
* Mon Jul 13 2015 itxx00 <itxx00@gmail.com> - 0.4-1
- rebuilt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment