File mlocate.spec of Package mlocate

# spec file for package mlocate
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

Name:           mlocate
Version:        0.26
Release:        0
Summary:        An utility for finding files by name
License:        GPL-2.0
Group:          System/Monitoring
Source1:        updatedb.conf
Source2:        %{name}.cron
Source3:        sysconfig.locate
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  gettext-tools
BuildRequires:  grep
BuildRequires:  sed
BuildRequires:  xz
Requires:       cron
Requires(post): %fillup_prereq
Requires(pre):  permissions
Requires(pre):  pwdutils
Recommends:     %{name}-lang = %{version}
Provides:       findutils:%{_bindir}/locate
# findutils is at version 4.5 so we need newer
# provides here to get it really obsoleted
Provides:       findutils-locate = 5.%{version}
Obsoletes:      findutils-locate < 5.%{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

A new locate implementation. The m character
stands for merging, because updatedb reuses the
existing database to avoid re-reading most of the
file system.


%setup -q

# do not check for visibilty by default as we go with nobody
sed -i \
	-e 's:conf_check_visibility = true:conf_check_visibility = false:g' \

export CFLAGS="%{optflags} -fPIE"
export LDFLAGS="-pie"
%configure \
	--localstatedir=%{_localstatedir}/lib \
	--enable-nls \
make groupname=nobody %{?_smp_mflags}

make DESTDIR=%{buildroot} groupname=nobody install
%find_lang %{name} || echo -n >> %{name}.lang
# DB file
mkdir -p %{buildroot}%{_localstatedir}/lib/%{name}
echo -n >> %{buildroot}%{_localstatedir}/lib/%{name}/%{name}.db
# Config
mkdir -p %{buildroot}%{_sysconfdir}
install -p -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}
# Cron
mkdir -p %{buildroot}%{_sysconfdir}/cron.daily
install -p -m 755 %{SOURCE2} %{buildroot}%{_sysconfdir}/cron.daily
# Sysconfig settings
install -D -m 644 %{SOURCE3} %{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.locate

make check %{?_smp_mflags}

%{fillup_only -n locate}

%config(noreplace) %{_sysconfdir}/updatedb.conf
%attr(0755,root,root) %{_bindir}/locate
%dir %{_localstatedir}/lib/mlocate
%ghost %{_localstatedir}/lib/mlocate/mlocate.db

%files lang -f %{name}.lang

openSUSE Build Service is sponsored by