File xsettingsd.spec of Package xsettingsd

Name:           xsettingsd
%global commit  5cb0596b6db8a35ef20026b730829cbd7f77a10d
# Spec file parser can't expand %%(...)? Check this!
#%%global shortcommit %%(c=%%{commit}; echo ${c:0:7})
%global shortcommit 5cb0596
#                   YYYYMMDD
%define commit_date 20141123
%define revision    0
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} || 0%{?rhel}
Version:        0
%define release_override 0.%{revision}.%{commit_date}git%{shortcommit}%{?dist}
%else
Version:        0.0~git%{commit_date}.g%{shortcommit}
%define release_override %{revision}
%endif
Release:        %{release_override}
Summary:        Provides settings to X11 clients via the XSETTINGS specification
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} || 0%{?rhel}
Group:          System Environment/Daemons
License:        BSD
%else
License:        BSD-3-Clause
Group:          System/X11/Utilities
%endif

%define URL     https://github.com/derat/xsettingsd
%define SOURCE  %{URL}/archive/%{commit}/xsettingsd-%{commit}.tar.gz
URL:            %{URL}
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} || 0%{?rhel}
Source0:        %{SOURCE}
%else
Source:         %{SOURCE}
%endif
BuildRequires:  gcc-c++
BuildRequires:  scons
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} || 0%{?rhel}
BuildRequires:  pkgconfig
%else
BuildRequires:  pkg-config
%endif
%if 0%{?suse_version} > 1110 || 0%{?centos_version} < 700 || 0%{?rhel_version} < 700 || 0%{?rhel} < 7
BuildRequires:  pkgconfig(x11)
%else
BuildRequires:  xorg-x11-devel
%endif
# Link run time dependencies are added automatically by RPM.

# SUSE/SLES 11 fix.
%if 0%{?suse_version} <= 1110
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%endif
%if 0%{?rhel} < 6
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
%endif

%description
xsettingsd is a daemon that implements the XSETTINGS specification.

It is intended to be small, fast, and minimally dependent on other
libraries. It can serve as an alternative to mate-settings-daemon for users
who are not using the MATE desktop environment but who still run GTK+
applications and want to configure things such as themes, font
antialiasing/hinting, and UI sound effects.

%prep
%setup -q -n %{name}-%{commit}
sed -i -e "s|\(CCFLAGS[[:blank:]]*=[[:blank:]]*'\)[^']*'|\1'|" SConstruct

%build
CFLAGS='%{optflags}' CXXFLAGS='%{optflags}' scons %{?_smp_mflags}

%install
for file in %{name} dump_xsettings; do
    install -Dm 0755 $file %{buildroot}%{_bindir}/$file
    install -Dm 0644 $file.1 %{buildroot}%{_mandir}/man1/$file.1
done

%files
%defattr(-,root,root,-)
%doc COPYING README
%{_bindir}/%{name}
%{_bindir}/dump_xsettings
%{_mandir}/man1/%{name}.1.*
%{_mandir}/man1/dump_xsettings.1.*

%changelog
openSUSE Build Service is sponsored by