Drop mic native support
[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.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
53 %prep
54 %setup -q -n %{name}-%{version}
55
56 %build
57 CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
58 make man
59
60 %install
61 rm -rf $RPM_BUILD_ROOT
62 %if 0%{?suse_version}
63 %{__python} setup.py install --root=$RPM_BUILD_ROOT --prefix=%{_prefix}
64 %else
65 %{__python} setup.py install --root=$RPM_BUILD_ROOT -O1
66 %endif
67
68 # install man page
69 mkdir -p %{buildroot}/%{_prefix}/share/man/man1
70 install -m644 doc/mic.1 %{buildroot}/%{_prefix}/share/man/man1
71
72 # install bash completion
73 install -d -m0755 %{buildroot}/%{_sysconfdir}/bash_completion.d/
74 install -Dp -m0755 etc/bash_completion.d/%{name}.sh %{buildroot}/%{_sysconfdir}/bash_completion.d/
75
76 # install zsh completion
77 install -d -m0755 %{buildroot}/%{_sysconfdir}/zsh_completion.d/
78 install -Dp -m0755 etc/zsh_completion.d/_%{name} %{buildroot}/%{_sysconfdir}/zsh_completion.d/
79
80 %files
81 %defattr(-,root,root,-)
82 %doc doc/*
83 %doc README.rst AUTHORS COPYING ChangeLog
84 %if ! 0%{?tizen_version:1}
85 %{_mandir}/man1/*
86 %endif
87 %dir %{_sysconfdir}/%{name}
88 %config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
89 %{python_sitelib}/*
90 %dir %{_prefix}/lib/%{name}
91 %{_prefix}/lib/%{name}/*
92 %{_bindir}/mic
93 %{_sysconfdir}/bash_completion.d
94 %{_sysconfdir}/zsh_completion.d
95