diff --git a/README.md b/README.md index 666b48c..e14ba23 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,24 @@ $ perl build.pl $ dpkg-buildpackage -d -b ``` +Centos/RHEL packaging +--------------------- + +Make sure you have **mock** installed, which you can get by running: + +``` +$ sudo yum install mock +``` + +You can build the RPMs and Source RPM by calling the make command from the **contrib** folder: +``` +$ cd contrib +$ make rpm +``` + +The results will be placed in the **contrib/RPMS** folder afterwards. + + Configuration ============= diff --git a/contrib/Makefile b/contrib/Makefile new file mode 100755 index 0000000..c3f258a --- /dev/null +++ b/contrib/Makefile @@ -0,0 +1,22 @@ +#!/usr/bin/make -f +# +CWD=$(shell pwd -P) +SPEC=mod_statsd.spec + +rpm: srpm + sudo mock --rebuild $(CWD)/SRPMS/*.src.rpm --resultdir=$(CWD)/RPMS/ + +srpm: prepare + sudo mock --buildsrpm --spec=$(CWD)/$(SPEC) --sources=$(CWD)/ --resultdir=$(CWD)/SRPMS + +clean: + @rm -rf RPMS SRPMS src mod_statsd.tar.gz + +prepare: clean + @mkdir -v SRPMS RPMS src + @cp ../mod_statsd.c src/ + @cp mod_statsd.conf src/ + @cp ../DOCUMENTATION src/ + @cp ../LICENSE src/ + tar -czf mod_statsd.tar.gz src + diff --git a/contrib/mod_statsd.conf b/contrib/mod_statsd.conf new file mode 100644 index 0000000..1d690fa --- /dev/null +++ b/contrib/mod_statsd.conf @@ -0,0 +1 @@ +LoadModule statsd_module /usr/lib64/httpd/modules/mod_statsd.so diff --git a/contrib/mod_statsd.spec b/contrib/mod_statsd.spec new file mode 100644 index 0000000..1c84af6 --- /dev/null +++ b/contrib/mod_statsd.spec @@ -0,0 +1,56 @@ +%{!?_httpd_mmn: %{expand: %%global _httpd_mmn %%(cat %{_includedir}/httpd/.mmn || echo missing-httpd-devel)}} +%{!?_httpd_apxs: %{expand: %%global _httpd_apxs %%{_sbindir}/apxs}} + +Name: mod_statsd +Version: 1.0.5 +Release: 1%{?dist} +Summary: Apache module to send statistics to Statsd +Group: System Environment/Daemons +License: MIT +URL: https://github.com/jib/mod_statsd +Source0: %{name}.tar.gz +BuildRoot: %{name}-%{version}-%{release} +BuildRequires: httpd-devel >= 2.0.0 +Requires: httpd-mmn = %{_httpd_mmn} + +%description +This module enables the sending of Statsd statistics directly from Apache, +without the need for a CustomLog processor. +It will send one counter and one timer per request received. + +%prep +%setup -n src + +%build +%{_httpd_apxs} -Wc,"%{optflags}" -c mod_statsd.c + +%install +mkdir -p %{buildroot}%{_sysconfdir}/httpd/conf.d/ +mkdir -p %{buildroot}%{_libdir}/httpd/modules/ +install -Dpm 755 .libs/mod_statsd.so \ + %{buildroot}%{_libdir}/httpd/modules/mod_statsd.so +install -Dpm 644 mod_statsd.conf \ + %{buildroot}%{_sysconfdir}/httpd/conf.d/mod_statsd.conf + +%clean +rm -rf %{buildroot} + +%files +%defattr(-,root,root,-) +%doc DOCUMENTATION LICENSE +%{_libdir}/httpd/modules/mod_statsd.so +%config(noreplace) %{_sysconfdir}/httpd/conf.d/mod_statsd.conf + +############################################################################### +# CHANGELOG # +############################################################################### + +%changelog +* Wed Mar 25 2015 Andy "Bob" Brockhurst - 1.0.5-2 +- removed patch as no longer required +- updated spec to use rpm macros + +* Wed Oct 8 2014 Matthew Hollick - 1.0.5-1 +- New package +- Copied spec file from mod_qos by Christof Damian. +- Source from https://github.com/jib/mod_statsd