File compton.spec of Package compton

#
# spec file for package compton
#
# Copyright (c) 2013 SUSE LINUX Products 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 http://bugs.opensuse.org/
#

# norootforbuild

%if 0%{?suse_version} >= 1220
%define xsltpkg libxslt-tools
%else
%define xsltpkg libxslt
%endif

Name:           compton
Version:        0.1_beta2
Release:        0
Summary:        A compositor for X11
License:        MIT
Group:          System/X11/Utilities
Url:            https://github.com/chjj/%{name}
Source:         %{name}-%{version}.tar.xz
BuildRequires:  gcc-c++, make, pkg-config
BuildRequires:  pkgconfig(x11)
BuildRequires:	pkgconfig(xcomposite)
BuildRequires:	pkgconfig(xfixes)
BuildRequires:	pkgconfig(xdamage)
BuildRequires:	pkgconfig(xrender)
BuildRequires:	pkgconfig(xext)
BuildRequires:	pkgconfig(xrandr)
BuildRequires:  pkgconfig(xinerama)
BuildRequires:	pkgconfig(libdrm)
BuildRequires:	pkgconfig(gl)
BuildRequires:	pkgconfig(libconfig)
BuildRequires:	pkgconfig(libpcre)
BuildRequires:  pkgconfig(dbus-1)
BuildRequires:  git
BuildRequires:	asciidoc
BuildRequires:  hicolor-icon-theme
BuildRequires:  update-desktop-files
BuildRequires:	%{xsltpkg}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Prefix:         /usr

%description
Compton was forked from Dana Jansens' fork of xcompmgr and refactored. I fixed
whatever bug I found, and added features I wanted. Things seem stable, but
don't quote me on it. I will most likely be actively working on this until I
get the features I want. This is also a learning experience for me. That is,
I'm partially doing this out of a desire to learn Xlib.

%prep
%setup

%build
# Extract the snapshot somewhere...
# Export the COMPTON_VERSION variable (you may also pass it to make directly)
export COMPTON_VERSION=%{version}
export CFLAGS="%{optflags}"
make
make docs

%install
sed -i '/GenericName/d' %{name}.desktop
%suse_update_desktop_file -N "Compton" -G "A compositor for X11" %name "DesktopUtility"
%make_install
install -Dm 0644 %{name}.sample.conf %{buildroot}%{_sysconfdir}/xdg/%{name}.conf

%post
%icon_theme_cache_post

%postun
%icon_theme_cache_postun

%files
%defattr(-,root,root,-)
%doc README.md LICENSE
%config %{_sysconfdir}/xdg/%{name}.conf
%{_datadir}/applications/%{name}.desktop
%{_bindir}/%{name}*
%{_mandir}/man?/%{name}*.*
%{_datadir}/icons/hicolor/*/apps/%{name}.??g

%changelog

openSUSE Build Service is sponsored by