File e17.spec of Package e17

#
# spec file for package e17
#
# 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/
#


%define generate_manpages 0

Name:           e17
Version:        0.17.6
Release:        0
Summary:        The window manager
License:        BSD-2-Clause
Group:          System/X11/Displaymanagers
Url:            http://enlightenment.org/
Source:         enlightenment-%{version}.tar.bz2
Source2:        e17
Source3:        sysactions.conf-oS12.2
# PATCH-FEATURE-OPENSUSE enlightenment-0.16.999.65256-dont_require_suidbit.patch -- we can call dbus actions instead of suid binary sleep_walker@suse.cz
Patch0:         enlightenment-0.16.999.65256-dont_require_suidbit.patch
# PATCH-FEATURE-OPENSUSE dont_offer_updates.patch -- don't offer updates, that's up to package manager -- sleep_walker@suse.cz
Patch1:         dont_offer_updates.patch
# PATCH-FEATURE-OPENSUSE set_default_system_language.patch -- use system default language and don't ask user --  sleep_walker@suse.cz
Patch2:         set_default_system_language.patch
BuildRequires:  alsa-devel
BuildRequires:  dbus-1-devel
BuildRequires:  doxygen
BuildRequires:  e_dbus-devel
BuildRequires:  efl-devel
BuildRequires:  elementary-devel
BuildRequires:  freetype2-devel >= 2.1.7
BuildRequires:  gettext-devel
BuildRequires:  libtool
BuildRequires:  pam-devel
BuildRequires:  pkgconfig
BuildRequires:  xcb-util-keysyms-devel
BuildRequires:  xorg-x11-libXext-devel
%if 0%{?suse_version}
BuildRequires:  fdupes
%endif

# to have dbus-send for sysactions.conf
Requires:       dbus-1
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires:       e17-branding = 0.1
Requires:       e17-theme
Requires:       edje-utils
Requires:       efl
%if 0%{?suse_version}
# to have working automounting we need udisks
Recommends:     udisks
%endif

%description
Enlightenment 0.17 window manager and desktop environment is really fast, configurable and beautiful.

%package devel
Summary:        E17 development files
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}
Requires:       dbus-1-devel
Requires:       efl-devel
Requires:       elementary-devel
Requires:       freetype2-devel >= 2.1.7
Requires:       pam-devel
Requires:       xorg-x11-libXext-devel

%description devel
Development files of E17 package.

%package branding-upstream
Summary:        E17 files for upstream branding
Group:          System/GUI/Other
%if 0%{?suse_version}
Supplements:    packageand(e17:branding-upstream)
Conflicts:      otherproviders(e17-branding)
%endif
Provides:       e17-branding = 0.1
Requires:       e17-theme-default = %version
Requires:		enlightenment-theme-upstream
Conflicts:		terminology-theme-openSUSE

%description branding-upstream
Various files for E17 provided by upstream but altered by openSUSE or Petite Linux.

%package -n e17-theme-default
Summary:        Default E17 theme
Group:          System/GUI/Other
Provides:       e17-theme

%description -n e17-theme-default
Default theme for E17 window manager and desktop environment.

%package doc-html
Summary:        HTML documentation of Enlightenment
Group:          Documentation/HTML

%description doc-html
Documentation of Enlightenment in form of HTML pages.

%if %generate_manpages
%package doc-man
Summary:        Man documentation of Enlightenment
Group:          Documentation/Man

%description doc-man
Documentation of Enlightenment in form of man pages.
%endif

%prep
%setup -q -n enlightenment-%{version}
%patch0
%patch1 -p1
%patch2 -p1

%build
# fake time used for documentation
FAKE_DOCDATE=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%a %%b %%d %%Y')
FAKE_DOCYEAR=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%Y')
FAKE_DOCDATETIME=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%a %%b %%d %%Y %%T')
sed -i "s/\$datetime/$FAKE_DOCDATETIME/g;s/\$date/$FAKE_DOCDATE/g;s/\$year/$FAKEDOCYEAR/g" doc/*.html

%configure --disable-static --disable-silent-rules
make %{?_smp_mflags}
make doc

%install
make install DESTDIR="%buildroot"

# copy documentation manually
echo "Copying HTML documentation"
mkdir -p %{buildroot}%{_docdir}/%{name}
/bin/cp -vr doc/html %{buildroot}%{_docdir}/%{name}

%if %generate_manpages
echo "Copying MAN pages"
/bin/cp -vr doc/man/ %{buildroot}%{_mandir}/
%endif

# remove duplicates
%if 0%{?suse_version}
%fdupes -s %{buildroot}%{_docdir}

%if %generate_manpages
%fdupes -s %{buildroot}%{_mandir}
%endif
%endif

find %{buildroot}%{_libdir} -name '*.la' -exec rm -v {} \;
%find_lang enlightenment

%if 0%{?suse_version}
# remove setuid bits, enlightenment_backlight requires eeze-devel, which is not available for SLE
chmod -s %{buildroot}%{_libdir}/enlightenment/utils/enlightenment_sys \
%if 0%{?sles_version} != 11
         %{buildroot}%{_libdir}/enlightenment/utils/enlightenment_backlight \
%endif
         %{buildroot}%{_libdir}/enlightenment/modules/cpufreq/*/freqset

# remove duplicate files for SUSE
%fdupes -s %{buildroot}%{_libdir}/enlightenment/modules/
%fdupes -s %{buildroot}%{_datadir}/enlightenment/data/config
%endif

# copy PAM profile
mkdir -p %{buildroot}%{_sysconfdir}/pam.d
cp %SOURCE2 %{buildroot}%{_sysconfdir}/pam.d/enlightenment

# replace sysactions.conf with the distribution one
%if 0%{?suse_version} >= 1220
cp %SOURCE3 %{buildroot}%{_sysconfdir}/enlightenment/sysactions.conf
%endif

# remove files from not wanted place
rm %{buildroot}%{_datadir}/enlightenment/{COPYING,AUTHORS}

%clean
%{?buildroot:rm -rf %{buildroot}}

%files -f enlightenment.lang
%defattr(-,root,root)
%doc COPYING README AUTHORS
%exclude %{_docdir}/%{name}/html
%{_datadir}/xsessions/enlightenment.desktop
%{_datadir}/enlightenment/
%exclude %{_datadir}/enlightenment/data/themes/default.edj
%{_datadir}/applications/*.desktop
%{_libdir}/enlightenment
%config(noreplace) %{_sysconfdir}/enlightenment
%config(noreplace) %{_sysconfdir}/pam.d/enlightenment
%dir %{_sysconfdir}/xdg/menus
%config %{_sysconfdir}/xdg/menus/enlightenment.menu
%{_bindir}/enlightenment*
# excluded to be branded
%exclude %{_libdir}/enlightenment/modules/wizard/def-ibar.txt

%files branding-upstream
%defattr(-, root, root)
%{_libdir}/enlightenment/modules/wizard/def-ibar.txt

%files -n e17-theme-default
%defattr(-, root, root)
%{_datadir}/enlightenment/data/themes/default.edj

%files devel
%defattr(-, root, root)
%{_libdir}/pkgconfig/*.pc
%{_includedir}/enlightenment

%files doc-html
%defattr(-, root, root)
%{_docdir}/%{name}
%if 0%{?centos_version} || 0%{?fedora_version} == 16
%exclude %{_docdir}/%{name}-%{version}/COPYING
%exclude %{_docdir}/%{name}-%{version}/README
%exclude %{_docdir}/%{name}-%{version}/AUTHORS
%else
%exclude %{_docdir}/%{name}/COPYING
%exclude %{_docdir}/%{name}/README
%exclude %{_docdir}/%{name}/AUTHORS
%endif

%if %generate_manpages
%files doc-man
%defattr(-, root, root)
%{_mandir}/*/*
%endif

%changelog
openSUSE Build Service is sponsored by