summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.bzrignore4
-rw-r--r--CMakeLists.txt19
-rw-r--r--base.c1
-rw-r--r--cmosis.c1
-rw-r--r--data.c1
-rw-r--r--events.c1
-rw-r--r--ipecamera.spec.in55
-rw-r--r--reader.c1
8 files changed, 82 insertions, 1 deletions
diff --git a/.bzrignore b/.bzrignore
index 0a0d69c..28a6932 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -6,3 +6,7 @@ install_manifest.txt
grab
ipecamera.pc
version.h
+CPackConfig.cmake
+CPackSourceConfig.cmake
+_CPack_Packages
+ipecamera.spec
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7e38bd9..053ae3f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,6 @@
-project(ipecamera)
+project(ipecamera C)
+set(RELEASE "0")
set(IPECAMERA_VERSION "0.0.1")
set(IPECAMERA_ABI_VERSION "0")
@@ -53,6 +54,21 @@ set(PACKAGE_TARNAME "${TARNAME}")
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
set(PACKAGE_BUGREPORT "http://ufo.kit.edu/ufo/newticket")
+set(CPACK_SOURCE_GENERATOR "TBZ2")
+set(CPACK_PACKAGE_CONTACT "Suren A. Chilingaryan <csa@suren.me>")
+if (${RELEASE} GREATER 0)
+ set(CPACK_PACKAGE_VERSION "${PACKAGE_VERSION}.${RELEASE}")
+else (${RELEASE} GREATER 0)
+ set(CPACK_PACKAGE_VERSION "${PACKAGE_VERSION}")
+endif (${RELEASE} GREATER 0)
+set(CPACK_SOURCE_IGNORE_FILES "/.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 BIN_INSTALL_DIR)
set(BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin")
endif(NOT DEFINED BIN_INSTALL_DIR)
@@ -67,6 +83,7 @@ endif(NOT DEFINED INCLUDE_INSTALL_DIR)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ipecamera.pc.in ${CMAKE_CURRENT_BINARY_DIR}/ipecamera.pc)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h)
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ipecamera.spec.in ${CMAKE_CURRENT_BINARY_DIR}/ipecamera.spec)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/ipecamera.pc
diff --git a/base.c b/base.c
index 92b62d9..24682d5 100644
--- a/base.c
+++ b/base.c
@@ -1,4 +1,5 @@
#define _IPECAMERA_IMAGE_C
+#define _DEFAULT_SOURCE
#define _BSD_SOURCE
#define _GNU_SOURCE
diff --git a/cmosis.c b/cmosis.c
index 5d98c14..0733d84 100644
--- a/cmosis.c
+++ b/cmosis.c
@@ -1,3 +1,4 @@
+#define _DEFAULT_SOURCE
#define _BSD_SOURCE
#define _IPECAMERA_MODEL_C
#include <stdio.h>
diff --git a/data.c b/data.c
index 04a4be1..8f681e9 100644
--- a/data.c
+++ b/data.c
@@ -1,3 +1,4 @@
+#define _DEFAULT_SOURCE
#define _BSD_SOURCE
#define _GNU_SOURCE
diff --git a/events.c b/events.c
index 76c274b..6220961 100644
--- a/events.c
+++ b/events.c
@@ -1,3 +1,4 @@
+#define _DEFAULT_SOURCE
#define _BSD_SOURCE
#define _GNU_SOURCE
diff --git a/ipecamera.spec.in b/ipecamera.spec.in
new file mode 100644
index 0000000..b0cf2a1
--- /dev/null
+++ b/ipecamera.spec.in
@@ -0,0 +1,55 @@
+Summary: UFO Camera plugin for pcitool
+Name: ${PACKAGE_NAME}
+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: libpcilib ipecamera-scripts
+BuildRequires: 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 event engine for the pcilib platform.
+
+%package devel
+Summary: UFO Camera plugin for pcitool
+Group: Development/Libraries
+Requires: ${PACKAGE_NAME} = %{version}
+Requires: libpcilib-devel
+
+%description devel
+Development files provide access to some non-standard features of the event engine.
+
+%prep
+%setup -q
+
+%build
+cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DLIB_INSTALL_DIR=%{_libdir} -DBIN_INSTALL_DIR=%{_bindir} -DDATA_INSTALL_DIR=%{_datadir} -DINCLUDE_INSTALL_DIR=%{_includedir} .
+make
+
+%install
+rm -rf $RPM_BUILD_ROOT
+make install DESTDIR=$RPM_BUILD_ROOT
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-, root, root)
+${PCILIB_PLUGIN_DIR}/lib${PACKAGE_NAME}.so
+
+%files -n ${PACKAGE_NAME}-devel
+%defattr(-, root, root)
+%{_includedir}/*
+%{_libdir}/pkgconfig/*.pc
+
+%changelog
+* Fri Mar 4 2016 Suren A. Chilingaryan <csa@suren.me> - ${CPACK_PACKAGE_VERSION}
+- Added spec file to the sources
diff --git a/reader.c b/reader.c
index 0799a18..b28c51a 100644
--- a/reader.c
+++ b/reader.c
@@ -1,3 +1,4 @@
+#define _DEFAULT_SOURCE
#define _BSD_SOURCE
#define _GNU_SOURCE