From 36bbbd00cd1656c5c8689a10ad1f1059af6a69e7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Wed, 27 Jan 2016 22:37:24 +0200 Subject: [PATCH] new, version 1.1.12 based on fedora package, 46c0236 --- gearmand-1.1.12-ppc64le.patch | 21 ++++ gearmand.init | 81 ++++++++++++++ gearmand.service | 12 ++ gearmand.spec | 199 ++++++++++++++++++++++++++++++++++ gearmand.sysconfig | 3 + 5 files changed, 316 insertions(+) create mode 100644 gearmand-1.1.12-ppc64le.patch create mode 100644 gearmand.init create mode 100644 gearmand.service create mode 100644 gearmand.spec create mode 100644 gearmand.sysconfig diff --git a/gearmand-1.1.12-ppc64le.patch b/gearmand-1.1.12-ppc64le.patch new file mode 100644 index 0000000..4a6780b --- /dev/null +++ b/gearmand-1.1.12-ppc64le.patch @@ -0,0 +1,21 @@ +diff -up gearmand-1.1.12/configure.ppc64le gearmand-1.1.12/configure +--- gearmand-1.1.12/configure.ppc64le 2014-09-09 17:12:22.368039057 +0200 ++++ gearmand-1.1.12/configure 2014-09-09 17:11:49.584039857 +0200 +@@ -16219,7 +16219,7 @@ $as_echo_n "checking for boostlib >= $bo + libsubdirs="lib" + ax_arch=`uname -m` + case $ax_arch in +- x86_64|ppc64|s390x|sparc64|aarch64) ++ x86_64|ppc64*|s390x|sparc64|aarch64) + libsubdirs="lib64 lib lib64" + ;; + esac +@@ -26051,7 +26051,7 @@ if ac_fn_c_try_compile "$LINENO"; then : + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in +- i?86 | x86_64 | ppc | ppc64) ++ i?86 | x86_64 | ppc | ppc64*) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else diff --git a/gearmand.init b/gearmand.init new file mode 100644 index 0000000..e2502aa --- /dev/null +++ b/gearmand.init @@ -0,0 +1,81 @@ +#!/bin/bash +# +# gearmand Startup script for the Gearman server +# +# chkconfig: - 85 15 +# description: Gearman is a distributed job system. +# processname: gearmand +# config: /etc/sysconfig/gearmand +# pidfile: /var/run/gearmand/gearmand.pid +# +### BEGIN INIT INFO +# Provides: gearmand +# Required-Start: $local_fs $network +# Required-Stop: $local_fs $network +# Default-Start: +# Default-Stop: +# Short-Description: start and stop the Gearman server +# Description: Gearman is a distributed job system. +### END INIT INFO + +# Source function library. +. /etc/rc.d/init.d/functions + +if [ -f /etc/sysconfig/gearmand ]; then + . /etc/sysconfig/gearmand +fi + +[ -z "${PIDFILE}" ] && pidfile="/var/run/gearmand/gearmand.pid" +[ -z "${LOCKFILE}" ] && lockfile="/var/lock/subsys/gearmand" + +gearmand=/usr/sbin/gearmand +prog=gearmand + +RETVAL=0 + +start() { + echo -n $"Starting $prog: " + daemon --pidfile=$pidfile --user=gearmand $gearmand -d $OPTIONS + RETVAL=$? + echo + [ $RETVAL = 0 ] && (touch $lockfile; pgrep -f $gearmand > $pidfile) + return $RETVAL +} + +stop() { + echo -n $"Stopping $prog: " + killproc -p $pidfile $gearmand + RETVAL=$? + echo + [ $RETVAL = 0 ] && rm -f $lockfile $pidfile +} + +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + status) + status -p $pidfile $gearmand + RETVAL=$? + ;; + restart|reload) + stop + start + ;; + condrestart|try-restart) + if status -p $pidfile $gearmand >&/dev/null; then + stop + start + fi + ;; + *) + echo $"Usage: $prog {start|stop|restart|reload|condrestart|status|help}" + RETVAL=3 +esac + +exit $RETVAL + diff --git a/gearmand.service b/gearmand.service new file mode 100644 index 0000000..34f97f0 --- /dev/null +++ b/gearmand.service @@ -0,0 +1,12 @@ +[Unit] +Description=Gearmand distributed job system +After=syslog.target network.target + +[Service] +EnvironmentFile=/etc/sysconfig/gearmand +User=gearmand +Type=forking +ExecStart=/usr/sbin/gearmand -d $OPTIONS + +[Install] +WantedBy=multi-user.target diff --git a/gearmand.spec b/gearmand.spec new file mode 100644 index 0000000..88f1c93 --- /dev/null +++ b/gearmand.spec @@ -0,0 +1,199 @@ +# TODO +# - fix make install linking stuff over again +# - skip tests build if testing disabled +# - add gearman user/group +# +# Conditional build: +%bcond_with tests # build with tests +%bcond_without gperftools # gperftools +%bcond_without sqlite # sqlite +%bcond_without tokyocabinet # tokyocabinet +%bcond_with tcmalloc # tcmalloc + +# google perftools available only on these +%ifnarch %{ix86} x86_64 ppc64 ppc64le aarch64 %{arm} +%undefine with_gperftools +%endif + +%ifarch ppc64 sparc64 +%undefine with_tcmalloc +%endif + +Summary: A distributed job system +Name: gearmand +Version: 1.1.12 +Release: 0.1 +License: BSD +Group: Daemons +Source0: https://launchpad.net/gearmand/1.2/%{version}/+download/%{name}-%{version}.tar.gz +# Source0-md5: 99dd0be85b181eccf7fb1ca3c2a28a9f +Source1: %{name}.init +Source2: %{name}.sysconfig +Source3: %{name}.service +Patch0: %{name}-1.1.12-ppc64le.patch +URL: http://www.gearman.org +BuildRequires: boost-devel >= 1.37.0 +BuildRequires: boost-thread +BuildRequires: e2fsprogs-devel +BuildRequires: gperf +%{?with_gperftools:BuildRequires: gperftools-devel} +BuildRequires: libevent-devel +BuildRequires: libmemcached-devel +BuildRequires: libuuid-devel +#BuildRequires: memcached +BuildRequires: mysql-devel +BuildRequires: postgresql-devel +BuildRequires: rpmbuild(macros) >= 1.647 +%{?with_sqlite:BuildRequires: sqlite3-devel} +BuildRequires: systemd-units +%{?with_tokyocabinet:BuildRequires: tokyocabinet-devel} +BuildRequires: zlib-devel +%if %{with tests} +BuildRequires: curl-devel +BuildRequires: mysql-server +%endif +Requires(post,preun): /sbin/chkconfig +Requires(post,preun,postun): systemd-units >= 38 +Requires: procps +Requires: rc-scripts +Requires: systemd-units >= 0.38 +BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) + +# FIXME: add tmpfiles conf +%define no_install_post_check_tmpfiles 1 + +%description +Gearman provides a generic framework to farm out work to other +machines or dispatch function calls to machines that are better suited +to do the work. It allows you to do work in parallel, to load balance +processing, and to call functions between languages. It can be used in +a variety of applications, from high-availability web sites to the +transport for database replication. In other words, it is the nervous +system for how distributed processing communicates. + +%package -n libgearman +Summary: Development libraries for gearman +Group: Development/Libraries +Provides: libgearman-1.0 = %{version}-%{release} +Obsoletes: libgearman-1.0 < %{version}-%{release} +# gearman requires uuid_generate_time_safe, which only exists in newer e2fsprogs-libs +Requires: e2fsprogs-libs >= 1.39-32 + +%description -n libgearman +Development libraries for %{name}. + +%package -n libgearman-devel +Summary: Development headers for libgearman +Group: Development/Libraries +Requires: libevent-devel +Requires: libgearman = %{version}-%{release} +Provides: libgearman-1.0-devel = %{version}-%{release} +Obsoletes: libgearman-1.0-devel < %{version}-%{release} + +%description -n libgearman-devel +Development headers for %{name}. + +%prep +%setup -q +%patch0 -p1 + +%build +# HACK to work around boost issues. +#export LDFLAGS="%{rpmldflags} LDFLAGS -lboost_system" + +%configure \ + --disable-silent-rules \ + --disable-static \ +%if %{with tcmalloc} + --enable-tcmalloc \ +%endif + +%{__make} + +%if %{with tests} +%{__make} check +%endif + +%install +rm -rf $RPM_BUILD_ROOT +%{__make} install \ + DESTDIR=$RPM_BUILD_ROOT + +rm -v $RPM_BUILD_ROOT%{_libdir}/libgearman*.la + +install -p -D %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/gearmand + +# install systemd unit file +install -d $RPM_BUILD_ROOT%{systemdunitdir} +cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service + +# install legacy SysV init script +install -p -D %{SOURCE1} $RPM_BUILD_ROOT%{_initrddir}/gearmand +install -d $RPM_BUILD_ROOT/var/run/gearmand + +install -d $RPM_BUILD_ROOT/var/log +touch $RPM_BUILD_ROOT/var/log/gearmand.log + +install -d $RPM_BUILD_ROOT/var/run/gearmand + +%clean +rm -rf $RPM_BUILD_ROOT + +%if 0 +%pre +%groupadd -r gearmand +%useradd -r -g gearmand -d / -s /sbin/nologin -c "Gearmand job server" gearmand + +%post +%systemd_post gearmand.service +if [ $1 = 1 ]; then + /sbin/chkconfig --add gearmand +fi +touch /var/log/gearmand.log + +%preun +%systemd_preun gearmand.service +if [ "$1" = 0 ] ; then + %service gearmand stop + /sbin/chkconfig --del gearmand +fi + +%postun +%systemd_postun_with_restart gearmand.service +%endif + +%post -n libgearman -p /sbin/ldconfig +%postun -n libgearman -p /sbin/ldconfig + +%files +%defattr(644,root,root,755) +%doc README +%attr(755,gearmand,gearmand) /var/run/gearmand +%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/gearmand +%attr(755,root,root) %{_sbindir}/gearmand +%attr(755,root,root) %{_bindir}/gearman +%attr(755,root,root) %{_bindir}/gearadmin +%{_mandir}/man1/* +%{_mandir}/man8/* +%attr(640,gearmand,gearmand) %config(noreplace) %verify(not md5 mtime size) /var/log/gearmand.log +%if %{with systemd} +%{systemdunitdir}/%{name}.service +%else +%{_initrddir}/%{name} +%endif + +%files -n libgearman +%defattr(644,root,root,755) +%doc COPYING +%attr(755,root,root) %{_libdir}/libgearman.so.*.*.* +%ghost %{_libdir}/libgearman.so.8 + +%files -n libgearman-devel +%defattr(644,root,root,755) +%doc AUTHORS ChangeLog +%dir %{_includedir}/libgearman +%{_includedir}/libgearman/*.h +%{_pkgconfigdir}/gearmand.pc +%{_libdir}/libgearman.so +%{_includedir}/libgearman-1.0 +%{_mandir}/man3/* diff --git a/gearmand.sysconfig b/gearmand.sysconfig new file mode 100644 index 0000000..bee2500 --- /dev/null +++ b/gearmand.sysconfig @@ -0,0 +1,3 @@ +### Settings for gearmand +# OPTIONS="" + -- 2.44.0