]> git.pld-linux.org Git - packages/avcap.git/commitdiff
- new master auto/th/avcap-0.1.9-1
authorJakub Bogusz <qboosh@pld-linux.org>
Fri, 30 Aug 2013 13:11:23 +0000 (15:11 +0200)
committerJakub Bogusz <qboosh@pld-linux.org>
Fri, 30 Aug 2013 13:11:23 +0000 (15:11 +0200)
- v4l2 patch allows to build with V4L2 only (no V4L1) support
- c++ patch adds missing C++ includes
- install patch fixes non-root install

avcap-c++.patch [new file with mode: 0644]
avcap-install.patch [new file with mode: 0644]
avcap-v4l2.patch [new file with mode: 0644]
avcap.spec [new file with mode: 0644]

diff --git a/avcap-c++.patch b/avcap-c++.patch
new file mode 100644 (file)
index 0000000..3384ab3
--- /dev/null
@@ -0,0 +1,50 @@
+--- avcap-0.1.9/avcap/linux/AVC_FormatManager.cpp.orig 2009-11-30 14:07:14.000000000 +0100
++++ avcap-0.1.9/avcap/linux/AVC_FormatManager.cpp      2013-08-29 18:51:41.125165077 +0200
+@@ -25,6 +25,7 @@
+ #ifdef HAS_AVC_SUPPORT
+ #include <iostream>
++#include <memory>
+ #include <sys/ioctl.h>
+ #include "raw1394util.h"
+--- avcap-0.1.9/avcap/linux/V4L2_DeviceDescriptor.cpp.orig     2009-11-30 14:07:14.000000000 +0100
++++ avcap-0.1.9/avcap/linux/V4L2_DeviceDescriptor.cpp  2013-08-29 19:52:44.181678020 +0200
+@@ -31,6 +31,7 @@
+ #include <linux/types.h>
+ #include <linux/videodev2.h>
+ #include <errno.h>
++#include <unistd.h>
+ #include "V4L2_DeviceDescriptor.h"
+ #include "V4L2_Device.h"
+--- avcap-0.1.9/avcap/DeviceCollector.cpp.orig 2009-11-30 14:07:14.000000000 +0100
++++ avcap-0.1.9/avcap/DeviceCollector.cpp      2013-08-29 20:14:18.624957032 +0200
+@@ -22,6 +22,7 @@
+  */
++#include <cstring>
+ #include <iostream>
+ #include <sstream>
+ #include <sys/stat.h>
+--- avcap-0.1.9/test/captest.cpp.orig  2009-11-30 14:07:16.000000000 +0100
++++ avcap-0.1.9/test/captest.cpp       2013-08-29 20:18:15.978280403 +0200
+@@ -11,6 +11,7 @@
+ #endif
+ #include <stdlib.h>
++#include <string.h>
+ #include <getopt.h>
+ #include "avcap/avcap.h"
+--- avcap-0.1.9/avcap/linux/V4L2_VidCapManager.cpp.orig        2013-08-29 20:34:46.371572175 +0200
++++ avcap-0.1.9/avcap/linux/V4L2_VidCapManager.cpp     2013-08-29 20:35:19.461570785 +0200
+@@ -24,6 +24,7 @@
+ #include <string.h>
+ #include <iostream>
+ #include <time.h>
++#include <unistd.h>
+ #include <math.h>
+ #include <errno.h>
+ #include <sys/ioctl.h>
diff --git a/avcap-install.patch b/avcap-install.patch
new file mode 100644 (file)
index 0000000..3fef76c
--- /dev/null
@@ -0,0 +1,11 @@
+--- avcap-0.1.9/Makefile.am.orig       2009-11-30 14:07:13.000000000 +0100
++++ avcap-0.1.9/Makefile.am    2013-08-29 21:21:16.498121751 +0200
+@@ -12,8 +12,3 @@
+ pkgconfig_DATA = avcap.pc\r
\r
+ CLEANFILES = avcap.pc\r
+-\r
+-install-exec-hook:\r
+-      if test "`uname -s`" == "Linux"; then \\r
+-              ldconfig; \\r
+-      fi\r
diff --git a/avcap-v4l2.patch b/avcap-v4l2.patch
new file mode 100644 (file)
index 0000000..0ccf5f9
--- /dev/null
@@ -0,0 +1,311 @@
+--- avcap-0.1.9/include/avcap/linux/V4L2_Connector.h.orig      2009-11-30 14:07:14.000000000 +0100
++++ avcap-0.1.9/include/avcap/linux/V4L2_Connector.h   2013-08-29 18:20:52.665242649 +0200
+@@ -26,7 +26,7 @@
+ #define V4L2_CONNECTOR_H_
+ #include <linux/types.h>
+-#include <linux/videodev.h>
++#include <linux/videodev2.h>
+ #include <string>
+ #include <list>
+--- avcap-0.1.9/include/avcap/linux/V4L2_ControlBase.h.orig    2009-11-30 14:07:14.000000000 +0100
++++ avcap-0.1.9/include/avcap/linux/V4L2_ControlBase.h 2013-08-29 18:22:21.265238931 +0200
+@@ -26,7 +26,7 @@
+ #include <string>
+ #include <list>
+-#include <linux/videodev.h>
++#include <linux/videodev2.h>
+ namespace avcap
+ {
+--- avcap-0.1.9/include/avcap/Connector.h.orig 2009-11-30 14:07:14.000000000 +0100
++++ avcap-0.1.9/include/avcap/Connector.h      2013-08-29 18:20:24.445243835 +0200
+@@ -31,7 +31,7 @@
+ #ifdef AVCAP_LINUX
+ # include <linux/types.h>
+-# include <linux/videodev.h>
++# include <linux/videodev2.h>
+ #endif
+ #include <string>
+--- avcap-0.1.9/include/avcap/FormatManager.h.orig     2009-11-30 14:07:14.000000000 +0100
++++ avcap-0.1.9/include/avcap/FormatManager.h  2013-08-29 18:21:19.895241507 +0200
+@@ -37,7 +37,7 @@
+ #ifdef AVCAP_LINUX
+ # include <linux/types.h>
+-# include <linux/videodev.h>
++# include <linux/videodev2.h>
+ #endif // AVCAP_LINUX
+ #ifdef _WIN32
+--- avcap-0.1.9/avcap/linux/V4L2_ConnectorManager.cpp.orig     2009-11-30 14:07:14.000000000 +0100
++++ avcap-0.1.9/avcap/linux/V4L2_ConnectorManager.cpp  2013-08-29 18:19:48.648578669 +0200
+@@ -26,7 +26,7 @@
+ #include <iostream>
+ #include <assert.h>
+ #include <string.h>
+-#include <linux/videodev.h>
++#include <linux/videodev2.h>
+ #include "V4L2_ConnectorManager.h"
+ #include "V4L2_DeviceDescriptor.h"
+--- avcap-0.1.9/avcap/linux/V4L2_ControlBase.cpp.orig  2009-11-30 14:07:14.000000000 +0100
++++ avcap-0.1.9/avcap/linux/V4L2_ControlBase.cpp       2013-08-29 18:21:56.158573318 +0200
+@@ -26,7 +26,7 @@
+ #include <sys/types.h>
+ #include <linux/types.h>
+ #include <sys/ioctl.h>
+-#include <linux/videodev.h>
++#include <linux/videodev2.h>
+ #include <errno.h>
+ #include "V4L2_ControlBase.h"
+--- avcap-0.1.9/avcap/linux/AVC_DeviceDescriptor.cpp.orig      2009-11-30 14:07:14.000000000 +0100
++++ avcap-0.1.9/avcap/linux/AVC_DeviceDescriptor.cpp   2013-08-29 18:22:59.278570669 +0200
+@@ -23,6 +23,7 @@
+ #ifdef HAS_AVC_SUPPORT
++#include <cstdio>
+ #include <sstream>
+ #include "AVC_DeviceDescriptor.h"
+--- avcap-0.1.9/avcap/linux/Makefile.am.orig   2009-11-30 14:07:14.000000000 +0100
++++ avcap-0.1.9/avcap/linux/Makefile.am        2013-08-29 18:45:22.635180961 +0200
+@@ -4,11 +4,22 @@
+ liblinuxavcap_la_SOURCES = \
+       raw1394util.cpp           V4L2_ConnectorManager.cpp\
+       AVC_Device.cpp            V4L2_ControlBase.cpp\
+-      AVC_DeviceDescriptor.cpp  V4L1_ConnectorManager.cpp  V4L2_ControlManager.cpp\
+-      AVC_FormatManager.cpp     V4L1_Control.cpp           V4L2_Device.cpp\
+-      AVC_Reader.cpp            V4L1_ControlManager.cpp    V4L2_DeviceDescriptor.cpp\
+-      AVC_VidCapManager.cpp     V4L1_Device.cpp\
+-      error.cpp                 V4L1_DeviceDescriptor.cpp  V4L2_FormatManager.cpp\
+-      frame.cpp                 V4L1_FormatManager.cpp     V4L2_MenuControl.cpp\
+-      ieee1394io.cpp            V4L1_VidCapManager.cpp     V4L2_Tuner.cpp\
+-      V4L2_Connector.cpp        V4L2_VidCapManager.cpp        
+\ No newline at end of file
++      AVC_DeviceDescriptor.cpp  V4L2_ControlManager.cpp\
++      AVC_FormatManager.cpp     V4L2_Device.cpp\
++      AVC_Reader.cpp            V4L2_DeviceDescriptor.cpp\
++      AVC_VidCapManager.cpp \
++      error.cpp                 V4L2_FormatManager.cpp\
++      frame.cpp                 V4L2_MenuControl.cpp\
++      ieee1394io.cpp            V4L2_Tuner.cpp\
++      V4L2_Connector.cpp        V4L2_VidCapManager.cpp
++
++if WITH_V4L1
++liblinuxavcap_la_SOURCES += \
++      V4L1_ConnectorManager.cpp \
++      V4L1_Control.cpp \
++      V4L1_ControlManager.cpp \
++      V4L1_Device.cpp \
++      V4L1_DeviceDescriptor.cpp \
++      V4L1_FormatManager.cpp \
++      V4L1_VidCapManager.cpp
++endif
+--- avcap-0.1.9/configure.in.orig      2009-11-30 14:07:16.000000000 +0100
++++ avcap-0.1.9/configure.in   2013-08-29 18:25:57.135229872 +0200
+@@ -70,6 +70,8 @@
+       PLATFORM_SUBDIR=linux
+       PLATFORM_LIB=linux/liblinuxavcap.la
+       AC_CHECK_HEADER(linux/videodev.h)
++      AC_CHECK_HEADER(linux/videodev2.h)
++      AM_CONDITIONAL([WITH_V4L1], [test x$ac_cv_header_linux_videodev_h = xyes])
+       AC_DEFINE([LINUX], [1], [Compile avcap for Linux])
+ fi
+--- avcap-0.1.9/avcap/linux/V4L2_ControlManager.cpp.orig       2009-11-30 14:07:14.000000000 +0100
++++ avcap-0.1.9/avcap/linux/V4L2_ControlManager.cpp    2013-08-29 18:50:24.601834955 +0200
+@@ -28,7 +28,7 @@
+ #include <iostream>
+ #include <sys/ioctl.h>
+ #include <linux/types.h>
+-#include <linux/videodev.h>
++#include <linux/videodev2.h>
+ #include "Control_avcap.h"
+ #include "V4L2_ControlManager.h"
+--- avcap-0.1.9/avcap/linux/V4L2_DeviceDescriptor.cpp.orig     2009-11-30 14:07:14.000000000 +0100
++++ avcap-0.1.9/avcap/linux/V4L2_DeviceDescriptor.cpp  2013-08-29 18:57:21.248484137 +0200
+@@ -29,7 +29,7 @@
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <linux/types.h>
+-#include <linux/videodev.h>
++#include <linux/videodev2.h>
+ #include <errno.h>
+ #include "V4L2_DeviceDescriptor.h"
+--- avcap-0.1.9/avcap/linux/V4L2_FormatManager.cpp.orig        2009-11-30 14:07:14.000000000 +0100
++++ avcap-0.1.9/avcap/linux/V4L2_FormatManager.cpp     2013-08-29 20:08:53.041637362 +0200
+@@ -25,7 +25,7 @@
+ #include <string.h>
+ #include <errno.h>
+ #include <sys/ioctl.h>
+-#include <linux/videodev.h>
++#include <linux/videodev2.h>
+ #include "V4L2_FormatManager.h"
+ #include "DeviceDescriptor.h"
+@@ -453,6 +453,7 @@
+ int V4L2_FormatManager::setFramerate(int fps)
+ {
++#ifdef HAVE_LINUX_VIDEODEV_H
+       // there is a special way to set the framerate for the pwc driver
+       if(mDeviceDescriptor->getDriver() == "pwc") {
+               struct video_window vwin;
+@@ -465,6 +466,7 @@
+                
+               return ioctl(mDeviceDescriptor->getHandle(), VIDIOCSWIN, &vwin);
+       } 
++#endif
+       
+       struct v4l2_streamparm setfps;  
+       memset(&setfps, 0, sizeof(struct v4l2_streamparm));
+@@ -478,6 +480,7 @@
+ int V4L2_FormatManager::getFramerate()
+ {
++#ifdef HAVE_LINUX_VIDEODEV_H
+       // there is a special way to get the framerate for the pwc driver
+       if(mDeviceDescriptor->getDriver() == "pwc") {
+               struct video_window vwin;
+@@ -488,6 +491,7 @@
+               else
+               return 0;
+       }
++#endif
+       
+       struct v4l2_streamparm setfps;  
+       memset(&setfps, 0, sizeof(struct v4l2_streamparm));
+--- avcap-0.1.9/avcap/linux/V4L2_MenuControl.cpp.orig  2009-11-30 14:07:14.000000000 +0100
++++ avcap-0.1.9/avcap/linux/V4L2_MenuControl.cpp       2013-08-29 20:09:25.334969339 +0200
+@@ -24,7 +24,7 @@
+ #include <string.h>
+ #include <sys/ioctl.h>
+ #include <linux/types.h>
+-#include <linux/videodev.h>
++#include <linux/videodev2.h>
+ #include "V4L2_MenuControl.h"
+ #include "V4L2_ControlBase.h"
+--- avcap-0.1.9/avcap/linux/V4L2_Tuner.cpp.orig        2009-11-30 14:07:14.000000000 +0100
++++ avcap-0.1.9/avcap/linux/V4L2_Tuner.cpp     2013-08-29 20:09:56.138301380 +0200
+@@ -25,7 +25,7 @@
+ #include <string.h>
+ #include <iostream>
+ #include <sys/ioctl.h>
+-#include <linux/videodev.h>
++#include <linux/videodev2.h>
+ #include "V4L2_Tuner.h"
+ #include "V4L2_DeviceDescriptor.h"
+--- avcap-0.1.9/include/avcap/linux/V4L2_Tuner.h.orig  2009-11-30 14:07:14.000000000 +0100
++++ avcap-0.1.9/include/avcap/linux/V4L2_Tuner.h       2013-08-29 20:10:30.114966621 +0200
+@@ -26,7 +26,7 @@
+ #define V4L2_TUNER_H_
+ #include <linux/types.h>
+-#include <linux/videodev.h>
++#include <linux/videodev2.h>
+ #include <sys/types.h>
+ #include <string>
+--- avcap-0.1.9/avcap/linux/V4L2_Connector.cpp.orig    2009-11-30 14:07:14.000000000 +0100
++++ avcap-0.1.9/avcap/linux/V4L2_Connector.cpp 2013-08-29 20:10:55.278298897 +0200
+@@ -25,7 +25,7 @@
+ #include <string>
+ #include <iostream>
+ #include <sys/ioctl.h>
+-#include <linux/videodev.h>
++#include <linux/videodev2.h>
+ #include "V4L2_Connector.h"
+ #include "V4L2_DeviceDescriptor.h"
+--- avcap-0.1.9/avcap/linux/V4L2_VidCapManager.cpp.orig        2009-11-30 14:07:14.000000000 +0100
++++ avcap-0.1.9/avcap/linux/V4L2_VidCapManager.cpp     2013-08-29 20:34:46.371572175 +0200
+@@ -31,7 +31,7 @@
+ #include <sys/select.h>
+ #include <sys/time.h>
+ #include <linux/types.h>
+-#include <linux/videodev.h>
++#include <linux/videodev2.h>
+ #include "V4L2_VidCapManager.h"
+ #include "V4L2_DeviceDescriptor.h"
+--- avcap-0.1.9/avcap/DeviceCollector.cpp.orig 2013-08-29 20:35:51.968236087 +0200
++++ avcap-0.1.9/avcap/DeviceCollector.cpp      2013-08-29 20:41:15.358222517 +0200
+@@ -36,9 +36,13 @@
+ #include "log.h"
+ #ifdef AVCAP_LINUX
++# ifdef HAVE_LINUX_VIDEODEV_H
+ # include "V4L1_Device.h"
++# endif
+ # include "V4L2_Device.h"
++# ifdef HAVE_LINUX_VIDEODEV_H
+ # include "V4L1_DeviceDescriptor.h"
++#  endif
+ # include "V4L2_DeviceDescriptor.h"
+ # ifdef HAS_AVC_SUPPORT
+ #  include "AVC_DeviceDescriptor.h"
+@@ -70,7 +74,9 @@
+ #ifdef AVCAP_LINUX
+       // prefer V4L2-driver over V4L1-driver, if both are available
+       query_V4L2_Devices();
++#ifdef HAVE_LINUX_VIDEODEV_H
+       query_V4L1_Devices();
++#endif
+       query_ieee1394_Devices();
+ #endif
+@@ -117,6 +123,7 @@
+       }
+ }
++#ifdef HAVE_LINUX_VIDEODEV_H
+ void DeviceCollector::query_V4L1_Devices()
+ {
+       // test all /dev/video* nodes, whether they are a valid V4L1 device.
+@@ -126,6 +133,7 @@
+               test_V4L1_Device(ostr.str());
+       }
+ }
++#endif
+ int DeviceCollector::test_V4L2_Device(const std::string& name)
+ {
+@@ -173,6 +181,7 @@
+       return -1;
+ }
++#ifdef HAVE_LINUX_VIDEODEV_H
+ int DeviceCollector::test_V4L1_Device(const std::string& name)
+ {
+       // first check, if there already exists a descriptor for this dev-file
+@@ -217,6 +226,7 @@
+       return -1;
+ }
++#endif
+ void DeviceCollector::query_ieee1394_Devices()
+ {
+@@ -272,9 +282,11 @@
+       if(test_V4L2_Device(name) == 0)
+               return true;
++#ifdef HAVE_LINUX_VIDEODEV_H
+       if(test_V4L1_Device(name) == 0)
+               return true;
+ #endif
++#endif
+       return false;
+ }
diff --git a/avcap.spec b/avcap.spec
new file mode 100644 (file)
index 0000000..f293be6
--- /dev/null
@@ -0,0 +1,136 @@
+Summary:       Cross-platform, API-independent C++ video capture library 
+Summary(pl.UTF-8):     Wieloplatformowa, niezależna od API biblioteka C++ do przechwytywania obrazu
+Name:          avcap
+Version:       0.1.9
+Release:       1
+License:       GPL v3+
+Group:         Libraries
+Source0:       http://downloads.sourceforge.net/libavcap/%{name}-%{version}.tar.gz
+# Source0-md5: 7e7ba375c68ab37b984b91ae23d0f164
+Patch0:                %{name}-v4l2.patch
+Patch1:                %{name}-c++.patch
+Patch2:                %{name}-install.patch
+URL:           http://libavcap.sourceforge.net/
+BuildRequires: autoconf >= 2.56
+BuildRequires: automake
+BuildRequires: libavc1394-devel
+BuildRequires: libdv-devel
+BuildRequires: libiec61883-devel
+BuildRequires: libstdc++-devel
+BuildRequires: libtool >= 2:1.5
+BuildRequires: pkgconfig
+BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+The avcap-library (avcap: a video capture library) is a cross-API,
+cross-platform simple and easy to use C++ video capture library. Its
+aim is to provide a unified API for Linux, Windows and Mac OS X to
+capture video from appropriate hardware. It hides the system specific
+quirks and issues of different API's used on different systems to
+access video capture hardware and hopefully helps to write portable
+capture-applications.
+
+%description -l pl.UTF-8
+Biblioteka avcap (biblioteka do przechwytywania obrazu) to
+wieloplatformowa, niezależna od lokalnego API, łatwa w użyciu
+biblioteka C++ do przechwytywania obrazu. Jej celem jest zapewnienie
+jednolitego API dla Linuksa, Windows i Mac OS X, służącego do
+przechwytywania obrazu z odpowiedniego sprzętu. Ukrywa zależne od
+systemu szczegóły związane z różnymi API służącymi do dostępu do
+urządzeń przechwytywania obrazu i ułatwia pisanie przenośnych
+aplikacji.
+
+%package devel
+Summary:       Header files for avcap library
+Summary(pl.UTF-8):     Pliki nagłówkowe biblioteki avcap
+Group:         Development/Libraries
+Requires:      %{name} = %{version}-%{release}
+Requires:      libavc1394-devel
+Requires:      libdv-devel
+Requires:      libiec61883-devel
+Requires:      libstdc++-devel
+
+%description devel
+Header files for avcap library.
+
+%description devel -l pl.UTF-8
+Pliki nagłówkowe biblioteki avcap.
+
+%package static
+Summary:       Static avcap library
+Summary(pl.UTF-8):     Statyczna biblioteka avcap
+Group:         Development/Libraries
+Requires:      %{name}-devel = %{version}-%{release}
+
+%description static
+Static avcap library.
+
+%description static -l pl.UTF-8
+Statyczna biblioteka avcap.
+
+%package apidocs
+Summary:       avcap API documentation
+Summary(pl.UTF-8):     Dokumentacja API biblioteki avcap
+Group:         Documentation
+
+%description apidocs
+avcap API documentation.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API biblioteki avcap.
+
+%prep
+%setup -q
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+
+# keep AX_PREFIX_CONFIG_H, kill libtool macros
+head -n 87 acinclude.m4 > acinclude.m4.tmp
+%{__mv} acinclude.m4.tmp acinclude.m4
+
+%build
+%{__libtoolize}
+%{__aclocal}
+%{__autoconf}
+%{__autoheader}
+%{__automake}
+%configure
+
+%{__make}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} install \
+       DESTDIR=$RPM_BUILD_ROOT
+
+# .la kept, *.private dependencies are missing in .pc
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post  -p /sbin/ldconfig
+%postun        -p /sbin/ldconfig
+
+%files
+%defattr(644,root,root,755)
+%doc AUTHORS ChangeLog README
+%attr(755,root,root) %{_bindir}/captest
+%attr(755,root,root) %{_libdir}/libavcap.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libavcap.so.6
+
+%files devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libavcap.so
+%{_libdir}/libavcap.la
+%{_includedir}/avcap
+%{_pkgconfigdir}/avcap.pc
+
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/libavcap.a
+
+%files apidocs
+%defattr(644,root,root,755)
+%doc doc/html/*
This page took 0.134702 seconds and 4 git commands to generate.