Release version 0.3.22
[platform/core/appfw/badge.git] / packaging / badge.spec
1 Name:       badge
2 Summary:    Badge library
3 Version:    0.3.22
4 Release:    1
5 Group:      Applications/Core Applications
6 License:    Apache-2.0
7 Source0:    %{name}-%{version}.tar.gz
8 BuildRequires: pkgconfig(aul)
9 BuildRequires: pkgconfig(dbus-1)
10 BuildRequires: pkgconfig(dlog)
11 BuildRequires: pkgconfig(vconf)
12 BuildRequires: pkgconfig(capi-appfw-package-manager)
13 BuildRequires: pkgconfig(db-util)
14 BuildRequires: pkgconfig(libtzplatform-config)
15 BuildRequires: pkgconfig(pkgmgr-info)
16 BuildRequires: pkgconfig(libsmack)
17 BuildRequires: pkgconfig(capi-system-info)
18 BuildRequires: pkgconfig(gio-2.0)
19 BuildRequires: pkgconfig(gmock)
20
21 %if 0%{?gcov:1}
22 BuildRequires:  lcov
23 BuildRequires:  zip
24 %endif
25
26 BuildRequires: cmake
27 Requires(post): /sbin/ldconfig
28 requires(postun): /sbin/ldconfig
29
30 %description
31 Client/Server library for updating badge information
32
33 %package devel
34 Summary:    Badge library (devel)
35 Group:      Development/Libraries
36 Requires:   %{name} = %{version}-%{release}
37
38 %description devel
39 Development files needed to build software that needs to system a system badge.
40
41 %package service-devel
42 Summary:    Badge library (service-devel)
43 Group:      Development/Libraries
44 Requires:   %{name} = %{version}-%{release}
45
46 %description service-devel
47 Development files needed to build badge service
48
49 #################################################
50 # badge-unittests
51 #################################################
52 %package -n badge_unittests
53 Summary:    GTest for badge API
54 Group:      Development/Libraries
55 Requires:   %{name}
56
57 %description -n badge_unittests
58 GTest for badge API
59
60 #################################################
61 # gcov
62 #################################################
63 %if 0%{?gcov:1}
64 %package gcov
65 Summary:  Badge library (gcov)
66 Group:    System/API
67
68 %description gcov
69 gcov objects of a Badge library
70 %endif
71
72 %prep
73 %setup -q
74
75 %build
76 %if 0%{?gcov:1}
77 export CFLAGS+=" -fprofile-arcs -ftest-coverage"
78 export CXXFLAGS+=" -fprofile-arcs -ftest-coverage"
79 export FFLAGS+=" -fprofile-arcs -ftest-coverage"
80 export LDFLAGS+=" -lgcov"
81 %endif
82
83 export LDFLAGS+=" -Wl,--rpath=%{_prefix}/lib -Wl,--as-needed"
84 LDFLAGS="$LDFLAGS"
85 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
86 %cmake . \
87         -DMAJORVER=${MAJORVER} \
88         -DFULLVER=%{version}
89 make %{?jobs:-j%jobs}
90
91 %if 0%{?gcov:1}
92 mkdir -p gcov-obj
93 find . -name '*.gcno' -exec cp '{}' gcov-obj ';'
94 %endif
95
96 %check
97 export LD_LIBRARY_PATH=../../src
98 ctest -V
99 %if 0%{?gcov:1}
100 lcov -c --ignore-errors graph --no-external -q -d . -o badge.info
101 genhtml badge.info -o badge.out
102 zip -r badge.zip badge.out
103 install -m 0644 badge.zip %{buildroot}%{_datadir}/gcov/badge.zip
104 %endif
105
106 %install
107
108 %make_install
109
110 %if 0%{?gcov:1}
111 mkdir -p %{buildroot}%{_datadir}/gcov/obj/%{name}
112 install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj/%{name}
113 %endif
114
115 %post
116 /sbin/ldconfig
117
118 if [ ! -d %{TZ_SYS_DB} ]
119 then
120         mkdir -p %{TZ_SYS_DB}
121 fi
122
123 %postun -p /sbin/ldconfig
124
125 %files
126 %manifest badge.manifest
127 %defattr(-,root,root,-)
128 %{_libdir}/libbadge.so.*
129 %license LICENSE
130 %{_includedir}/badge/badge.h
131 %{_includedir}/badge/badge_error.h
132 %{_includedir}/badge/badge_internal.h
133 %{_includedir}/badge/badge_setting.h
134 %{_includedir}/badge/badge_setting_service.h
135 %{_includedir}/badge/badge_ipc.h
136 %attr(755,root,root) %{_sysconfdir}/gumd/useradd.d/11_badge-add.post
137 %{_bindir}/badge_init
138
139 %files devel
140 %defattr(-,root,root,-)
141 %{_includedir}/badge/badge.h
142 %{_includedir}/badge/badge_error.h
143 %{_includedir}/badge/badge_internal.h
144 %{_includedir}/badge/badge_db.h
145 %{_includedir}/badge/badge_setting.h
146 %{_includedir}/badge/badge_setting_service.h
147 %{_includedir}/badge/badge_ipc.h
148 %{_libdir}/pkgconfig/%{name}.pc
149 %{_libdir}/libbadge.so
150
151 #################################################
152 # badge-gcov
153 #################################################
154 %if 0%{?gcov:1}
155 %files gcov
156 %{_datadir}/gcov/*
157 %endif
158 # End of a file