bump up to release 0.26
[platform/upstream/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.26
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%{?suse_version} || 0%{?tizen_version:1}
22 Requires:   python-xml
23 %endif
24
25 %if 0%{?tizen_version:1}
26 Requires:   python-rpm
27 %else
28 Requires:   rpm-python
29 %endif
30
31 Requires:   cpio
32 # not neccessary
33 Requires:   gzip
34 Requires:   bzip2
35
36 BuildRequires:  python-devel
37 %if ! 0%{?tizen_version:1}
38 BuildRequires:  python-docutils
39 %endif
40
41 Obsoletes:  mic2
42
43 BuildRoot:  %{_tmppath}/%{name}_%{version}-build
44
45 %description
46 The tool mic is used to create and manipulate images for Linux distributions.
47 It is composed of three subcommand\: create, convert, chroot. Subcommand create
48 is used to create images with different types; subcommand convert is used to
49 convert an image to a specified type; subcommand chroot is used to chroot into
50 an image.
51
52 %package native
53 Summary:    Native support for mic
54 Requires:   util-linux
55 Requires:   coreutils
56 Requires:   psmisc
57 Requires:   e2fsprogs
58 Requires:   dosfstools >= 2.11
59 Requires:   kpartx
60 Requires:   parted
61 Requires:   device-mapper
62 Requires:   syslinux >= 3.82
63 %if ! 0%{?suse_version}
64 Requires:   syslinux-extlinux >= 3.82
65 %endif
66
67 %if 0%{?suse_version} || 0%{?tizen_version:1}
68 Requires:   squashfs >= 4.0
69 Requires:   python-m2crypto
70 %else
71 Requires:   python-libs
72 Requires:   squashfs-tools >= 4.0
73 Requires:   m2crypto
74 %endif
75
76 %if 0%{?suse_version} || 0%{?tizen_version:1}
77 Requires:   /usr/bin/qemu-arm
78 %else
79 Requires:   qemu-arm-static
80 %endif
81
82 %if ! 0%{?tizen_version:1}
83 Requires:   isomd5sum
84 Requires:   /usr/bin/genisoimage
85 %endif
86
87 Requires:   yum >= 3.2.24
88 %if 0%{?tizen_version:1}
89 Requires:   python-zypp
90 %else
91 Requires:   python-zypp-tizen
92 %endif
93
94 Requires:   mic
95
96 #%if 0%{?suse_version}
97 #Requires:   btrfsprogs
98 #%else
99 #Requires:   btrfs-progs
100 #%endif
101
102 %description native
103 The native support package for mic, it includes all requirements
104 for mic native running.
105
106 %prep
107 %setup -q -n %{name}-%{version}
108
109 %build
110 CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
111 make man
112
113 %install
114 rm -rf $RPM_BUILD_ROOT
115 %if 0%{?suse_version}
116 %{__python} setup.py install --root=$RPM_BUILD_ROOT --prefix=%{_prefix}
117 %else
118 %{__python} setup.py install --root=$RPM_BUILD_ROOT -O1
119 %endif
120
121 # install man page
122 mkdir -p %{buildroot}/%{_prefix}/share/man/man1
123 install -m644 doc/mic.1 %{buildroot}/%{_prefix}/share/man/man1
124
125 # install bash completion
126 install -d -m0755 %{buildroot}/%{_sysconfdir}/bash_completion.d/
127 install -Dp -m0755 etc/bash_completion.d/%{name}.sh %{buildroot}/%{_sysconfdir}/bash_completion.d/
128
129 # install zsh completion
130 install -d -m0755 %{buildroot}/%{_sysconfdir}/zsh_completion.d/
131 install -Dp -m0755 etc/zsh_completion.d/_%{name} %{buildroot}/%{_sysconfdir}/zsh_completion.d/
132
133 install -Dp -m0755 tools/mic %{buildroot}/%{_bindir}/mic-native
134
135 %files
136 %defattr(-,root,root,-)
137 %doc doc/*
138 %doc README.rst AUTHORS COPYING ChangeLog
139 %if ! 0%{?tizen_version:1}
140 %{_mandir}/man1/*
141 %endif
142 %dir %{_sysconfdir}/%{name}
143 %config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
144 %{python_sitelib}/*
145 %dir %{_prefix}/lib/%{name}
146 %{_prefix}/lib/%{name}/*
147 %{_bindir}/mic
148 %{_sysconfdir}/bash_completion.d
149 %{_sysconfdir}/zsh_completion.d
150
151 %files native
152 %{_bindir}/mic-native