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