From a724c39bc70a3262b10dfd2a3aa0ebc06f148ac8 Mon Sep 17 00:00:00 2001 From: Sebastian Dziallas Date: Feb 18 2010 17:25:24 +0000 Subject: enable binary builds again --- diff --git a/sugar-record-build-binary-properly.patch b/sugar-record-build-binary-properly.patch new file mode 100644 index 0000000..0cb8942 --- /dev/null +++ b/sugar-record-build-binary-properly.patch @@ -0,0 +1,22 @@ +diff -ur a/camerac/Makefile b/camerac/Makefile +--- a/camerac/Makefile 2009-06-01 14:50:42.000000000 +0200 ++++ b/camerac/Makefile 2010-02-18 18:06:06.000000000 +0100 +@@ -20,17 +20,12 @@ + INCLUDES=-I. -I/usr/include/${PYTHON} ${GLIB_INCLUDES} ${PYGTK_INCLUDES} ${CAIRO_INCLUDES} ${PYCAIRO_INCLUDES} ${GTK_INCLUDES} + OPTFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -fasynchronous-unwind-tables + CFLAGS=-g -fPIC -DPIC $(OPTFLAGS) $(INCLUDES) +-LDFLAGS=-shared -nostdlib -Wl,--export-dynamic -pthread ${GLIB_LIBS} ${PYGTK_LIBS} ${CAIRO_LIBS} ${PYCAIRO_LIBS} ${GTK_LIBS} $(PYTHON_LIBS) ++LDFLAGS=-shared -Wl,--export-dynamic -pthread ${GLIB_LIBS} ${PYGTK_LIBS} ${CAIRO_LIBS} ${PYCAIRO_LIBS} ${GTK_LIBS} $(PYTHON_LIBS) + + ARCH = $(shell arch | grep 64 >/dev/null && echo linux64 || echo linux32) + LIB_DIR = $(ARCH)_$(PYVER) + + all: camera.so +- rm -rf $(LIB_DIR) +- mkdir $(LIB_DIR) +- strip -s $^ +- mv $^ $(LIB_DIR)/ +- touch $(LIB_DIR)/__init__.py + + camera.so: camera.o + $(CXX) $(LDFLAGS) -o $@ $^ diff --git a/sugar-record-no-bundled-libs.patch b/sugar-record-no-bundled-libs.patch new file mode 100644 index 0000000..9817552 --- /dev/null +++ b/sugar-record-no-bundled-libs.patch @@ -0,0 +1,12 @@ +diff -ur a/record.py b/record.py +--- a/record.py 2009-04-29 14:55:40.000000000 +0200 ++++ b/record.py 2010-02-18 18:04:36.000000000 +0100 +@@ -36,7 +36,7 @@ + from sugar.presence import presenceservice + from sugar.presence.tubeconn import TubeConnection + from sugar import util +-import port.json ++import json + + from model import Model + from ui import UI diff --git a/sugar-record-no-strange-init-logic.patch b/sugar-record-no-strange-init-logic.patch new file mode 100644 index 0000000..e86674a --- /dev/null +++ b/sugar-record-no-strange-init-logic.patch @@ -0,0 +1,25 @@ +diff -ur a/camerac/__init__.py b/camerac/__init__.py +--- a/camerac/__init__.py 2009-04-28 07:19:47.000000000 +0200 ++++ b/camerac/__init__.py 2010-02-18 18:07:43.000000000 +0100 +@@ -2,20 +2,4 @@ + import sys + import logging + +-_sys_path = sys.path +-_root_path = os.path.dirname(__file__) +- +-for i in os.listdir(_root_path): +- path = os.path.join(_root_path, i) +- if (os.path.isdir(path)): +- sys.path = _sys_path + [os.path.join('.', path)] +- try: +- from camera import * +- logging.debug('use %s blobs' % path) +- _sys_path = None +- break +- except Exception, e: +- logging.debug('skip %s blobs: %s' % (path, e)) +- +-if _sys_path: +- raise('cannot find proper binary blobs') ++from camera import * diff --git a/sugar-record.spec b/sugar-record.spec index e10b86c..0741d4f 100644 --- a/sugar-record.spec +++ b/sugar-record.spec @@ -1,19 +1,30 @@ +%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} +%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} + Name: sugar-record Version: 64 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Recording tool for Sugar Group: Sugar/Activities License: MIT URL: http://wiki.laptop.org/go/Record Source0: http://download.sugarlabs.org/sources/honey/Record/Record-%{version}.tar.bz2 +Patch0: sugar-record-build-binary-properly.patch +Patch1: sugar-record-no-bundled-libs.patch +Patch2: sugar-record-no-strange-init-logic.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -BuildArch: noarch BuildRequires: gettext BuildRequires: python-devel BuildRequires: sugar-toolkit +BuildRequires: glib2-devel +BuildRequires: pygtk2-devel +BuildRequires: cairo-devel +BuildRequires: pycairo-devel +BuildRequires: gtk2-devel + Requires: sugar Requires: gstreamer-plugins-good @@ -28,20 +39,27 @@ a hallmark of the Record activity %prep %setup -q -n Record-%{version} -#Removed stuff that's not needed -rm -rf port/ +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 + +# removed stuff that's not needed rm -rf gst/ -rm camerac/camera.c +rm -rf port/ %build +make %{?_smp_mflags} -C camerac %{__python} setup.py build %install -rm -rf %{buildroot} +rm -rf %{bildroot} +mkdir -p %{buildroot}%{python_sitearch}/camerac/ +install -Dm 0755 camerac/camera.so %{buildroot}%{python_sitearch}/camerac/ +install -Dm 0644 camerac/__init__.py %{buildroot}%{python_sitearch}/camerac/ %{__python} setup.py install --prefix=%{buildroot}%{_prefix} -rm %{buildroot}%{sugaractivitydir}Record.activity/{COPYING,NEWS} +rm -rf %{buildroot}%{sugaractivitydir}Record.activity/{COPYING,NEWS,camerac} %find_lang org.laptop.RecordActivity @@ -53,9 +71,13 @@ rm -rf %{buildroot} %defattr(-,root,root,-) %doc COPYING NEWS %{sugaractivitydir}/Record.activity/ +%{python_sitearch}/camerac %changelog +* Thu Feb 18 2010 Sebastian Dziallas - 64-5 +- Enable binary builds again + * Mon Dec 14 2009 Peter Robinson - 64-4 - Add buildreq gettext to fix build issues on F-12/rawhide - fixes # 539221 @@ -82,4 +104,3 @@ rm -rf %{buildroot} * Sun Oct 19 2008 Fabian Affolter - 59-1 - Initial package for Fedora -