Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
=============

Expand Down
22 changes: 22 additions & 0 deletions contrib/Makefile
Original file line number Diff line number Diff line change
@@ -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

1 change: 1 addition & 0 deletions contrib/mod_statsd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
LoadModule statsd_module /usr/lib64/httpd/modules/mod_statsd.so
56 changes: 56 additions & 0 deletions contrib/mod_statsd.spec
Original file line number Diff line number Diff line change
@@ -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 <[email protected]> - 1.0.5-2
- removed patch as no longer required
- updated spec to use rpm macros

* Wed Oct 8 2014 Matthew Hollick <[email protected]> - 1.0.5-1
- New package
- Copied spec file from mod_qos by Christof Damian.
- Source from https://github.com/jib/mod_statsd