From: Gui Chen Date: Fri, 4 Nov 2011 07:18:48 +0000 (+0800) Subject: install manpage in Makefile and update dist files X-Git-Tag: 0.3~31 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=51f5e46de4973a5b75b22e09a2dcac80d6d1b6c8;p=tools%2Fmic.git install manpage in Makefile and update dist files Signed-off-by: Gui Chen --- diff --git a/Makefile b/Makefile index 81659ab..e0ad4a5 100644 --- a/Makefile +++ b/Makefile @@ -11,10 +11,13 @@ else endif ifndef PREFIX - PREFIX = "/usr/local" + PREFIX = "/usr" endif -all: +all: build + +build: + rm -f mic/__version__.* $(PYTHON) setup.py build dist-common: man @@ -33,15 +36,20 @@ dist-gz: dist-common man: README.rst rst2man $< >mic.1 -install: all +installman: man + mkdir -p $(DESTDIR)/$(PREFIX)/share/man/man1 + install -m644 mic.1 $(DESTDIR)/$(PREFIX)/share/man/man1 + +install: $(PYTHON) setup.py install --prefix=$(DESTDIR)/$(PREFIX) -develop: all +develop: $(PYTHON) setup.py develop clean: rm -f *.tar.gz rm -f *.tar.bz2 + rm -f mic/__version__.* rm -f tools/*.py[co] rm -f mic.1 rm -rf *.egg-info diff --git a/distfiles/mic.spec b/distfiles/mic.spec new file mode 100644 index 0000000..48d2851 --- /dev/null +++ b/distfiles/mic.spec @@ -0,0 +1,102 @@ +# +# Do NOT Edit the Auto-generated Part! +# Generated by: spectacle version 0.22 +# +# >> macros +# << macros + +%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} +Name: mic +Summary: image creator for Linux distributions +Version: 0.1 +Release: 1 +Group: System/Base +License: GPLv2 +BuildArch: noarch +URL: http://www.tizen.org +Source0: %{name}-%{version}.tar.gz +Source100: mic.yaml +Requires: util-linux +Requires: coreutils +Requires: python >= 2.5 +Requires: e2fsprogs +Requires: dosfstools >= 2.11-8 +Requires: yum >= 3.2.24 +Requires: syslinux >= 3.82 +Requires: python-urlgrabber +Requires: kpartx +Requires: parted +Requires: device-mapper +Requires: /usr/bin/mkisofs +Requires: cpio +Requires: isomd5sum +Requires: gzip +Requires: bzip2 +Requires: squashfs-tools >= 4.0 +%if 0%{?suse_version} +Requires: btrfsprogs +%else +Requires: btrfs-progs +%endif +Requires: python-zypp >= 0.5.7 +BuildRequires: python-devel +BuildRoot: %{_tmppath}/%{name}-%{version}-build + + +%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} + +# >> setup +# << setup + +%build +# >> build pre +# << build pre + +CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build + +# >> build post +# << build post +%install +rm -rf $RPM_BUILD_ROOT +# >> install pre +# << install pre +%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 post +make DESTDIR=%{buildroot} installman +# << install post + + + + + + +%files +%defattr(-,root,root,-) +# >> files +%doc README.rst +%{_mandir}/man1/*.1.gz +%dir %{_sysconfdir}/%{name} +%config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf +%{python_sitelib}/* +%dir %{_prefix}/lib/%{name} +%{_prefix}/lib/%{name}/* +%{_bindir}/* +# << files + + diff --git a/distfiles/mic.yaml b/distfiles/mic.yaml new file mode 100644 index 0000000..59b0a3f --- /dev/null +++ b/distfiles/mic.yaml @@ -0,0 +1,42 @@ +Name: mic +Summary: image creator for Linux distributions +Version: 0.1 +Release: 1 +Group: System/Base +License: GPLv2 +URL: http://www.tizen.org +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. + +Sources: + - "%{name}-%{version}.tar.gz" +Builder: python +BuildArch: noarch +SupportOtherDistros: yes + +Requires: + - util-linux + - coreutils + - python >= 2.5 + - e2fsprogs + - dosfstools >= 2.11-8 + - yum >= 3.2.24 + - syslinux >= 3.82 + - kpartx + - parted + - device-mapper + - /usr/bin/mkisofs + - cpio + - isomd5sum + - gzip + - bzip2 + - squashfs-tools >= 4.0 + - btrfs-progs + - python-zypp >= 0.5.7 + +PkgBR: + - python-devel