Upload initial source
[platform/core/system/argos_watchdog.git] / packaging / argos_watchdog.spec
1 %define libsystemd on
2 %define test off
3
4 Name:       argos_watchdog
5 Summary:    ARGOS library to detect application malfunctions
6 Version:    0.0.1
7 Release:    0
8 Group:      System/Libraries
9 License:    Apache-2.0
10 Source0:    %{name}-%{version}.tar.gz
11 Source1:    %{name}.manifest
12 Requires(post): /sbin/ldconfig
13 Requires(postun): /sbin/ldconfig
14 BuildRequires:  cmake
15 %if %{?libsystemd} == on
16 BuildRequires: pkgconfig(libsystemd)
17 %endif
18
19 %description
20 ARGOS library to detect application malfunctions
21
22 %package devel
23 Summary:    ARGOS library to detect application malfunctions (Development)
24 Group:    System/Development
25 Requires: %{name} = %{version}-%{release}
26
27 %description devel
28 ARGOS library to detect application malfunctions (devel)
29
30 %prep
31 %setup -q
32
33 %build
34 cp %{SOURCE1} .
35 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
36
37 cmake . \
38         -DCMAKE_INSTALL_PREFIX=%{_prefix} \
39         -DFULLVER=%{version} \
40         -DMAJORVER=${MAJORVER} \
41         -DLIBSYSTEMD=%{libsystemd} \
42         -DTEST=%{test}
43
44 make
45
46 %install
47 rm -rf %{buildroot}
48 %make_install
49
50 mkdir -p %{buildroot}%{_datadir}/license
51 cp LICENSE %{buildroot}%{_datadir}/license/%{name}
52
53 %post -p /sbin/ldconfig
54
55 %postun -p /sbin/ldconfig
56
57 %files
58 %defattr(-,root,root,-)
59 %{_libdir}/lib%{name}.so.*
60 %{_datadir}/license/%{name}
61 %manifest %{name}.manifest
62
63 %files devel
64 %defattr(-,root,root,-)
65 %{_includedir}/%{name}/*.h
66 %{_libdir}/pkgconfig/%{name}.pc
67 %{_libdir}/lib%{name}.so
68 %manifest %{name}.manifest
69 %if %{?test} == on
70 %{_bindir}/argos-test
71 /usr/lib/systemd/system/argos-test.service
72 %endif