Skip to content

Commit

Permalink
support: add .rpm and .deb packaging files
Browse files Browse the repository at this point in the history
  • Loading branch information
strohel committed Oct 11, 2011
1 parent a899da8 commit 2f4c63e
Show file tree
Hide file tree
Showing 5 changed files with 189 additions and 0 deletions.
5 changes: 5 additions & 0 deletions support/debian/debian.changelog
@@ -0,0 +1,5 @@
python-pybayes (0.3-1) stable; urgency=low

* Initial Release

-- Matej Laitl <matej@laitl.cz> Mon, 3 Oct 2011 21:00:00 +0100
15 changes: 15 additions & 0 deletions support/debian/debian.control
@@ -0,0 +1,15 @@
Source: python-pybayes
Section: python
Priority: optional
Maintainer: Matej Laitl <matej@laitl.cz>
Build-Depends: debhelper (>= 4.1.16), libatlas-base-dev, python-numpy, python-dev (>= 2.6), cython (>=0.14.1)
Package: python-pybayes
Architecture: any
Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends}
Provides: ${python:Provides}
Description: Python library for recursive Bayesian estimation (Bayesian filtering)
PyBayes is an object-oriented Python library for recursive Bayesian
estimation (Bayesian filtering) that is convenient to use. Already implemented are
Kalman filter, particle filter and marginalized particle filter, all built atop of
a light framework of probability density functions. PyBayes can optionally use Cython
for lage speed gains (Cython build can be several times faster in some situations).
89 changes: 89 additions & 0 deletions support/debian/debian.rules
@@ -0,0 +1,89 @@
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1

# This is the debhelper compatibility version to use.
export DH_COMPAT=5

# So that build environment does not change (breaks build)
export PYTHONDONTWRITEBYTECODE=x

CFLAGS = -g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif

build: build-stamp
build-stamp:
dh_testdir

# Add here commands to compile the package.
python setup.py --use-cython=yes build test
# --- end custom part for compiling

touch build-stamp

clean:
dh_testdir
dh_testroot
rm -f build-stamp

# Add here commands to clean up after the build process.
python setup.py clean
# --- end custom part for cleaning up

dh_clean

install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs

# Add here commands to install the package
# The DESTDIR Has To Be Exactly /usr/src/packages/BUILD/debian/<nameOfPackage>
# --prefix=???
python setup.py install --root=/usr/src/packages/BUILD/debian/python-pybayes
# --- end custom part for installing

# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.

# Build architecture-dependent files here.
binary-arch: build install
dh_testdir
dh_testroot
# dh_installdebconf
dh_installdocs
dh_installexamples
dh_installmenu
# dh_installlogrotate
# dh_installemacsen
# dh_installpam
# dh_installmime
# dh_installinit
dh_installcron
dh_installman
dh_installinfo
# dh_undocumented
dh_installchangelogs
dh_link
dh_strip
dh_compress
dh_fixperms
# dh_makeshlibs
dh_installdeb
# dh_perl
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary installing
9 changes: 9 additions & 0 deletions support/debian/python-pybayes.dsc
@@ -0,0 +1,9 @@
Format: 1.0
Source: python-pybayes
Version: 0.3.9999-1
Binary: python-pybayes
Maintainer: Matej Laitl <matej@laitl.cz>
Architecture: any
Build-Depends: debhelper (>= 4.1.16), libatlas-base-dev, python-numpy, python-dev (>= 2.6), cython (>=0.14.1)
Files:
ffffffffffffffffffffffffffffffff 0 PyBayes-0.3.tar.gz
71 changes: 71 additions & 0 deletions support/rpm/python-pybayes.spec
@@ -0,0 +1,71 @@
#
# spec file for package python-pybayes
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name: python-pybayes
Version: 0.3.9999
Release: 0
Url: https://github.com/strohel/PyBayes
Summary: Python library for recursive Bayesian estimation (Bayesian filtering)
License: GPL-2.0
Group: Development/Languages/Python
Source: https://github.com/downloads/strohel/PyBayes/PyBayes-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-build

BuildRequires: python-devel >= 2.6
BuildRequires: python-cython >= 0.14.1

%if 0%{?fedora}
BuildRequires: numpy >= 1.5.0
%else
BuildRequires: python-numpy-devel >= 1.5.0
%endif

# following provides both clapack.h, cblas.h, cblas.so and lapack.so
BuildRequires: atlas-devel

%if 0%{?suse_version}
%py_requires
%endif

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

%description
PyBayes is an object-oriented Python library for recursive Bayesian estimation (Bayesian filtering)
that is convenient to use. Already implemented are Kalman filter, particle filter and marginalized
particle filter, all built atop of a light framework of probability density functions. PyBayes can
optionally use Cython for lage speed gains (Cython build can be several times faster in some
situations).

%prep
%setup -q -n PyBayes-%{version}

%build
python setup.py --use-cython=yes build build_prepare --blas-lib cblas --lapack-lib lapack_atlas

%check
python setup.py --use-cython=yes test

%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}

%files
%defattr(-,root,root,-)
%doc README.rst HACKING.rst ChangeLog.rst
%{python_sitelib}/*

%changelog

0 comments on commit 2f4c63e

Please sign in to comment.