Fix systemd and DBus configuaration, fix bus name
[platform/core/appfw/tizen-theme-manager.git] / packaging / tizen-theme-manager.spec
1 Name:       tizen-theme-manager
2 Summary:    Tizen Theme Manager
3 Version:    0.0.1
4 Release:    1
5 Group:      Application Framework/Package Management
6 License:    Apache-2.0
7 Source0:    %{name}-%{version}.tar.gz
8 Source1001: %{name}.manifest
9 Source1002: %{name}.service
10 Source1003: %{name}.conf
11 BuildRequires:  cmake
12 BuildRequires:  pkgconfig(bundle)
13 BuildRequires:  pkgconfig(dlog)
14 BuildRequires:  pkgconfig(glib-2.0)
15 BuildRequires:  pkgconfig(gobject-2.0)
16 BuildRequires:  pkgconfig(gmock)
17 BuildRequires:  pkgconfig(jsoncpp)
18 BuildRequires:  pkgconfig(pkgmgr-parser)
19 BuildRequires:  pkgconfig(pkgmgr-info)
20 BuildRequires:  pkgconfig(pkgmgr-installer)
21 BuildRequires:  pkgconfig(sqlite3)
22
23 %if 0%{?gcov:1}
24 BuildRequires:  lcov
25 BuildRequires:  zip
26 %endif
27
28 %description
29 Tizen Theme Manager
30
31
32 %prep
33 %setup -q
34 cp %{SOURCE1001} .
35
36 %build
37 %if 0%{?gcov:1}
38 export CFLAGS+=" -fprofile-arcs -ftest-coverage"
39 export CXXFLAGS+=" -fprofile-arcs -ftest-coverage"
40 export FFLAGS+=" -fprofile-arcs -ftest-coverage"
41 export LDFLAGS+=" -lgcov"
42 %endif
43
44 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
45 %cmake . -DCMAKE_VERBOSE_MAKEFILE:BOOL=%{?verbose_make:ON}%{!?verbose_make:OFF} \
46          -DUNITDIR=%{_unitdir} \
47          -DFULLVER=%{version} \
48          -DMAJORVER=${MAJORVER}
49
50 %__make %{?_smp_mflags}
51
52 %if 0%{?gcov:1}
53 mkdir -p gcov-obj
54 find . -name '*.gcno' ! -path './gcov-obj/*' -exec cp '{}' gcov-obj ';'
55 %endif
56
57 %check
58 export LD_LIBRARY_PATH=../../src/theme:../../src/theme_provider:../../src/theme_plugin
59 ctest -V
60 %if 0%{?gcov:1}
61 lcov -c --ignore-errors graph --no-external -q -d . -o tizen-theme-manager.info
62 genhtml tizen-theme-manager.info -o tizen-theme-manager.out
63 zip -r tizen-theme-manager.zip tizen-theme-manager.out
64 install -m 0644 tizen-theme-manager.zip %{buildroot}%{_datadir}/gcov/
65 %endif
66
67 %install
68 %make_install
69
70 install -m 755 -d %{buildroot}%{_unitdir}
71 install -m 644 %{SOURCE1002} %{buildroot}%{_unitdir}
72 install -m 755 -d %{buildroot}%{_sysconfdir}/dbus-1/system.d
73 install -m 644 %{SOURCE1003} %{buildroot}%{_sysconfdir}/dbus-1/system.d
74
75 %if 0%{?gcov:1}
76 mkdir -p %{buildroot}%{_datadir}/gcov/obj
77 install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj
78 %endif
79
80 %post
81 /sbin/ldconfig
82 systemctl reenable %{name}
83
84 %preun
85 systemctl disable %{name}
86
87 %postun
88 /sbin/ldconfig
89
90 %files
91 %defattr(-,root,root,-)
92 %manifest %{name}.manifest
93 %license LICENSE
94 %{_bindir}/*
95 %{_libdir}/libtizen-theme.so
96 %{_libdir}/libtizen-theme-provider.so
97 %{_sysconfdir}/package-manager/parserlib/metadata/libtizen-theme-plugin.so
98 %{_datarootdir}/parser-plugins/tizen-theme-plugin.info
99 %{_unitdir}/%{name}.service
100 %{_sysconfdir}/dbus-1/system.d/%{name}.conf
101
102 #################################################
103 # tizen-theme-manager-gcov
104 #################################################
105 %if 0%{?gcov:1}
106 %package gcov
107 Summary:    Simple string key-val dictionary ADT (gcov)
108 Group:      Application Framework/Testing
109
110 %description gcov
111 Simple string key-val dictionary ADT gcov objects
112 %endif
113
114 %if 0%{?gcov:1}
115 %files gcov
116 %defattr(-,root,root,-)
117 %{_datadir}/gcov/*
118 %endif