Bump up to release 2.0.3
[tools/mic.git] / packaging / mic.spec
1 %define rc_version 0
2
3 %if 0%{?rc_version}
4 %define release_prefix 0.rc%{rc_version}.
5 %endif
6
7 Name:       mic
8 Summary:    Image Creator for Linux Distributions
9 Version:    2.0.3
10 Release:    %{?release_prefix}%{?opensuse_bs:<CI_CNT>.<B_CNT>}%{!?opensuse_bs:0}
11 Group:      Development/Tools
12 License:    GPLv2
13 BuildArch:  noarch
14 URL:        http://www.tizen.org
15 Source0:    %{name}_%{version}.tar.gz
16
17 Requires:   python3 >= 3.2
18
19 #Have integrated urlgrabber requests packages to mic source code.
20 #But urlgrabber depends python3-pycurl, requests depends python3-py
21 #Requires:   python3-urlgrabber >= 3.9.0
22 Requires:   python3-yum
23 #Requires:   python3-requests
24 Requires:   python3-py
25 Requires:   python3-rpm
26 Requires:   python3-pycurl
27 Requires:   python3-distro
28 Requires:   cpio
29 Requires:   file
30 # not neccessary
31 Requires:   gzip
32 Requires:   bzip2
33
34 BuildRequires:  python3-setuptools
35 BuildRequires:  python3-devel
36 %if ! 0%{?tizen_version:1}
37 BuildRequires:  python3-docutils
38 %endif
39
40 Obsoletes:  mic2
41
42 BuildRoot:  %{_tmppath}/%{name}_%{version}-build
43
44 %description
45 The tool mic is used to create and manipulate images for Linux distributions.
46 It is composed of three subcommand\: create, convert, chroot. Subcommand create
47 is used to create images with different types; subcommand convert is used to
48 convert an image to a specified type; subcommand chroot is used to chroot into
49 an image.
50
51 %prep
52 %setup -q -n %{name}-%{version}
53
54 %build
55 CFLAGS="$RPM_OPT_FLAGS" python3 setup.py build
56 make man
57
58 %install
59 rm -rf $RPM_BUILD_ROOT
60 %if 0%{?suse_version}
61 python3 setup.py install --root=$RPM_BUILD_ROOT --prefix=%{_prefix}
62 %else
63 python3 setup.py install --root=$RPM_BUILD_ROOT -O1
64 %endif
65
66 # install man page
67 mkdir -p %{buildroot}/%{_prefix}/share/man/man1
68 install -m644 doc/mic.1 %{buildroot}/%{_prefix}/share/man/man1
69
70 # install bash completion
71 install -d -m0755 %{buildroot}/%{_sysconfdir}/bash_completion.d/
72 install -Dp -m0755 etc/bash_completion.d/%{name}.sh %{buildroot}/%{_sysconfdir}/bash_completion.d/
73
74 # install zsh completion
75 install -d -m0755 %{buildroot}/%{_sysconfdir}/zsh_completion.d/
76 install -Dp -m0755 etc/zsh_completion.d/_%{name} %{buildroot}/%{_sysconfdir}/zsh_completion.d/
77
78 %files
79 %defattr(-,root,root,-)
80 %doc doc/*
81 %doc README.rst AUTHORS COPYING ChangeLog
82 %if ! 0%{?tizen_version:1}
83 %{_mandir}/man1/*
84 %endif
85 %dir %{_sysconfdir}/%{name}
86 %config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
87 %{python3_sitelib}/*
88 %dir %{_prefix}/lib/%{name}
89 %{_prefix}/lib/%{name}/*
90 %{_bindir}/mic
91 %{_sysconfdir}/bash_completion.d
92 %{_sysconfdir}/zsh_completion.d
93