File deepin-ui.spec of Package deepin-ui

#
# spec file for package deepin-ui
#
# Copyright (c) 2012 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/
#


Name:           deepin-ui
Summary:        UI toolkit for Linux Deepin
License:        GPL-3.0+
Group:          System/GUI/GNOME
Version:        1.0.3git20120929
Release:        0
Url:            http://www.linuxdeepin.com
Source0:        %{name}-%{version}.tar.gz
Source1:        %{name}-demo.desktop
Source2:        distributor-logo.png
BuildRequires:  cairo-devel
BuildRequires:  fdupes
BuildRequires:  gcc
BuildRequires:  gcc-c++
BuildRequires:  libwebkitgtk-devel
BuildRequires:  python-devel
BuildRequires:  python-gtk-devel
BuildRequires:  python-setuptools
BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  update-desktop-files
BuildRequires:  hicolor-icon-theme
Requires:       python-webkitgtk
Recommends:     %{name}-lang = %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%{py_requires}

%description
UI toolkit libs for Linux Deepin,Awesome and Beautiful UI libs with LinuxDeepin.

%package demo
Summary:        UI toolkit for Linux Deepin
Group:          Development/Languages/Python
Requires:      %{name} = %{version}
Recommends:     %{name}-lang = %{version}
Group:          System/GUI/Other
BuildArch:      noarch

%description demo
UI toolkit libs demos for Linux Deepin,Awesome and Beautiful UI libs with LinuxDeepin.


%lang_package

%prep
%setup -q 

%build

%install
chmod 644 AUTHORS
chmod 644 COPYING
export CFLAGS="$RPM_OPT_FLAGS" 
python setup.py install --prefix=%{_prefix} --root=$RPM_BUILD_ROOT

# deepin-ui files install
mkdir -p %{buildroot}/%{_datadir}/pyshared
mv %{buildroot}/%{_prefix}/dtk %{buildroot}/%{_datadir}/pyshared
rm -rf %{buildroot}/%{_datadir}/pyshared/dtk/locale/*.po
rm -rf %{buildroot}/%{_datadir}/pyshared/dtk/locale/deepin-ui.pot
mv %{buildroot}/%{_datadir}/pyshared/dtk/locale %{buildroot}/%{_datadir}/locale
cd %{buildroot}/%{_libdir}/python2.7/site-packages/dtk
ln -s ../../../../share/pyshared/dtk/theme theme 
cd %{_builddir}/%{buildsubdir}

# deepin-ui-demo files install
mkdir %{buildroot}/%{_datadir}/applications
mkdir %{buildroot}/%{_datadir}/deepin-ui-demo
mkdir %{buildroot}/%{_bindir}/
mkdir -p %{buildroot}/%{_datadir}/icons/hicolor/48x48/apps
cp %{S:1} %{buildroot}/%{_datadir}/applications
cp -R app_theme %{buildroot}/%{_datadir}/deepin-ui-demo
cp -R skin %{buildroot}/%{_datadir}/deepin-ui-demo
cp -R cover %{buildroot}/%{_datadir}/deepin-ui-demo
cp -R demo.py %{buildroot}/%{_datadir}/deepin-ui-demo
cp %{S:2} %{buildroot}/%{_datadir}/icons/hicolor/48x48/apps
cd %{buildroot}%{_bindir}
ln -s ../share/deepin-ui-demo/demo.py %{name}-demo
cd %{_builddir}/%{buildsubdir}

# fix permission for all theme.txt files
chmod 0644 %{buildroot}%{_datadir}/pyshared/dtk/theme/*/theme.txt
chmod 0644 %{buildroot}%{_datadir}/deepin-ui-demo/app_theme/*/theme.txt

%fdupes %{buildroot}
%find_lang %{name}
%suse_update_desktop_file %{name}-demo

%post demo
%icon_theme_cache_post

%posttrans demo
%icon_theme_cache_post


%files 
%defattr(-,root,root)
%doc AUTHORS COPYING
%{_datadir}/pyshared
%{_libdir}/python2.7/site-packages/dtk
%{_libdir}/python2.7/site-packages/dtk-0.1-py2.7.egg-info
%{_libdir}/python2.7/site-packages/dtk_*.so

%files demo
%defattr(-,root,root)
%{_bindir}/%{name}-demo
%{_datadir}/%{name}-demo
%{_datadir}/applications/%{name}-demo.desktop
%{_datadir}/icons/hicolor/48x48/apps/distributor-logo.png

%files lang -f %{name}.lang

%changelog
openSUSE Build Service is sponsored by