relocate dist files and add change log
[platform/upstream/mic.git] / packaging / mic.spec
1 %define is_tizen %(test -e /etc/tizen-release -o -e /etc/meego-release && echo 1 || echo 0)
2 %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
3 Name:       mic
4 Summary:    Image Creator for Linux Distributions
5 Version:    0.15
6 Release:    1
7 Group:      System/Base
8 License:    GPLv2
9 BuildArch:  noarch
10 URL:        http://www.tizen.org
11 Source0:    %{name}-%{version}.tar.gz
12 Requires:   rpm-python
13 Requires:   util-linux
14 Requires:   coreutils
15 Requires:   python >= 2.5
16 Requires:   e2fsprogs
17 Requires:   dosfstools >= 2.11-8
18 Requires:   syslinux >= 3.82
19 Requires:   kpartx
20 Requires:   parted
21 Requires:   device-mapper
22 Requires:   /usr/bin/genisoimage
23 Requires:   cpio
24 Requires:   isomd5sum
25 Requires:   gzip
26 Requires:   bzip2
27 Requires:   squashfs-tools >= 4.0
28 Requires:   qemu-arm-static
29 Requires:   python-urlgrabber
30 %if 0%{is_tizen} == 0
31 Requires:   yum >= 3.2.24
32 %endif
33 %if 0%{?suse_version}
34 Requires:   btrfsprogs
35 %else
36 Requires:   btrfs-progs
37 %endif
38
39 %if 0%{?fedora_version} || 0%{is_tizen} == 1
40 Requires:   m2crypto
41 %else
42 %if 0%{?suse_version} == 1210
43 Requires:   python-M2Crypto
44 %else
45 Requires:   python-m2crypto
46 %endif
47 %endif
48
49 %if 0%{?fedora_version} > 13 || 0%{is_tizen} == 1
50 Requires:   syslinux-extlinux
51 %endif
52
53 Requires:   python-zypp
54 BuildRequires:  python-devel
55
56 Obsoletes:  mic2
57
58 BuildRoot:  %{_tmppath}/%{name}-%{version}-build
59
60
61 %description
62 The tool mic is used to create and manipulate images for Linux distributions.
63 It is composed of three subcommand\: create, convert, chroot. Subcommand create
64 is used to create images with different types; subcommand convert is used to
65 convert an image to a specified type; subcommand chroot is used to chroot into
66 an image.
67
68
69 %prep
70 %setup -q -n %{name}-%{version}
71
72 %build
73 CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
74
75
76 %install
77 rm -rf $RPM_BUILD_ROOT
78 %if 0%{?suse_version}
79 %{__python} setup.py install --root=$RPM_BUILD_ROOT --prefix=%{_prefix}
80 %else
81 %{__python} setup.py install --root=$RPM_BUILD_ROOT -O1
82 %endif
83
84 # install man page
85 # remove yum backend for tizen
86 %if 0%{is_tizen} == 1
87 rm -rf %{buildroot}/%{_prefix}/lib/%{name}/plugins/backend/yumpkgmgr.py
88 rm -rf %{buildroot}/%{_sysconfdir}/%{name}/bootstrap.conf
89 %endif
90 mkdir -p %{buildroot}/%{_prefix}/share/man/man1
91 install -m644 doc/mic.1 %{buildroot}/%{_prefix}/share/man/man1
92
93 %files
94 %defattr(-,root,root,-)
95 %doc README.rst
96 %{_mandir}/man1/*
97 %dir %{_sysconfdir}/%{name}
98 %config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
99 %if 0%{is_tizen} == 0
100 %config %{_sysconfdir}/%{name}/bootstrap.conf
101 %endif
102 %{python_sitelib}/*
103 %dir %{_prefix}/lib/%{name}
104 %{_prefix}/lib/%{name}/*
105 %{_bindir}/*