File ddccontrol.spec of Package ddccontrol

#
# spec file for package ddccontrol (Version 0.4.2.0.svn20090310)
#
# Copyright (c) 2009 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


Name:           ddccontrol
Version:        0.4.2.1.git20100621
%define _version git20100621
Release:        0
License:        BSD
Group:          Hardware/Other
Summary:        Display DDC Control
Url:            http://ddccontrol.sourceforge.net/
Source:         %{name}-%{_version}.tar.bz2
Source1:        %{name}-rpmlintrc
# These two files are binary, but they were commited to SVN as text:
# These files were mangled by SVN checking as text files, Here are correct versions:
Source2:        gddccontrol.png
Source3:        gddccontrol-bluecurve.png
Source4:        ddccontrol.cs.po
# PATCH-FIX-UPSTREAM ddccontrol-desktop.patch sbrabec@suse.cz -- Make desktop file conforming to standards.
Patch:          ddccontrol-desktop.patch
# PATCH-FEATURE-UPSTREAM ddccontrol-pc.patch sbrabec@suse.cz -- Create and install convenient .pc file.
Patch1:         ddccontrol-pc.patch
# PATCH-FIX-UPSTREAM ddccontrol-distcheck.patch sbrabec@suse.cz -- Fixes to pass "make distcheck".
Patch2:         ddccontrol-distcheck.patch
# PATCH-FIX-UPSTREAM ddccontrol-libexecdir.patch sbrabec@suse.cz -- Move applet to libexecdir where it belongs.
Patch3:         ddccontrol-libexecdir.patch
# PATCH-FIX-UPSTREAM ddccontrol-icon.patch sbrabec@suse.cz -- Use custom icon instead of depending on (obsolete) third party icon.
Patch4:         ddccontrol-icon.patch
# PATCH-FEATURE-UPSTREAM ddccontrol-selectable.patch sbrabec@suse.cz -- Make GUI messages selectable to simplify cut and paste.
Patch5:         ddccontrol-selectable.patch
BuildRequires:  gnome-panel-devel gtk2-devel libxml2-devel pciutils-devel
# For doc:
BuildRequires:  docbook-xsl-stylesheets libxslt tidy
# For autogen.sh:
BuildRequires:  intltool pkg-config
Requires(pre):  permissions
Recommends:     ddccontrol-db
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Control your monitor by software using the DDC/CI protocol.

Command line utilities.

Authors:
--------
    Oleg I. Vdovikin <oleg@cs.msu.su>
    Nicolas Boichat <nicolas@boichat.ch>
    Christian Schilling <cschilling@gmx.de>
    Roberto C. Sanchez <roberto@connexer.com>

%package gtk
License:        BSD 3-Clause
Summary:        Display DDC Control GUI
Group:          Hardware/Other
Requires:       libddccontrol0 >= %{version}
Requires:       ddccontrol-db

%description gtk
Control your monitor by software using the DDC/CI protocol.

GTK+ GUI.

Authors:
--------
    Oleg I. Vdovikin <oleg@cs.msu.su>
    Nicolas Boichat <nicolas@boichat.ch>
    Christian Schilling <cschilling@gmx.de>
    Roberto C. Sanchez <roberto@connexer.com>

%package gnome
License:        BSD 3-Clause
Summary:        Display DDC Control Applet for GNOME
Group:          Hardware/Other
Requires:       libddccontrol0 = %{version} ddccontrol-gtk >= %{version}

%description gnome
Control your monitor by software using the DDC/CI protocol.

GNOME profile switching applet.

Authors:
--------
    Oleg I. Vdovikin <oleg@cs.msu.su>
    Nicolas Boichat <nicolas@boichat.ch>
    Christian Schilling <cschilling@gmx.de>
    Roberto C. Sanchez <roberto@connexer.com>

%package -n libddccontrol-devel
License:        BSD 3-Clause
Summary:        Display DDC Control Library
Group:          Development/Libraries/C and C++
Requires:       libddccontrol0 = %{version} glibc-devel

%description -n libddccontrol-devel
Control your monitor by software using the DDC/CI protocol.

Supporting shared library.

Authors:
--------
    Oleg I. Vdovikin <oleg@cs.msu.su>
    Nicolas Boichat <nicolas@boichat.ch>
    Christian Schilling <cschilling@gmx.de>
    Roberto C. Sanchez <roberto@connexer.com>

%package -n libddccontrol0
License:        BSD 3-Clause
Summary:        Display DDC Control
Group:          System/Libraries
Requires:       %{name}-lang >= %{version}

%description -n libddccontrol0
Control your monitor by software using the DDC/CI protocol.

Authors:
--------
    Oleg I. Vdovikin <oleg@cs.msu.su>
    Nicolas Boichat <nicolas@boichat.ch>
    Christian Schilling <cschilling@gmx.de>
    Roberto C. Sanchez <roberto@connexer.com>

%lang_package
%prep
%setup -q -n %{name}
%patch -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
cp -a %{S:2} %{S:3} src/gddccontrol/
cp -a %{S:4} po/cs.po ; echo cs >>po/LINGUAS
%if %suse_version == 1110
echo "X-SuSE-translate=false" >>src/gddccontrol/gddccontrol.desktop.in
%endif

%build
./autogen.sh
%configure\
	--libexecdir=%{_prefix}/lib/gnome-panel\
	--disable-static\
	--enable-doc
%{__make} %{?jobs:-j%jobs} htmldir=%{_docdir}/%{name}/html

%install
make DESTDIR=%buildroot htmldir=%{_docdir}/%{name}/html install
rm -f %{buildroot}%{_libdir}/*.la
cp -a AUTHORS COPYING ChangeLog NEWS README TODO %buildroot%{_docdir}/%{name}/
%find_lang ddccontrol
mkdir -p %buildroot%{_sysconfdir}/permissions.d
cat >%buildroot%{_sysconfdir}/permissions.d/ddccontrol <<EOF
%{_bindir}/ddcpci root.root 4755
EOF
cat >%buildroot%{_sysconfdir}/permissions.d/ddccontrol.paranoid <<EOF
%{_bindir}/ddcpci root.root 0755
EOF

%clean
rm -rf %buildroot

%post
%run_permissions
%verifyscript
%verify_permissions -e %{_bindir}/ddcpci

%post -n libddccontrol0 -p /sbin/ldconfig

%postun -n libddccontrol0 -p /sbin/ldconfig

%files
%defattr(-,root,root)
%doc %{_docdir}/%{name}
%exclude %{_docdir}/%{name}/html
%{_bindir}/ddccontrol
%verify(not mode) %attr(4755,root,root) %{_bindir}/ddcpci
%doc %{_mandir}/man1/ddccontrol.1*
%{_sysconfdir}/permissions.d/*

%files lang -f ddccontrol.lang

%files gtk
%defattr(-,root,root)
%{_bindir}/gddccontrol
%{_datadir}/applications/gddccontrol.desktop
%{_datadir}/icons/*/*/*/*.*
%doc %{_mandir}/man1/gddccontrol.1*
# own these directories to not depend on the Bluecurve theme installed:
%dir %{_datadir}/icons/Bluecurve
%dir %{_datadir}/icons/Bluecurve/48x48
%dir %{_datadir}/icons/Bluecurve/48x48/apps

%files gnome
%defattr(-,root,root)
%dir %{_datadir}/ddccontrol
%{_datadir}/ddccontrol/GNOME_ddcc-applet.xml
%{_libdir}/bonobo/servers/GNOME_ddcc-applet.server
%dir %{_prefix}/lib/gnome-panel
%{_prefix}/lib/gnome-panel/ddcc-applet

%files -n libddccontrol-devel
%defattr(-,root,root)
%dir %{_includedir}/%{name}
# FIXME: Some include files refer to config.h - they are unusable!
%{_includedir}/%{name}/*.h
%{_libdir}/*.so
%{_libdir}/pkgconfig/ddccontrol.pc
%doc %{_docdir}/%{name}/html

%files -n libddccontrol0
%defattr(-,root,root)
%{_libdir}/libddccontrol.so.0*

%changelog
openSUSE Build Service is sponsored by