cameramonitor.spec and gconf issues

Hello,

I’m trying to make an rpm of cameramonitor from here Nice tool I was using it for some time. Now I’m trying to make rpm of this package. I found a spec file for it and did some corrections to adapt it for the build service, but I’m having problems and this package won’t build.
Here is the spec file, also the buildservice output is attached

rpm spec for cameramonitor

%define mod_name cameramonitor
%define mod_version 0.2.orig
%define mod_namever cameramonitor_0.2.orig
%define mod_projdir cameramonitor-0.2

Name: cameramonitor
Summary: Webcam monitoring in system tray
Version: 0.2
Release: 1.0
Group: Utilities/System
Source: http://www.infinicode.org/code/cameramonitor/cameramonitor-0.2.tar.gz
License: GPLv2
URL: Camera Monitor - Is your webcam on?
Distribution: OpenSuse
Vendor: OpenSuse Community

BuildRoot: %{_tmppath}/%{mod_namever}-build

BuildRequires: python
BuildRequires: python-gtk
BuildRequires: python-gtk-devel
BuildRequires: gnome-libs
BuildRequires: gnome-libs-devel
BuildRequires: python-notify
BuildRequires: pkg-config
BuildRequires: libnotify
BuildRequires: libnotify-devel
BuildRequires: gconf2
BuildRequires: gconf2-devel
BuildRequires: update-desktop-files

Requires: Python
Requires: gnome-libs
Requires: python-notify

%description
Webcam monitoring in system tray

%prep

%setup -q -c -n %{mod_namever}

%build

cd %{mod_projdir}

CC=cc CXX=CC ./configure --prefix=%{_prefix}
–exec-prefix=%{_prefix}
–sysconfdir=%{_sysconfdir}
–mandir=%{_mandir}
–libexecdir=%{_prefix}/lib
–disable-static
–disable-dynamic
–enable-shared
$? -ne 0 ] && exit 1 # Early error exit

make CC=$CC CCCDLFLAGS="%picflags" OPTIMIZE="%optflags" LD=$CC

%install

rm -rf $RPM_BUILD_ROOT
cd %{mod_projdir}

make install DESTDIR=$RPM_BUILD_ROOT

%suse_update_desktop_file $RPM_BUILD_ROOT/usr/share/applications/cameramonitor-prefs.desktop System Applet
%suse_update_desktop_file $RPM_BUILD_ROOT/usr/share/applications/cameramonitor.desktop Utility System
#%find_gconf_schemas

%files
%defattr (-, root, bin)
%dir %attr(0755, root, bin) /etc
%dir %attr(0755, root, bin) /etc/gconf
%dir %attr(0755, root, bin) /etc/gconf/schemas
%dir %attr(0755, root, bin) /usr
%dir %attr(0755, root, bin) /usr/bin
%dir %attr(0755, root, bin) /usr/lib
%dir %attr(0755, root, bin) /usr/lib/python2.6
%dir %attr(0755, root, bin) /usr/lib/python2.6/site-packages
%dir %attr(0755, root, bin) /usr/lib/python2.6/site-packages/cameramonitor
%dir %attr(0755, root, bin) /usr/share
%dir %attr(0755, root, bin) /usr/share/applications
%dir %attr(0755, root, bin) /usr/share/cameramonitor
/etc/gconf/schemas/cameramonitor.schemas
/usr/bin/cameramonitor
/usr/lib/python2.6/site-packages/cameramonitor/init.py
/usr/lib/python2.6/site-packages/cameramonitor/init.pyc
/usr/lib/python2.6/site-packages/cameramonitor/init.pyo
/usr/lib/python2.6/site-packages/cameramonitor/autostart.py
/usr/lib/python2.6/site-packages/cameramonitor/autostart.pyc
/usr/lib/python2.6/site-packages/cameramonitor/autostart.pyo
/usr/lib/python2.6/site-packages/cameramonitor/camglobals.py
/usr/lib/python2.6/site-packages/cameramonitor/camglobals.pyc
/usr/lib/python2.6/site-packages/cameramonitor/camglobals.pyo
/usr/lib/python2.6/site-packages/cameramonitor/preferences.py
/usr/lib/python2.6/site-packages/cameramonitor/preferences.pyc
/usr/lib/python2.6/site-packages/cameramonitor/preferences.pyo
/usr/lib/python2.6/site-packages/cameramonitor/utils.py
/usr/lib/python2.6/site-packages/cameramonitor/utils.pyc
/usr/lib/python2.6/site-packages/cameramonitor/utils.pyo
/usr/share/applications/cameramonitor-prefs.desktop
/usr/share/applications/cameramonitor.desktop
/usr/share/cameramonitor/cameramonitor.png
/usr/share/cameramonitor/cameramonitor_48.png
/usr/share/cameramonitor/cameramonitor_small.png
%changelog

Can someone help in this?

Many thanks

Sorry, couldn’t attach the file. Here is the link to the output form the buildservice

Hi
Having a look at it at the moment, the spec file was from openSolaris?

If your building from scratch it’s better to run through the normal
command line install and build your spec file on that.

Just setting up a virtual machine to build on and will get back to you
later today :slight_smile:


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.37-0.1-default
up 4 days 11:11, 3 users, load average: 0.17, 0.70, 0.53
GPU GeForce 8600 GTS Silent - CUDA Driver Version: 190.18

Hi
Here you go, local build works, I’ll leave you to sort out the OBS :slight_smile:

You need to repack the source tarball as bz2.

Save the diff file as cameramonitor.desktop.in.diff


#
# spec file for package cameramonitor
#
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# norootforbuild

Name:		cameramonitor
Version:	0.2
Release:	1.1
Summary:	Webcam monitoring
Group:		Applications/System
License:	GPLv2
URL:		http://www.infinicode.org/code/cameramonitor/
#Source0	http://www.infinicode.org/code/cameramonitor/cameramonitor-0.2.tar.gz
Source0:	%{name}-%{version}.tar.bz2 
Patch0:		cameramonitor.desktop.in.diff
BuildRequires:	python-gtk-devel libnotify-devel gconf2-devel
BuildRequires:	update-desktop-files desktop-file-utils

%if 0%{?suse_version} < 1120
BuildRoot:	%{_tmppath}/%{name}-%{version}-build
%endif

%description
Camera Monitor is a little tray system icon that notifies you when your
Webcam is on.

%prep
%setup -q
%patch0

%build
%configure --prefix=/usr \
--disable-schemas-install

%install
make install DESTDIR=%{buildroot}

%suse_update_desktop_file -n %{name}

%find_gconf_schemas

%if 0%{?suse_version} < 1120
%clean
%{__rm} -rf '%{buildroot}'
%endif

%files
%defattr(-,root,root)
%doc AUTHORS ChangeLog COPYING NEWS README
%if 0%{?suse_version} < 1120
%config %{_sysconfdir}/gconf/schemas/%{name}.schemas
%else
%config %{_datadir}/gconf/schemas/%{name}.schemas
%endif
%{_bindir}/%{name}
%{py_sitedir}/%{name}/*
%{_datadir}/applications/%{name}*.desktop
%{_datadir}/%{name}/*

%changelog
* Fri Nov 20 2009 <your name> <valid_email_address> - 0.2-1.1
- initial build on OBS

Here is the diff file to fix the desktop entry


--- data/cameramonitor.desktop.in	2005-09-03 06:43:28.000000000
-0500 +++ data/cameramonitor.desktop.in.orig	2009-11-20
08:43:39.763586717 -0600 @@ -1,9 +1,10 @@
[Desktop Entry]
Encoding=UTF-8
Name=Camera Monitor
+GenericName=Camera Monitor
Comment=Camera Monitor
Exec=cameramonitor
-Icon=@IMAGEDIR@/cameramonitor.png
+Icon=cameramonitor
Terminal=false
Type=Application
Categories=GNOME;Application;AudioVideo;


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.37-0.1-default
up 4 days 12:25, 3 users, load average: 0.45, 0.28, 0.20
GPU GeForce 8600 GTS Silent - CUDA Driver Version: 190.18

Hi,

Indeed, the spec was from openSolaris :wink:

Thanks for your help. I was trying to build it with OBS, but still no success. I did additional changes to sort out some errors that came up, but still no possitive output. I,m still getting the gconf error while bulding for 11.2 x86_64 (which is the most important for me).
Are you willing to help a little more ? :slight_smile:

Hi
I notice it fails on 11.1, seems there are changes in the way python
site-packages functions. Needs some further work, but look here;

<https://build.opensuse.org/package/show?package=cameramonitor&project=home%3Amalcolmlewis%3AGnome>


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.37-0.1-default
up 2 days 2:26, 2 users, load average: 0.41, 0.18, 0.12
GPU GeForce 8600 GTS Silent - CUDA Driver Version: 190.18

Nice you’ve managed to pack it. Unfortunately it’s to early to celebrate.
I’ve just test it and I’m having following error
/usr/bin/cameramonitor:76: DeprecationWarning: os.popen3 is deprecated. Use the subprocess module.
text = os.popen3('fuser '+self.video_device, ‘r’)[1].read()

It seems it has something to do with Python. I’m looking for a feedback over the web now.
Any thoughts?

Hi
It’s only a warning, but the application should work. I tested on
my netbook and it functions as expected, icon appears in the task bar
when the camera is activated?


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.37-0.1-default
up 2 days 5:00, 2 users, load average: 0.00, 0.04, 0.07
GPU GeForce 8600 GTS Silent - CUDA Driver Version: 190.18