Support /dev/mapper/rootfs root device
[platform/core/system/storaged.git] / packaging / storaged.spec
1 #These options are DEACTIVATED by default.
2 %bcond_with emulator
3 %define extended_storage 0
4
5 Name:       storaged
6 Summary:    Storaged
7 Version:    1.0.0
8 Release:    1
9 Group:      System/Management
10 License:    Apache-2.0
11 Source0:    %{name}-%{version}.tar.gz
12 Source1:    %{name}.manifest
13
14 BuildRequires:  cmake
15 BuildRequires:  pkgconfig(vconf)
16 BuildRequires:  pkgconfig(dlog)
17 BuildRequires:  pkgconfig(capi-base-common)
18 BuildRequires:  pkgconfig(libudev)
19 BuildRequires:  pkgconfig(gio-2.0)
20 BuildRequires:  pkgconfig(glib-2.0)
21 BuildRequires:  pkgconfig(libtzplatform-config)
22 BuildRequires:  pkgconfig(capi-system-info)
23 BuildRequires:  pkgconfig(capi-system-device)
24 BuildRequires:  pkgconfig(argos_watchdog)
25 BuildRequires:  pkgconfig(libsystemd)
26 BuildRequires:  pkgconfig(storage)
27 BuildRequires:  pkgconfig(app2sd)
28 BuildRequires:  pkgconfig(blkid)
29 BuildRequires:  pkgconfig(mount)
30 BuildRequires:  pkgconfig(libsyscommon)
31 BuildRequires:  pkgconfig(json-c)
32 BuildRequires:  pkgconfig(devmapper)
33
34 BuildRequires:  pkgconfig(capi-ui-efl-util)
35 BuildRequires:  pkgconfig(capi-appfw-application)
36 BuildRequires:  pkgconfig(capi-appfw-preference)
37 BuildRequires:  pkgconfig(capi-appfw-app-control)
38 BuildRequires:  pkgconfig(capi-system-system-settings)
39 BuildRequires:  pkgconfig(efl-extension)
40 %if %{extended_storage}
41 BuildRequires:  pkgconfig(ode)
42 %endif
43
44 #For /usr/bin/msgfmt
45 BuildRequires: gettext-tools
46
47 Requires(post): /usr/bin/vconftool
48
49 Requires: /usr/bin/fsck_msdosfs
50 Requires: /usr/bin/newfs_msdos
51
52 %description
53 storage daemon.
54
55 %package  module_block
56 Summary:  block module plugin
57 Requires: %{name} = %{version}-%{release}
58 %description module_block
59 block module plugin
60
61 %package  module_storage
62 Summary:  storage module plugin
63 Requires: %{name} = %{version}-%{release}
64 %description module_storage
65 storage module plugin
66
67 %package  org.tizen.extended-sd
68 Summary:  App to setup sdcard
69 Requires: %{name} = %{version}-%{release}
70 %description org.tizen.extended-sd
71 App to setup sdcard
72
73 %package auto-test
74 Summary:  Storaged auto test tool
75 Group:    System/Utilities
76 %description auto-test
77 Storaged helper programs.
78 This package can be installed optional for auto dbus test.
79
80 %prep
81 %setup -q
82 %if %{with emulator}
83         %define ARCH emulator
84 %else
85         %ifarch %{arm} aarch64
86                 %define ARCH arm
87         %else
88                 %define ARCH x86
89         %endif
90 %endif
91
92 %ifarch %{arm} %ix86
93         %define ARCH_BIT 32
94 %else
95         %define ARCH_BIT 64
96 %endif
97
98 %define APP_PREFIX    "/usr/apps/org.tizen.extended-sd"
99
100 %cmake . \
101         -DTZ_SYS_ETC=%TZ_SYS_ETC \
102         -DCMAKE_INSTALL_PREFIX=%{_prefix} \
103         -DCMAKE_INSTALL_APP_PREFIX=%{APP_PREFIX} \
104         -DAPP_INSTALL_PREFIX="%{TZ_SYS_RO_APP}" \
105         -DAPP_SHARE_PACKAGES_DIR="%{TZ_SYS_RO_PACKAGES}" \
106         -DARCH=%{ARCH} \
107         -DARCH_BIT=%{ARCH_BIT} \
108         -DPROFILE=mobile \
109         -DBLOCK_MODULE=on \
110         -DBLOCK_TMPFS=on \
111         -DSTORAGE_MODULE=on \
112         -DEXTENDED_STORAGE=%{extended_storage} \
113         #eol
114
115 %build
116 cp %{SOURCE1} .
117
118 make %{?jobs:-j%jobs}
119
120 %install
121 rm -rf %{buildroot}
122 %make_install
123
124 %install_service delayed.target.wants storaged.service
125
126 %find_lang extended-sd
127
128 %post
129 systemctl daemon-reload
130 if [ "$1" == "1" ]; then
131     systemctl restart storaged.service
132 fi
133
134 %postun
135 systemctl daemon-reload
136
137 %files
138 %manifest %{name}.manifest
139 %license LICENSE.Apache-2.0
140 %config %{_sysconfdir}/dbus-1/system.d/org.tizen.system.storage.conf
141 %{_datadir}/dbus-1/system-services/org.tizen.system.storage.service
142 %{_unitdir}/delayed.target.wants/storaged.service
143 %{_unitdir}/storaged.service
144 %{_bindir}/storaged
145
146 %files module_block
147 %manifest %{name}.manifest
148 %license LICENSE.Apache-2.0
149 %{_libdir}/storaged/module_block.so
150 %{_bindir}/mmc-smack-label
151 %config %{_sysconfdir}/storaged/block.conf
152
153 %files module_storage
154 %manifest %{name}.manifest
155 %license LICENSE.Apache-2.0
156 %{_libdir}/storaged/module_storage.so
157 %config %{_sysconfdir}/storaged/storage.conf
158
159 %files org.tizen.extended-sd -f extended-sd.lang
160 %manifest %{name}.manifest
161 %license LICENSE.Apache-2.0
162 %defattr(-,root,root,-)
163 %{TZ_SYS_RO_APP}/org.tizen.extended-sd/bin/*
164 %{TZ_SYS_RO_APP}/org.tizen.extended-sd/res/*
165 %{TZ_SYS_RO_PACKAGES}/org.tizen.extended-sd.xml
166 %{TZ_SYS_RO_APP}/org.tizen.extended-sd/res/edje/extended-sd.edj
167
168 %files auto-test
169 %license LICENSE.Apache-2.0
170 %manifest %{name}.manifest
171 %{_bindir}/storaged-auto-test