Merge release-0.27.1 from 'tools/mic' tizen_0.27.1 accepted/tizen/common/20160923.160804 submit/tizen/20160923.060613
authorSoonKyu Park <sk7.park@samsung.com>
Fri, 23 Sep 2016 01:35:49 +0000 (10:35 +0900)
committerSoonKyu Park <sk7.park@samsung.com>
Fri, 23 Sep 2016 01:35:49 +0000 (10:35 +0900)
Change-Id: Ifba625f3902104e6a21e8340f5b292f0190057d7

1  2 
packaging/mic.spec

@@@ -1,60 -1,43 +1,52 @@@
+ %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
+ %{!?python_version: %define python_version %(%{__python} -c "import sys; sys.stdout.write(sys.version[:3])")}
+ %define rc_version 0
+ %if 0%{?rc_version}
+ %define release_prefix 0.rc%{rc_version}.
+ %endif
  Name:       mic
  Summary:    Image Creator for Linux Distributions
- Version:    0.19
- Release:    0
- Group:      System/Utilities
- License:    GPL-2.0
+ Version:    0.27.1
+ Release:    %{?release_prefix}%{?opensuse_bs:<CI_CNT>.<B_CNT>}%{!?opensuse_bs:0}
+ Group:      Development/Tools
+ License:    GPLv2
  BuildArch:  noarch
  URL:        http://www.tizen.org
- Source0:    %{name}-%{version}.tar.gz
+ Source0:    %{name}_%{version}.tar.gz
 +%if 0%{?tizen_version:1}
 +Source1001: mic.manifest
 +%endif
- 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
+ Requires:   python >= 2.6
+ Requires:   python-urlgrabber >= 3.9.0
+ %if 0%{?suse_version} || 0%{?tizen_version:1}
+ Requires:   python-xml
  %endif
+ %if "%{?python_version}" < "2.7"
+ Requires:   python-argparse
  %endif
  
- %if 0%{?suse_version}
- Requires:   squashfs >= 4.0
- Requires:   python-m2crypto
+ %if 0%{?tizen_version:1}
+ Requires:   python-rpm
  %else
- Requires:   squashfs >= 4.0
- Requires:   python-M2Crypto
+ Requires:   rpm-python
  %endif
  
- %if 0%{?fedora_version} || 0%{?centos_version}
- Requires:   syslinux-extlinux
- %endif
+ Requires:   cpio
+ # not neccessary
+ Requires:   gzip
+ Requires:   bzip2
  
- Requires:   python-zypp
 +%if 0%{?tizen_version:1}
 +Requires:   qemu-linux-user
 +%else
 +Requires:   qemu-arm-static
 +%endif
 +
  BuildRequires:  python-devel
  %if ! 0%{?tizen_version:1}
  BuildRequires:  python-docutils
@@@ -79,39 -59,32 +71,47 @@@ cp %{SOURCE1001} 
  
  %build
  CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
- %__make man
 +%if ! 0%{?tizen_version:1}
+ make man
 +%endif
  
  %install
 -rm -rf $RPM_BUILD_ROOT
 +rm -rf %{buildroot}
  %if 0%{?suse_version}
 -%{__python} setup.py install --root=$RPM_BUILD_ROOT --prefix=%{_prefix}
 +%{__python} setup.py install --root=%{buildroot} --prefix=%{_prefix}
  %else
 -%{__python} setup.py install --root=$RPM_BUILD_ROOT -O1
 +%{__python} setup.py install --root=%{buildroot} -O1
  %endif
  
  # install man page
- mkdir -p %{buildroot}%{_mandir}/man1
+ mkdir -p %{buildroot}/%{_prefix}/share/man/man1
 +%if ! 0%{?tizen_version:1}
- install -m644 doc/mic.1 %{buildroot}%{_mandir}/man1
+ install -m644 doc/mic.1 %{buildroot}/%{_prefix}/share/man/man1
 +%endif
  
+ # install bash completion
+ install -d -m0755 %{buildroot}/%{_sysconfdir}/bash_completion.d/
+ install -Dp -m0755 etc/bash_completion.d/%{name}.sh %{buildroot}/%{_sysconfdir}/bash_completion.d/
+ # install zsh completion
+ install -d -m0755 %{buildroot}/%{_sysconfdir}/zsh_completion.d/
+ install -Dp -m0755 etc/zsh_completion.d/_%{name} %{buildroot}/%{_sysconfdir}/zsh_completion.d/
 +%if ! 0%{?centos_version}
 +%fdupes %{buildroot}
 +%endif
 +
 +
  %files
 +%if 0%{?tizen_version:1}
 +%manifest %{name}.manifest
 +%endif
  %defattr(-,root,root,-)
 +%if ! (0%{?suse_version} || 0%{?centos_version})
 +%license COPYING
 +%endif
  %doc doc/*
 -%doc README.rst AUTHORS COPYING ChangeLog
 +%doc README.rst AUTHORS ChangeLog
  %if ! 0%{?tizen_version:1}
  %{_mandir}/man1/*
  %endif