--- /dev/null
+--- fz-linux-api_x64/fz_api_src/Makefile.orig 2013-09-25 11:56:53.000000000 +0200
++++ fz-linux-api_x64/fz_api_src/Makefile 2014-07-24 21:20:32.086256112 +0200
+@@ -16,7 +16,7 @@
+ COMPILERFLAGS = -Wall -g\r
+ \r
+ \r
+-LDFLAGS_PLAIN = -lpthread\r
++LDFLAGS_PLAIN = -lyuv -lpthread\r
+ EXE_PATH = ./\r
+ \r
+ ifeq ($(TARGET_OS),Darwin)\r
+@@ -24,13 +24,8 @@
+ LDFLAGS_D_OUT = -dynamiclib -o libfz_api.dylib\r
+ else\r
+ \r
+-ifeq ($(TARGET_ARCH),x86_64)\r
+-CFLAGS = -m64 -fPIC $(COMPILERFLAGS) -I./\r
+-LDFLAGS_D_OUT = -m64 -shared -Wl,-soname,libfz_api.so.1 -o libfz_api.so.1.0\r
+-else\r
+-CFLAGS = $(COMPILERFLAGS) -I./\r
+-LDFLAGS_D_OUT = -shared -Wl,-soname,libfz_api.so.1 -o libfz_api.so.1.0\r
+-endif\r
++CFLAGS = -fPIC $(COMPILERFLAGS) -I./\r
++LDFLAGS_D_OUT = $(LDFLAGS) -shared -Wl,-soname,libfz_api.so.1 -o libfz_api.so.1.0\r
+ \r
+ endif\r
+ \r
+@@ -38,17 +33,7 @@
+ #objects\r
+ \r
+ API_OBJECTS = ./timer.o ./socket_2.o ./logger.o ./common.o \\r
+- ./fzapi_channel.o ./fzapi.o ./fz_ll.o ./stream.o ./libyuv/cpu_id.o \\r
+- ./libyuv/compare.o ./libyuv/compare_common.o ./libyuv/compare_neon.o \\r
+- ./libyuv/compare_posix.o ./libyuv/compare_win.o ./libyuv/convert.o \\r
+- ./libyuv/convert_argb.o ./libyuv/convert_from.o ./libyuv/convert_from_argb.o \\r
+- ./libyuv/format_conversion.o ./libyuv/mjpeg_decoder.o ./libyuv/planar_functions.o \\r
+- ./libyuv/rotate.o ./libyuv/rotate_argb.o ./libyuv/rotate_mips.o \\r
+- ./libyuv/rotate_neon.o ./libyuv/row_posix.o ./libyuv/row_win.o \\r
+- ./libyuv/scale.o ./libyuv/scale_argb.o \\r
+- ./libyuv/scale_argb_neon.o ./libyuv/scale_mips.o ./libyuv/scale_neon.o \\r
+- ./libyuv/video_common.o ./libyuv/row_any.o ./libyuv/row_common.o \\r
+- ./libyuv/row_mips.o ./libyuv/row_neon.o \r
++ ./fzapi_channel.o ./fzapi.o ./fz_ll.o ./stream.o\r
+ \r
+ \r
+ #########\r
+@@ -65,7 +50,7 @@
+ @rm -f $*.d.tmp\r
+ \r
+ %.o: %.cc\r
+- g++ $(CFLAGS) -c $*.cc -o $*.o\r
++ $(CPP) $(CFLAGS) -c $*.cc -o $*.o\r
+ \r
+ %.o: %.c\r
+ $(CC) $(CFLAGS) -c $*.c -o $*.o\r
+--- fz-linux-api_x64/fz_api_src/fzapi.cpp.orig 2014-07-24 21:21:37.052920053 +0200
++++ fz-linux-api_x64/fz_api_src/fzapi.cpp 2014-07-24 21:21:40.052919927 +0200
+@@ -611,7 +611,7 @@
+ return iResult;\r
+ }\r
+ \r
+-#include <libyuv/libyuv.h>\r
++#include <libyuv.h>\r
+ \r
+ FZ_API FZ_Result FZ_GetFrameARGB(\r
+ FZ_Device_Handle_t hDev,\r
Summary: FZ-API to access the Fotonic cameras
Summary(pl.UTF-8): FZ-API pozwalające na dostęp do kamer Fotonic
Name: fz-api
-# version unknown
-Version: 0
-Release: 1
+# see fz_api_src/fzapi.cpp /FZAPI_VERSION
+Version: 4.1.2
+%define verdate 20130925
+Release: 0.%{verdate}.1
License: LGPL v3+
Group: Libraries
-Source0: http://www.fotonic.com/assets/documents/downloads/fz-linux-api_x64.tar.gz.zip
-# Source0-md5: 74cc0d1dcd13a6fe98baae01777cb1a3
-# tarballs differ only by pre-compiled binaries; we use only sources and docs, which are the same
-#Source1: http://www.fotonic.com/assets/documents/downloads/fz-linux-api_x86.tar.gz.zip
-## Source1-md5: bb37c1bf0bfbd3f06e8f6b0393a46b87
+Source0: http://www.fotonic.com/assets/documents/files/131002/fz-linux-api_x64_%{verdate}.tar.gz
+# Source0-md5: bd306ca31230cd632ca4060b5c26b98b
+# there is also
+#Source1: http://www.fotonic.com/assets/documents/files/fz-linux-api_x86_20130322.tar.gz
+## Source1-md5: 05b3be93d3ba1644c53f5cca9f6029f9
+# but it's older and both versions could be built from the same sources
+Patch0: %{name}-system-libyuv.patch
URL: http://www.fotonic.com/content/Products/downloads.aspx
BuildRequires: libstdc++-devel
BuildRequires: libyuv-devel
%prep
%setup -q -c
-
-tar xzf fz-linux-api_x64.tar.gz
-# not required so far
-#tar xzf fz-linux-api_x86.tar.gz
-
-# adjust libyuv include
-%{__sed} -i -e 's,libyuv/libyuv\.h,libyuv.h,' fz-linux-api_x64/fz_api_src/fzapi.cpp
-# be consistent with docs and precompiled binaries
-%{__sed} -i -e 's,libFZ_API,libfz_api,' fz-linux-api_x64/fz_api_src/Makefile
+%patch0 -p0
%build
%{__make} -C fz-linux-api_x64/fz_api_src \
CC="%{__cc}" \
CPP="%{__cxx}" \
- CFLAGS="%{rpmcflags} -fPIC -Wall" \
- LDFLAGS_D_OUT="%{rpmldflags} -shared -Wl,-soname,libfz_api.so.1 -o libfz_api.so.1.0" \
- LDFLAGS_PLAIN="-lyuv -lpthread" \
+ COMPILERFLAGS="%{rpmcflags} -Wall" \
+ LDFLAGS="%{rpmldflags}" \
TARGET_ARCH= \
TARGET_OS=Linux