- fix build on older distros

- memcached-autofoo.patch: removed no-dist-gzip dist-xz
  - added new conditional to guard all the systemd stuff and
    guarded the general bcond_without with an suse_version > 12.2
  - export LIBEVENT_CFLAGS and LIBEVENT_LIBS so we dont need
    pkgconfig check for libevent on sles11
  - use makeinstall instead of make_install

OBS-URL: https://build.opensuse.org/package/show/network:utilities/memcached?expand=0&rev=13
This commit is contained in:
Marcus Rückert 2012-11-07 20:01:31 +00:00 committed by Git OBS Bridge
parent ef8e3127fd
commit 4bd42a26f7
3 changed files with 38 additions and 3 deletions

View File

@ -59,7 +59,7 @@
-if test "$ICC" = "no"; then
- AC_PROG_CC_C99
-fi
+AM_INIT_AUTOMAKE([foreign -Wall -Wno-portability tar-pax no-dist-gzip dist-xz subdir-objects])
+AM_INIT_AUTOMAKE([foreign -Wall -Wno-portability tar-pax subdir-objects])
+AC_CONFIG_HEADERS([config.h])
+AC_PROG_CC_STDC

View File

@ -1,3 +1,14 @@
-------------------------------------------------------------------
Wed Nov 7 19:58:59 UTC 2012 - mrueckert@suse.de
- fix build on older distros
- memcached-autofoo.patch: removed no-dist-gzip dist-xz
- added new conditional to guard all the systemd stuff and
guarded the general bcond_without with an suse_version > 12.2
- export LIBEVENT_CFLAGS and LIBEVENT_LIBS so we dont need
pkgconfig check for libevent on sles11
- use makeinstall instead of make_install
-------------------------------------------------------------------
Tue Aug 14 02:50:12 UTC 2012 - crrodriguez@opensuse.org

View File

@ -15,6 +15,9 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%if 0%{?suse_version} > 1210
%bcond_without systemd
%endif
Name: memcached
Version: 1.4.14
@ -32,7 +35,9 @@ BuildRequires: libevent
BuildRequires: automake
BuildRequires: cyrus-sasl-devel
BuildRequires: pkgconfig
%if %{with systemd}
BuildRequires: systemd
%endif
PreReq: %insserv_prereq %fillup_prereq /usr/sbin/groupadd /usr/sbin/useradd
Conflicts: memcached-unstable
%define home_dir /var/lib/%{pkg_name}
@ -50,8 +55,9 @@ Patch2: memcached-use-endian_h.patch
Summary: A high-performance, distributed memory object caching system
License: BSD-3-Clause
Group: Productivity/Networking/Other
%if %{with systemd}
%{?systemd_requires}
%endif
%description
Memcached is a high-performance, distributed memory object caching
system, generic in nature, but intended for use in speeding up dynamic
@ -73,6 +79,10 @@ miss.
%build
autoreconf -fiv
%if 0%{?suse_version} == 1110
export LIBEVENT_CFLAGS="-I%{_includedir}"
export LIBEVENT_LIBS="-levent"
%endif
%configure --enable-sasl --disable-coverage --bindir=%{_sbindir}
make %{?_smp_mflags}
@ -81,32 +91,44 @@ make %{?_smp_mflags}
%{__make} test
%install
%make_install
%makeinstall
%{__install} -D -m 0755 scripts/memcached-tool %{buildroot}%{_sbindir}/memcached-tool
%{__install} -Dd -m 0755 %{buildroot}%{home_dir}
%{__install} -D -m 0755 %{S:1} %{buildroot}%{_sysconfdir}/init.d/%{pkg_name}
%{__ln_s} -f ../..%{_sysconfdir}/init.d/%{pkg_name} %{buildroot}%{_sbindir}/rc%{pkg_name}
%{__install} -D -m 0644 %{S:2} %{buildroot}/var/adm/fillup-templates/sysconfig.%{pkg_name}
%if %{with systemd}
%{__install} -D -m 0644 %{S:4} %{buildroot}%{_unitdir}/%{pkg_name}.service
%endif
%clean
%{__rm} -rf %{buildroot};
%pre
/usr/sbin/groupadd -r %{pkg_name} &>/dev/null || :
/usr/sbin/useradd -o -g %{pkg_name} -s /bin/false -r -c "user for %{pkg_name}" -d %{home_dir} %{pkg_name} &>/dev/null || :
%if %{with systemd}
%service_add_pre %{pkg_name}.service
%endif
%post
%fillup_and_insserv %{pkg_name}
%if %{with systemd}
%service_add_post %{pkg_name}.service
%endif
%preun
%stop_on_removal %{pkg_name}
%if %{with systemd}
%service_del_preun %{pkg_name}.service
%endif
%postun
%restart_on_update %{pkg_name}
%{insserv_cleanup}
%if %{with systemd}
%service_del_postun %{pkg_name}.service
%endif
%files
%defattr(-,root,root)
@ -120,6 +142,8 @@ make %{?_smp_mflags}
%{_includedir}/%{pkg_name}
/var/adm/fillup-templates/sysconfig.%{pkg_name}
%dir %attr(755,root,root) %{home_dir}
%if %{with systemd}
%{_unitdir}/%{pkg_name}.service
%endif
%changelog