Tizen 2.0 Release
[framework/system/dlog.git] / packaging / dlog.spec
1 Name:       dlog
2 Summary:    Logging service
3 Version:    0.4.1
4 Release:    4
5 Group:      System/Libraries
6 License:    Apache License, Version 2.0
7 Source0:    %{name}-%{version}.tar.gz
8 Source101:  dlog-main.service
9 Source102:  dlog-radio.service
10 Source103:  tizen-debug-level.service
11 BuildRequires: pkgconfig(libsystemd-journal)
12 Requires(post): /usr/bin/vconftool
13 Requires(post): coreutils
14
15 %description
16 dlog API library
17
18 %package -n libdlog
19 Summary:    Logging service dlog API
20 Group:      Development/Libraries
21
22 %description -n libdlog
23 dlog API library
24
25 %package -n libdlog-devel
26 Summary:    Logging service dlog API
27 Group:      Development/Libraries
28 Requires:   lib%{name} = %{version}-%{release}
29
30 %description -n libdlog-devel
31 dlog API library
32
33
34 %package -n dlogutil
35 Summary:    print log data to the screen
36 Group:      Development/Libraries
37 Requires:   lib%{name} = %{version}-%{release}
38 Requires(post): /usr/bin/systemctl
39 Requires(postun): /usr/bin/systemctl
40 Requires(preun): /usr/bin/systemctl
41
42 %description -n dlogutil
43 Utilities for print log data
44
45
46
47 %prep
48 %setup -q
49
50
51 %build
52 %autogen --disable-static
53 %configure --disable-static
54 make %{?jobs:-j%jobs}
55
56 %install
57 rm -rf %{buildroot}
58 %make_install
59 mkdir -p %{buildroot}/opt/etc/
60 cp %{_builddir}/%{name}-%{version}/.dloglevel %{buildroot}/opt/etc/.dloglevel
61 mkdir -p %{buildroot}/etc/profile.d/
62 cp %{_builddir}/%{name}-%{version}/tizen_platform_env.sh %{buildroot}/etc/profile.d/tizen_platform_env.sh
63 mkdir -p %{buildroot}/usr/bin/
64 cp %{_builddir}/%{name}-%{version}/dlogctrl %{buildroot}/usr/bin/dlogctrl
65
66 mkdir -p %{buildroot}/%{_sysconfdir}/rc.d/rc3.d
67 rm -f %{buildroot}/%{_sysconfdir}/etc/rc.d/rc3.d/S05dlog
68 ln -s ../init.d/dlog.sh %{buildroot}/%{_sysconfdir}/rc.d/rc3.d/S05dlog
69
70 mkdir -p %{buildroot}%{_libdir}/systemd/system/basic.target.wants
71 mkdir -p %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants
72
73 install -m 0644 %SOURCE101 %{buildroot}%{_libdir}/systemd/system/
74 install -m 0644 %SOURCE102 %{buildroot}%{_libdir}/systemd/system/
75 install -m 0644 %SOURCE103 %{buildroot}%{_libdir}/systemd/system/
76
77 ln -s ../dlog-main.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/dlog-main.service
78 ln -s ../dlog-radio.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/dlog-radio.service
79 ln -s ../tizen-debug-level.service %{buildroot}%{_libdir}/systemd/system/basic.target.wants/tizen-debug-level.service
80
81 mkdir -p %{buildroot}/usr/share/license
82 cp LICENSE.APLv2 %{buildroot}/usr/share/license/%{name}
83
84 mkdir -p %{buildroot}/opt/etc/dlog
85
86 %preun -n dlogutil
87 if [ $1 == 0 ]; then
88     systemctl stop dlog-main.service
89     systemctl stop dlog-radio.service
90 fi
91
92 %post -n dlogutil
93 systemctl daemon-reload
94 if [ $1 == 1 ]; then
95     systemctl restart dlog-main.service
96     systemctl restart dlog-radio.service
97 fi
98
99 %postun -n dlogutil
100 systemctl daemon-reload
101
102 %post -n libdlog -p /sbin/ldconfig
103 %postun -n libdlog -p /sbin/ldconfig
104
105 %files  -n dlogutil
106 %manifest dlogutil.manifest
107 %{_bindir}/dlogutil
108 %attr(775,root,root) %{_bindir}/dlogctrl
109 %{_sysconfdir}/rc.d/init.d/dlog.sh
110 %{_sysconfdir}/rc.d/rc3.d/S05dlog
111 %{_libdir}/systemd/system/tizen-debug-level.service
112 %{_libdir}/systemd/system/dlog-main.service
113 %{_libdir}/systemd/system/dlog-radio.service
114 %{_libdir}/systemd/system/basic.target.wants/tizen-debug-level.service
115 %{_libdir}/systemd/system/multi-user.target.wants/dlog-main.service
116 %{_libdir}/systemd/system/multi-user.target.wants/dlog-radio.service
117 %attr(775,root,app) %dir /opt/etc/dlog
118
119 %files  -n libdlog
120 /usr/share/license/%{name}
121 %doc LICENSE.APLv2
122 /opt/etc/.dloglevel
123 /etc/profile.d/tizen_platform_env.sh
124 %{_libdir}/libdlog.so.0
125 %{_libdir}/libdlog.so.0.0.0
126
127 %files -n libdlog-devel
128 %{_includedir}/dlog/dlog.h
129 %{_libdir}/pkgconfig/dlog.pc
130 %{_libdir}/libdlog.so
131