summaryrefslogtreecommitdiff
path: root/packaging/tidl.spec
blob: 5f41e933ac4b260a91af5d817a435f76bab2ba4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
Name:       tidl
Summary:    Tizen Interface Definition Language
Version:    1.2.10
Release:    1
Group:      Application Framework/Building
License:    Apache-2.0
Source0:    %{name}-%{version}.tar.gz
Source1001: %{name}.manifest
Source1002: %{name}-tests.manifest

Requires(post):   /sbin/ldconfig
Requires(postun): /sbin/ldconfig

BuildRequires:  cmake
BuildRequires:  flex
BuildRequires:  bison
BuildRequires:  gtest-devel
BuildRequires:  pkgconfig(glib-2.0)
%if 0%{?gcov:1}
BuildRequires:  lcov
%endif

%description
Tizen Interface Definition Language

%package tests
Summary:    Unit tests for TIDL
Requires:   %{name} = %{version}

%description tests
Unit tests for TIDL

%define _share_dir /opt/usr/share

%prep
%setup -q
cp %{SOURCE1001} .
cp %{SOURCE1002} .

%build
%if 0%{?gcov:1}
export CFLAGS+=" -fprofile-arcs -ftest-coverage"
export CXXFLAGS+=" -fprofile-arcs -ftest-coverage"
export FFLAGS+=" -fprofile-arcs -ftest-coverage"
export LDFLAGS+=" -lgcov"
%endif

MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
%__make %{?_smp_mflags}

%install
rm -rf %{buildroot}
%make_install

%check
ctest --output-on-failure %{?_smp_mflags}
%if 0%{?gcov:1}
lcov -c --ignore-errors graph --no-external -q -d . -o gcov.info
genhtml gcov.info
%endif

%preun

%post
/sbin/ldconfig

%postun
/sbin/ldconfig

%files
%license LICENSE
%manifest %{name}.manifest
%{_bindir}/tidlc

%files tests
%manifest %{name}.manifest
%{_bindir}/*
%{_share_dir}/*