From: Ed Bartosh Date: Thu, 4 Oct 2012 14:42:09 +0000 (+0300) Subject: Integrated mic with "OTC Tools Tester" Jenkins machinery X-Git-Tag: 0.16~81 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aaee947d5ad2c0efdbcb270346c5176647686c88;p=tools%2Fmic.git Integrated mic with "OTC Tools Tester" Jenkins machinery OTC Tester expects that cd packaging/ && make all produces all needed packaging files. This change makes it happen. Beside of that tests/mic-test.py was fixed, because Tools Tester job runs nose if tests/ directory presents in the source tree and expects some tests results. Results were not generated, so fake test has been added there. Change-Id: I08f7b5c6012fbefef640177bce13c301fcf826c0 Signed-off-by: Ed Bartosh --- diff --git a/packaging/debian.changelog b/debian/changelog similarity index 100% rename from packaging/debian.changelog rename to debian/changelog diff --git a/packaging/debian/compat b/debian/compat similarity index 100% rename from packaging/debian/compat rename to debian/compat diff --git a/packaging/debian/control b/debian/control similarity index 97% rename from packaging/debian/control rename to debian/control index b34aa3e..082cfdc 100644 --- a/packaging/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: mic Section: devel Priority: extra Maintainer: Jian-feng Ding -Build-Depends: debhelper (>= 7.0.15), cdbs, python-dev, python-support +Build-Depends: debhelper (>= 7.0.15), cdbs, python-dev, python-support, python-docutils Standards-Version: 3.8.0 Homepage: http://www.tizen.org diff --git a/packaging/debian/copyright b/debian/copyright similarity index 100% rename from packaging/debian/copyright rename to debian/copyright diff --git a/packaging/debian/docs b/debian/docs similarity index 100% rename from packaging/debian/docs rename to debian/docs diff --git a/packaging/debian/rules b/debian/rules similarity index 93% rename from packaging/debian/rules rename to debian/rules index af51936..5346591 100755 --- a/packaging/debian/rules +++ b/debian/rules @@ -8,6 +8,7 @@ build-stamp: dh_testdir python setup.py build + make man clean: dh_testdir @@ -24,7 +25,7 @@ install: build # Installing package mkdir -p $(CURDIR)/debian/mic $(CURDIR)/debian/mic/usr/bin $(CURDIR)/debian/mic/usr/share/man/man1 - install -m644 doc/mic.1 $(CURDIR)/debian/mic/usr/share/man/man1 + install -m644 mic.1 $(CURDIR)/debian/mic/usr/share/man/man1 #make DESTDIR=$(CURDIR)/debian/mic installman #make DESTDIR=$(CURDIR)/debian/micng installconf #make DESTDIR=$(CURDIR)/debian/micng installsymlinks diff --git a/packaging/Makefile b/packaging/Makefile new file mode 100644 index 0000000..ae431d6 --- /dev/null +++ b/packaging/Makefile @@ -0,0 +1,21 @@ +PKG_NAME := mic +SPECFILE = $(addsuffix .spec, $(PKG_NAME)) +PKG_VERSION := $(shell grep '^Version: ' $(SPECFILE)|awk '{print $$2}') + +TARBALL := $(PKG_NAME)_$(PKG_VERSION).tar.gz + +dsc: $(TARBALL) + $(eval MD5=$(shell md5sum $(TARBALL) | sed "s/ / $(shell stat -c '%s' $(TARBALL)) /")) + @sed -i 's/^Version:.*/Version: $(PKG_VERSION)/' $(PKG_NAME).dsc + @sed -i 's/ [a-f0-9]\+ [0-9]\+ $(PKG_NAME).*tar.*/ $(MD5)/' $(PKG_NAME).dsc + +$(TARBALL): + cd "$$(git rev-parse --show-toplevel)" \ + && git archive --prefix $(PKG_NAME)-$(PKG_VERSION)/ HEAD \ + | gzip > "$(CURDIR)/$(TARBALL)" + +clean: + rm -f $(PKG_NAME)*.tar.gz + +all: clean dsc + diff --git a/packaging/mic.dsc b/packaging/mic.dsc index fb825ab..63ac08b 100644 --- a/packaging/mic.dsc +++ b/packaging/mic.dsc @@ -6,4 +6,6 @@ Version: 0.15 Maintainer: Jian-feng Ding Homepage: http://www.tizen.org Standards-Version: 3.8.0 -Build-Depends: debhelper (>= 7.0.15), dpatch, cdbs, python-dev, python-support +Build-Depends: debhelper (>= 7.0.15), dpatch, cdbs, python-dev, python-support, python-docutils +Files: + 1f266944838a142e657aa0244e7f15e5 1684957 mic_0.15.tar.gz diff --git a/packaging/mic.spec b/packaging/mic.spec index 6082ea2..a8a1485 100644 --- a/packaging/mic.spec +++ b/packaging/mic.spec @@ -8,7 +8,7 @@ Group: System/Base License: GPLv2 BuildArch: noarch URL: http://www.tizen.org -Source0: %{name}-%{version}.tar.gz +Source0: %{name}_%{version}.tar.gz Requires: rpm-python Requires: util-linux Requires: coreutils @@ -51,11 +51,13 @@ Requires: syslinux-extlinux %endif Requires: python-zypp + BuildRequires: python-devel +BuildRequires: python-docutils Obsoletes: mic2 -BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildRoot: %{_tmppath}/%{name}_%{version}-build %description @@ -71,7 +73,7 @@ an image. %build CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build - +make man %install rm -rf $RPM_BUILD_ROOT @@ -81,14 +83,15 @@ rm -rf $RPM_BUILD_ROOT %{__python} setup.py install --root=$RPM_BUILD_ROOT -O1 %endif -# install man page # remove yum backend for tizen %if 0%{is_tizen} == 1 rm -rf %{buildroot}/%{_prefix}/lib/%{name}/plugins/backend/yumpkgmgr.py rm -rf %{buildroot}/%{_sysconfdir}/%{name}/bootstrap.conf %endif + +# install man page mkdir -p %{buildroot}/%{_prefix}/share/man/man1 -install -m644 doc/mic.1 %{buildroot}/%{_prefix}/share/man/man1 +install -m644 mic.1 %{buildroot}/%{_prefix}/share/man/man1 %files %defattr(-,root,root,-) diff --git a/tests/mic-test.py b/tests/mic-test.py index b44cc67..efb775a 100644 --- a/tests/mic-test.py +++ b/tests/mic-test.py @@ -3,7 +3,7 @@ import unittest import os, sys, glob, tempfile, shutil from testbase import * -class MICTest(unittest.TestCase): +class TestMIC(unittest.TestCase): cases_dir = "mic_cases" if os.path.isdir(cases_dir): for case in glob.glob(os.path.join(cases_dir,'test-*')): @@ -19,6 +19,13 @@ def test_%s(self): def tearDown(self): shutil.rmtree(self.work_env, ignore_errors = True) + + def test_stub(self): + """ + Empty test just to make nose to run at least one test. + without tests but with tests/ directory Jenkins job will fail. + """ + assert True def _testTemplate(self, case): """test function"""