summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt19
-rw-r--r--uca-ufo-camera.c4
-rw-r--r--ucaufo.spec.in42
3 files changed, 62 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 601accc..42f2131 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,8 @@
cmake_minimum_required(VERSION 2.6)
-project(ucapco C)
+project(ucaufo C)
+
+set(UCAUFO_VERSION "0.0.1")
+
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
@@ -15,6 +18,17 @@ pkg_check_modules(PCITOOL pcitool>=0.2.0 REQUIRED)
pkg_check_variable(libuca plugindir)
+set(CPACK_SOURCE_GENERATOR "TBZ2")
+set(CPACK_PACKAGE_CONTACT "Suren A. Chilingaryan <csa@suren.me>")
+set(CPACK_PACKAGE_VERSION "${UCAUFO_VERSION}")
+set(CPACK_SOURCE_IGNORE_FILES "/.git/;/.bzr/;CMakeFiles;_CPack_Packages;cmake_install.cmake;CPack.*.cmake;CMakeCache.txt;install_manifest.txt;config.h$;.pc$;Makefile;.tar.bz2$;~$;${CPACK_SOURCE_IGNORE_FILES}")
+set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION}")
+include(CPack)
+
+add_custom_target(dist_clean COMMAND ${CMAKE_MAKE_PROGRAM} clean WORKING_DIRECTORY ${CMAKE_CURRENT_DIR})
+add_custom_target(dist DEPENDS dist_clean COMMAND ${CMAKE_MAKE_PROGRAM} package_source)
+
+
if (NOT DEFINED CMOSIS_SENSOR_WIDTH)
set(CMOSIS_SENSOR_WIDTH "2048")
endif ()
@@ -29,6 +43,9 @@ set(CMOSIS_SENSOR_HEIGHT ${CMOSIS_SENSOR_HEIGHT} CACHE STRING "Height of the sen
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
${CMAKE_CURRENT_BINARY_DIR}/config.h)
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ucaufo.spec.in
+ ${CMAKE_CURRENT_BINARY_DIR}/ucaufo.spec)
+
include_directories(
${UCA_INCLUDE_DIRS}
${PCITOOL_INCLUDE_DIRS}
diff --git a/uca-ufo-camera.c b/uca-ufo-camera.c
index a739e07..7470418 100644
--- a/uca-ufo-camera.c
+++ b/uca-ufo-camera.c
@@ -192,7 +192,7 @@ update_properties (UcaUfoCameraPrivate *priv)
reg = &description->registers[i];
- switch (reg->mode) {
+ switch (reg->mode&(PCILIB_REGISTER_RW|PCILIB_REGISTER_W1C|PCILIB_REGISTER_W1I)) {
case PCILIB_REGISTER_R:
flags = G_PARAM_READABLE;
break;
@@ -344,7 +344,7 @@ uca_ufo_camera_start_recording (UcaCamera *camera, GError **error)
err = pcilib_start (priv->handle, PCILIB_EVENT_DATA, PCILIB_EVENT_FLAGS_DEFAULT);
if (transfer_async)
- priv->async_thread = g_thread_create ((GThreadFunc) stream_async, camera, TRUE, error);
+ priv->async_thread = g_thread_new ("async-thread", (GThreadFunc) stream_async, camera);
if (err != 0) {
g_set_error (&priv->construct_error,
diff --git a/ucaufo.spec.in b/ucaufo.spec.in
new file mode 100644
index 0000000..d468413
--- /dev/null
+++ b/ucaufo.spec.in
@@ -0,0 +1,42 @@
+Summary: UFO Camera plugin for LibUCA
+Name: ucaufo
+Version: ${CPACK_PACKAGE_VERSION}
+Release: csa
+License: GPL-3.0
+Group: Development/Libraries
+Source: ${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.bz2
+BuildRoot: %{_tmppath}/%{name}-%{version}-root
+URL: http://darksoft.org
+Prefix: %{_prefix}
+Docdir: %{_docdir}
+Requires: libuca >= ${UCA_VERSION}
+BuildRequires: uthash-devel
+BuildRequires: libuca-devel libpcilib-devel
+BuildRequires: pkg-config libtool cmake
+Vendor: Institute for Data Processing and Electronics, KIT
+Packager: Suren A. Chilingaryan <csa@suren.me>
+
+%description
+This package provides an UFO Camera plugin for LibUCA.
+
+%prep
+%setup -q
+
+%build
+cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr .
+make
+
+%install
+rm -rf $RPM_BUILD_ROOT
+make install DESTDIR=$RPM_BUILD_ROOT
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-, root, root)
+${LIBUCA_PLUGINDIR}/libucaufo.so
+
+%changelog
+* Fri Mar 4 2016 Suren A. Chilingaryan <csa@suren.me> - ${CPACK_PACKAGE_VERSION}
+- Added spec file to the sources