summaryrefslogtreecommitdiff
path: root/packaging/mic.spec
blob: 741ee1fb276126a8667998c22f52bd4a9ac48e1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
Name:       mic
Summary:    Image Creator for Linux Distributions
Version:    0.19
Release:    0
Group:      System/Utilities
License:    GPL-2.0
BuildArch:  noarch
URL:        http://www.tizen.org
Source0:    %{name}_%{version}.tar.gz
Source1001: mic.manifest
Requires:   python-rpm
Requires:   util-linux
Requires:   coreutils
Requires:   python >= 2.5
Requires:   e2fsprogs
Requires:   dosfstools >= 2.11-8
Requires:   syslinux >= 3.82
Requires:   kpartx
Requires:   parted
Requires:   device-mapper
Requires:   /usr/bin/genisoimage
Requires:   cpio
#Requires:   isomd5sum
Requires:   gzip
Requires:   bzip2
Requires:   python-urlgrabber
Requires:   yum >= 3.2.24
%if ! 0%{?centos_version}
%if 0%{?suse_version}
Requires:   btrfsprogs
%else
Requires:   btrfs-progs
%endif
%endif

%if 0%{?suse_version}
Requires:   squashfs >= 4.0
Requires:   python-m2crypto
%else
Requires:   squashfs >= 4.0
Requires:   python-M2Crypto
%endif

%if 0%{?fedora_version} || 0%{?centos_version}
Requires:   syslinux-extlinux
%endif

%if 0%{?tizen_version:1}
Requires:   qemu-linux-user
%else
Requires:   qemu-arm-static
%endif

Requires:   python-zypp

BuildRequires:  python-devel
%if ! 0%{?tizen_version:1}
BuildRequires:  python-docutils
%endif

BuildRequires:fdupes



%description
The tool mic is used to create and manipulate images for Linux distributions.
It is composed of three subcommand\: create, convert, chroot. Subcommand create
is used to create images with different types; subcommand convert is used to
convert an image to a specified type; subcommand chroot is used to chroot into
an image.

%prep
%setup -q -n %{name}-%{version}
cp %{SOURCE1001} .

%build
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
%if ! 0%{?tizen_version:1}
make man
%endif

%install
rm -rf $RPM_BUILD_ROOT
%if 0%{?suse_version}
%{__python} setup.py install --root=$RPM_BUILD_ROOT --prefix=%{_prefix}
%else
%{__python} setup.py install --root=$RPM_BUILD_ROOT -O1
%endif

# install man page
mkdir -p %{buildroot}/%{_prefix}/share/man/man1
%if ! 0%{?tizen_version:1}
install -m644 doc/mic.1 %{buildroot}/%{_prefix}/share/man/man1
%endif

for script in utils/rpmmisc.py \
              kickstart/custom_commands/desktop.py \
              imager/liveusb.py  \
              kickstart/custom_commands/micboot.py  \
              utils/gpt_parser.py  \
              utils/cmdln.py \
              utils/runner.py  \
              kickstart/custom_commands/micrepo.py  \
              rt_util.py  \
              imager/fs.py  \
              utils/errors.py  \
              creator.py  \
              kickstart/custom_commands/partition.py  \
              kickstart/__init__.py  \
              msger.py  \
              utils/misc.py  \
              imager/loop.py  \
              pluginbase.py  \
              utils/fs_related.py  \
              utils/grabber.py  \
              bootstrap.py  \
              utils/proxy.py  \
              utils/partitionedfs.py  \
              imager/raw.py  \
              chroot.py  \
              conf.py  \
              plugin.py  \
              imager/livecd.py  ; do
    chmod a+x %{buildroot}%{python_sitelib}/%{name}/${script};
done

for script in backend/yumpkgmgr.py \
              imager/fs_plugin.py \
              imager/liveusb_plugin.py \
              imager/livecd_plugin.py \
              imager/raw_plugin.py \
              imager/loop_plugin.py ; do
    chmod a+x %{buildroot}%{_prefix}/lib/%{name}/plugins/${script};
done

%fdupes %{buildroot}



%files
%manifest %{name}.manifest
%defattr(-,root,root,-)
%license COPYING
%doc doc/*
%doc README.rst AUTHORS ChangeLog
%if ! 0%{?tizen_version:1}
%{_mandir}/man1/*
%endif
%dir %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
%{python_sitelib}/*
%dir %{_prefix}/lib/%{name}
%{_prefix}/lib/%{name}/*
%{_bindir}/*