Skip to content

Commit

Permalink
Add pack-handle codes for generating deb package. (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
BruceDai authored Sep 18, 2016
1 parent 1508245 commit 55b990c
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 0 deletions.
21 changes: 21 additions & 0 deletions packaging/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
PKG_NAME := testkit-lite
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

11 changes: 11 additions & 0 deletions packaging/testkit-lite.dsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Source: testkit-lite
Section: utils
Priority: standard
Maintainer: Bruce Dai <feng.dai@intel.com>
Build-Depends: debhelper (>= 8.0.0), python-setuptools, python-support (>= 0.8.4)
Standards-Version: 3.9.2
Homepage: https://github.com/testkit/testkit-lite
Version: 3.1.18
Files:
15082459086308f1b4f188e7833cabcf6255efd5 1398131 testkit-lite_3.1.18.tar.gz

52 changes: 52 additions & 0 deletions packaging/testkit-lite.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
Summary: TCT-Lite
Name: testkit-lite
Version: 3.1.18
Release: 1
License: GPLv2
Group: Applications/System
Source: %{name}_%{version}.tar.gz

BuildRequires: python-distribute

%{!?python_sitelib: %define python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}

%description
testkit-lite is a test runner with command-line interface.It has the following functions
1. Accepts .xml test case descriptor files as input.
2. drives automatic test execution.
3. provide multiple options to meet various test requirements.

%prep
%setup -q

%build

%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
# remove tests
rm -rf %{buildroot}/%{python_sitelib}/tests

%clean
rm -rf %{buildroot}

%post
# Set permissions
chmod ugo+rwx /opt/testkit/lite

%files
%{python_sitelib}/testkitlite/*
%{python_sitelib}/testkit_lite-*.egg-info/*
/etc/dbus-1/system.d/com.intel.testkit.conf
/opt/testkit/lite/VERSION
/opt/testkit/lite/commodule/CONFIG
/opt/testkit/lite/mh.html
%{_bindir}/testkit-lite
%{_bindir}/testkit-lite-dbus
%defattr(-,root,root)

%doc
/opt/testkit/lite/testkit-lite_user_guide.pdf
/opt/testkit/lite/testkit-lite_tutorial.pdf
/opt/testkit/lite/test_definition_schema.pdf

%changelog

0 comments on commit 55b990c

Please sign in to comment.