6675480
%define beanstalkd_user      beanstalkd
6675480
%define beanstalkd_group     %{beanstalkd_user}
6675480
%define beanstalkd_home      %{_localstatedir}/lib/beanstalkd
802baf9
%define beanstalkd_binlogdir %{beanstalkd_home}/binlog
6675480
6675480
Name:           beanstalkd
88d3893
Version:        1.4.6
661e7a2
Release:        7%{?dist}
653b664
Summary:        A simple, fast work-queue service
6675480
6675480
Group:          System Environment/Daemons
6675480
License:        GPLv3+
815bfbc
URL:            http://kr.github.com/%{name}/
815bfbc
Source0:        https://github.com/downloads/kr/%{name}/%{name}-%{version}.tar.gz
815bfbc
Source1:        %{name}.service
bd01311
Source2:        %{name}.sysconfig
6675480
6675480
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
815bfbc
BuildRequires:  libevent-devel
815bfbc
BuildRequires:  systemd-units
6675480
815bfbc
815bfbc
Requires(pre):    shadow-utils
815bfbc
Requires(post):   systemd-units
815bfbc
Requires(preun):  systemd-units
815bfbc
Requires(postun): systemd-units
6675480
5ba961d
# fixes dprintf source conflict.  This is patch from upstream's git repository.
5ba961d
# A new release has not been made that includes this patch
5ba961d
# https://github.com/kr/beanstalkd/commit/976ec8ba8e70e3b5027f441de529f479c11c8507
5ba961d
Patch0: 0007-Patch-to-rename-beanstalkd-s-dprintf-to-dbgprintf.patch 
6675480
6675480
%description
653b664
beanstalkd is a simple, fast work-queue service. Its interface is generic,
6e7efd6
but was originally designed for reducing the latency of page views in
6e7efd6
high-volume web applications by running most time-consuming tasks
6e7efd6
asynchronously.
6675480
6675480
6675480
%prep
6675480
%setup -q
5ba961d
%patch0 -p1
5ba961d
6e7efd6
if [ ! -e configure ]; then
6e7efd6
  sh autogen.sh
6e7efd6
fi
6675480
6675480
6675480
%build
6675480
%configure --disable-rpath
6675480
make %{?_smp_mflags}
6675480
6675480
6675480
%install
6675480
rm -rf $RPM_BUILD_ROOT
bd01311
make install-man1 DESTDIR=$RPM_BUILD_ROOT
bd01311
make install-exec-am DESTDIR=$RPM_BUILD_ROOT
815bfbc
%{__install} -p -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service
bd01311
%{__install} -p -D -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/%{name}
802baf9
%{__install} -d -m 0755 %{buildroot}%{beanstalkd_home}
802baf9
%{__install} -d -m 0755 %{buildroot}%{beanstalkd_binlogdir}
6675480
6675480
6675480
%clean
6675480
rm -rf $RPM_BUILD_ROOT
6675480
6675480
%pre
815bfbc
getent group %{beanstalkd_group} >/dev/null || groupadd -r %{beanstalkd_group}
815bfbc
getent passwd %{beanstalkd_user} >/dev/null || \
815bfbc
    useradd -r -g %{beanstalkd_user} -d %{beanstalkd_home} -s /sbin/nologin \
815bfbc
    -c "beanstalkd user" %{beanstalkd_user}
815bfbc
exit 0
6675480
6675480
815bfbc
%post
802baf9
# make the binlog dir after installation, this is so SELinux does not complain
802baf9
# about the init script creating the binlog directory
802baf9
# Bug 558310
802baf9
if [ -d %{beanstalkd_home} ]; then
802baf9
    %{__install} -d %{beanstalkd_binlogdir} -m 0755 \
802baf9
        -o %{beanstalkd_user} -g %{beanstalkd_user} \
802baf9
        %{beanstalkd_binlogdir}
802baf9
fi
802baf9
815bfbc
if [ $1 -eq 1 ] ; then
815bfbc
    # Initial installation
815bfbc
    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
815bfbc
fi
815bfbc
815bfbc
6675480
%preun
815bfbc
if [ $1 -eq 0 ] ; then
815bfbc
    # Package removal, not upgrade
815bfbc
    /bin/systemctl --no-reload disable %{name}.service > /dev/null 2>&1 || :
815bfbc
    /bin/systemctl stop %{name}.service > /dev/null 2>&1 || :
6675480
fi
6675480
6675480
%postun
815bfbc
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
815bfbc
if [ $1 -ge 1 ] ; then
815bfbc
    # Package upgrade, not uninstall
815bfbc
    /bin/systemctl try-restart %{name}.service >/dev/null 2>&1 || :
6675480
fi
6675480
815bfbc
6675480
%files
6675480
%defattr(-,root,root,-)
6e7efd6
%doc README README-DEVELOPERS README-TESTS COPYING doc/protocol.txt
815bfbc
%{_unitdir}/%{name}.service
6675480
%{_bindir}/%{name}
6675480
%{_mandir}/man1/%{name}.1.gz
6675480
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
815bfbc
%attr(0755,%{beanstalkd_user},%{beanstalkd_group}) %dir %{beanstalkd_home}
802baf9
%ghost %attr(0755,%{beanstalkd_user},%{beanstalkd_group}) %dir %{beanstalkd_binlogdir}
6675480
6675480
6675480
%changelog
661e7a2
* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.6-7
661e7a2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
661e7a2
815bfbc
* Sun Feb 19 2012 Jeremy Hinegardner <jeremy at hinegardner dot org> - 1.4.6-6
815bfbc
- Add systemd config Bug #754490
815bfbc
- fix user/group creation to be in line with packaging standards
815bfbc
- fix Source URL
815bfbc
3f91893
* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.6-5
3f91893
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
3f91893
8658a51
* Sun Feb 27 2011 Jeremy Hinegardner <jeremy at hinegardner dot org> - 1.4.6-4
8658a51
- fix f15 build issues with patch from upstream
8658a51
2e2c135
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.6-2
2e2c135
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
2e2c135
88d3893
* Sat Jun 05 2010 Jeremy Hinegardner <jeremy at hinegardner dot org> - 1.4.6-1
88d3893
- update to upstream 1.4.6
88d3893
802baf9
* Mon Feb 22 2010 Jeremy Hinegardner <jeremy at hinegardner dot org> - 1.4.3-2
802baf9
- fix binlogdir location initialization for bug #55831
802baf9
653b664
* Sun Feb 21 2010 Jeremy Hinegardner <jeremy at hinegardner dot org> - 1.4.3-1
653b664
- update to upstream 1.4.3
653b664
- change default binlogdir in sysconfig file
653b664
- cleanup rpmlint warnings
653b664
6e7efd6
* Sat Oct 17 2009 Jeremy Hinegardner <jeremy at hinegardner dot org> - 1.4.2-1
6e7efd6
- update to upstream 1.4.2
6e7efd6
6e7efd6
* Sun Oct 11 2009 Jeremy Hinegardner <jeremy at hinegardner dot org> - 1.4-0
6e7efd6
- update to upstream 1.4
6e7efd6
3bf9b84
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3-2
3bf9b84
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
3bf9b84
ed4be7e
* Sat Apr 11 2009 Jeremy Hinegardner <jeremy at hinegardner dot org> - 1.3-1
ed4be7e
- update to upstream 1.3
ed4be7e
a62cc6b
* Mon Feb 23 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2-2
a62cc6b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
a62cc6b
bd01311
* Tue Feb 17 2009 Jeremy Hinegardner <jeremy at hinegardner dot org> - 1.2-1
bd01311
- update to upstream 1.2
bd01311
- remove man page source as it was incorporated upstream
bd01311
6675480
* Sat Nov 22 2008 Jeremy Hinegardner <jeremy at hinegardner dot org> - 1.1-1
6675480
- initial spec creation