Integrated mic with "OTC Tools Tester" Jenkins machinery
authorEd Bartosh <eduard.bartosh@intel.com>
Thu, 4 Oct 2012 14:42:09 +0000 (17:42 +0300)
committerEd Bartosh <eduard.bartosh@intel.com>
Sat, 24 Nov 2012 18:24:33 +0000 (20:24 +0200)
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 <eduard.bartosh@intel.com>
debian/changelog [moved from packaging/debian.changelog with 100% similarity]
debian/compat [moved from packaging/debian/compat with 100% similarity]
debian/control [moved from packaging/debian/control with 97% similarity]
debian/copyright [moved from packaging/debian/copyright with 100% similarity]
debian/docs [moved from packaging/debian/docs with 100% similarity]
debian/rules [moved from packaging/debian/rules with 93% similarity]
packaging/Makefile [new file with mode: 0644]
packaging/mic.dsc
packaging/mic.spec
tests/mic-test.py

similarity index 100%
rename from packaging/debian.changelog
rename to debian/changelog
similarity index 100%
rename from packaging/debian/compat
rename to debian/compat
similarity index 97%
rename from packaging/debian/control
rename to debian/control
index b34aa3e..082cfdc 100644 (file)
@@ -2,7 +2,7 @@ Source: mic
 Section: devel
 Priority: extra
 Maintainer: Jian-feng Ding <jian-feng.ding@intel.com>
-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
 
similarity index 100%
rename from packaging/debian/copyright
rename to debian/copyright
similarity index 100%
rename from packaging/debian/docs
rename to debian/docs
similarity index 93%
rename from packaging/debian/rules
rename to debian/rules
index af51936..5346591 100755 (executable)
@@ -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 (file)
index 0000000..ae431d6
--- /dev/null
@@ -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
+
index fb825ab..63ac08b 100644 (file)
@@ -6,4 +6,6 @@ Version: 0.15
 Maintainer: Jian-feng Ding <jian-feng.ding@intel.com>
 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
index 6082ea2..a8a1485 100644 (file)
@@ -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,-)
index b44cc67..efb775a 100644 (file)
@@ -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"""