Tizen 2.4 SDK Rev6 Release
[framework/system/dlog.git] / packaging / dlog.spec
1 Name:       dlog
2 Summary:    Logging service
3 Version:    0.4.1
4 Release:    15
5 Group:      System/Libraries
6 License:    Apache-2.0
7 Source0:    %{name}-%{version}.tar.gz
8 Source101:  packaging/dlogutil.manifest
9 Source102:  packaging/libdlog.manifest
10 Source201:  packaging/dlog.conf.in
11 Source202:  packaging/dlog_logger.conf.in
12 Source203:  packaging/dlog_logger.conf-micro.in
13 Source204:  packaging/dlog_logger.conf-micro-debug.in
14 Source301:  packaging/dlog_logger.service
15 Source302:  packaging/dlog_logger.path
16 BuildRequires: autoconf
17 BuildRequires: automake
18 BuildRequires: libtool
19 %if "%{HAVE_SYSTEMD_JOURNAL}" == "yes"
20 BuildRequires: pkgconfig(libsystemd-journal)
21 %endif
22 BuildRequires: pkgconfig(capi-base-common)
23 Requires(post): coreutils
24
25 %description
26 dlog API library
27
28 %package -n libdlog
29 Summary:    Logging service dlog API
30 Group:      Development/Libraries
31 Requires(post): smack-utils
32
33 %description -n libdlog
34 dlog API library
35
36 %package -n libdlog-devel
37 Summary:    Logging service dlog API
38 Group:      Development/Libraries
39 Requires:   lib%{name} = %{?epoch:%{epoch}:}%{version}-%{release}
40
41 %description -n libdlog-devel
42 dlog API library
43
44
45 %package -n dlogutil
46 Summary:    print log data to the screen
47 Group:      Development/Libraries
48 Requires:   lib%{name} = %{?epoch:%{epoch}:}%{version}-%{release}
49 Requires(post): /usr/bin/systemctl
50 Requires(postun): /usr/bin/systemctl
51 Requires(preun): /usr/bin/systemctl
52
53 %description -n dlogutil
54 Utilities for print log data
55
56 %prep
57 %setup -q
58
59 %build
60 cp %{SOURCE101} .
61 cp %{SOURCE102} .
62 %autogen --disable-static
63 %configure --disable-static \
64 %if 0%{?tizen_build_binary_release_type_daily}
65                         --enable-fatal_on \
66 %endif
67 %if 0%{?tizen_build_binary_release_type_eng}
68                         --enable-engineer_mode \
69 %endif
70 %if 0%{?sec_build_binary_debug_enable}
71                         --enable-debug_enable \
72 %endif
73                         --without-systemd-journal
74 make %{?jobs:-j%jobs}
75
76 %install
77 rm -rf %{buildroot}
78 %make_install
79 mkdir -p %{buildroot}/usr/bin/
80 cp %{_builddir}/%{name}-%{version}/scripts/dlogctrl %{buildroot}/usr/bin/dlogctrl
81
82 mkdir -p %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/
83 install -m 0644 %SOURCE301 %{buildroot}%{_libdir}/systemd/system/
84 install -m 0644 %SOURCE302 %{buildroot}%{_libdir}/systemd/system/
85
86 ln -s ../dlog_logger.path %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/dlog_logger.path
87
88 mkdir -p %{buildroot}/usr/share/license
89 cp LICENSE.Apache-2.0 %{buildroot}/usr/share/license/%{name}
90 cp LICENSE.Apache-2.0 %{buildroot}/usr/share/license/libdlog
91 cp LICENSE.Apache-2.0 %{buildroot}/usr/share/license/dlogutil
92
93 mkdir -p %{buildroot}/opt/etc
94 cp %SOURCE201 %{buildroot}/opt/etc/dlog.conf
95
96 # default set log output to external files
97 cp %SOURCE202 %{buildroot}/opt/etc/dlog_logger.conf
98
99 %preun -n dlogutil
100
101 %post -n dlogutil
102 systemctl daemon-reload
103
104 %postun -n dlogutil
105 systemctl daemon-reload
106
107 %post -n libdlog
108 /sbin/ldconfig
109
110 %postun -n libdlog
111 /sbin/ldconfig
112
113 %files
114 /usr/share/license/%{name}
115
116 %files  -n dlogutil
117 %manifest dlogutil.manifest
118 /usr/share/license/dlogutil
119 %attr(755,root,app_logging) %{_bindir}/dlog_logger
120 %attr(755,root,app_logging) %{_bindir}/dlogutil
121 %attr(755,root,app_logging) %{_bindir}/dlogctrl
122 %attr(755,root,app_logging) /opt/etc/dlog_logger.conf
123 %{_libdir}/systemd/system/dlog_logger.service
124 %{_libdir}/systemd/system/dlog_logger.path
125 %{_libdir}/systemd/system/multi-user.target.wants/dlog_logger.path
126
127
128 %files  -n libdlog
129 %manifest libdlog.manifest
130 /usr/share/license/libdlog
131 %{_libdir}/libdlog.so.0
132 %{_libdir}/libdlog.so.0.0.0
133 %attr(664,root,app_logging) /opt/etc/dlog.conf
134
135 %files -n libdlog-devel
136 %{_includedir}/dlog/dlog.h
137 %{_includedir}/dlog/dlog-internal.h
138 %{_libdir}/pkgconfig/dlog.pc
139 %{_libdir}/libdlog.so
140