add requires for cElementTree module
[tools/mic.git] / packaging / mic.spec
1 %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
2
3 %define rc_version 0
4
5 %if 0%{?rc_version}
6 %define release_prefix 0.rc%{rc_version}.
7 %endif
8
9 Name:       mic
10 Summary:    Image Creator for Linux Distributions
11 Version:    0.24.3
12 Release:    %{?release_prefix}%{?opensuse_bs:<CI_CNT>.<B_CNT>}%{!?opensuse_bs:0}
13 Group:      Development/Tools
14 License:    GPLv2
15 BuildArch:  noarch
16 URL:        http://www.tizen.org
17 Source0:    %{name}_%{version}.tar.gz
18
19 Requires:   python >= 2.6
20 Requires:   python-urlgrabber >= 3.9.0
21 %if 0%{?tizen_version:1}
22 Requires:   python-rpm
23 %else
24 Requires:   rpm-python
25 %endif
26
27 Requires:   cpio
28 # not neccessary
29 Requires:   gzip
30 Requires:   bzip2
31
32 BuildRequires:  python-devel
33 %if ! 0%{?tizen_version:1}
34 BuildRequires:  python-docutils
35 %endif
36
37 Obsoletes:  mic2
38
39 BuildRoot:  %{_tmppath}/%{name}_%{version}-build
40
41 %description
42 The tool mic is used to create and manipulate images for Linux distributions.
43 It is composed of three subcommand\: create, convert, chroot. Subcommand create
44 is used to create images with different types; subcommand convert is used to
45 convert an image to a specified type; subcommand chroot is used to chroot into
46 an image.
47
48 %package native
49 Summary:    Native support for mic
50 Requires:   util-linux
51 Requires:   coreutils
52 Requires:   psmisc
53 Requires:   e2fsprogs
54 Requires:   dosfstools >= 2.11
55 Requires:   kpartx
56 Requires:   parted
57 Requires:   device-mapper
58 Requires:   syslinux >= 3.82
59 %if ! 0%{?suse_version}
60 Requires:   syslinux-extlinux >= 3.82
61 %endif
62
63 %if 0%{?suse_version} || 0%{?tizen_version:1}
64 Requires:   python-xml
65 Requires:   squashfs >= 4.0
66 Requires:   python-m2crypto
67 %else
68 Requires:   python-libs
69 Requires:   squashfs-tools >= 4.0
70 Requires:   m2crypto
71 %endif
72
73 %if 0%{?suse_version} || 0%{?tizen_version:1}
74 Requires:   /usr/bin/qemu-arm
75 %else
76 Requires:   qemu-arm-static
77 %endif
78
79 %if ! 0%{?tizen_version:1}
80 Requires:   isomd5sum
81 Requires:   /usr/bin/genisoimage
82 %endif
83
84 Requires:   yum >= 3.2.24
85 %if 0%{?tizen_version:1}
86 Requires:   python-zypp
87 %else
88 Requires:   python-zypp-tizen
89 %endif
90
91 Requires:   mic
92
93 #%if 0%{?suse_version}
94 #Requires:   btrfsprogs
95 #%else
96 #Requires:   btrfs-progs
97 #%endif
98
99 %description native
100 The native support package for mic, it includes all requirements
101 for mic native running.
102
103 %prep
104 %setup -q -n %{name}-%{version}
105
106 %build
107 CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
108 make man
109
110 %install
111 rm -rf $RPM_BUILD_ROOT
112 %if 0%{?suse_version}
113 %{__python} setup.py install --root=$RPM_BUILD_ROOT --prefix=%{_prefix}
114 %else
115 %{__python} setup.py install --root=$RPM_BUILD_ROOT -O1
116 %endif
117
118 # install man page
119 mkdir -p %{buildroot}/%{_prefix}/share/man/man1
120 install -m644 doc/mic.1 %{buildroot}/%{_prefix}/share/man/man1
121
122 # install bash completion
123 install -d -m0755 %{buildroot}/%{_sysconfdir}/bash_completion.d/
124 install -Dp -m0755 etc/bash_completion.d/%{name}.sh %{buildroot}/%{_sysconfdir}/bash_completion.d/
125
126 # install zsh completion
127 install -d -m0755 %{buildroot}/%{_sysconfdir}/zsh_completion.d/
128 install -Dp -m0755 etc/zsh_completion.d/_%{name} %{buildroot}/%{_sysconfdir}/zsh_completion.d/
129
130 install -Dp -m0755 tools/mic %{buildroot}/%{_bindir}/mic-native
131
132 %files
133 %defattr(-,root,root,-)
134 %doc doc/*
135 %doc README.rst AUTHORS COPYING ChangeLog
136 %if ! 0%{?tizen_version:1}
137 %{_mandir}/man1/*
138 %endif
139 %dir %{_sysconfdir}/%{name}
140 %config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
141 %{python_sitelib}/*
142 %dir %{_prefix}/lib/%{name}
143 %{_prefix}/lib/%{name}/*
144 %{_bindir}/mic
145 %{_sysconfdir}/bash_completion.d
146 %{_sysconfdir}/zsh_completion.d
147
148 %files native
149 %{_bindir}/mic-native