Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add package with debug symbols #15

Open
wants to merge 2 commits into
base: debian/experimental
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
amalgamation
build
*.pyc
.pybuild/
dist/
MANIFEST
debian/python-sqlcipher
debian/python-sqlcipher-dbg
debian/*.log
debian/files
debian/*.substvars
Expand Down
13 changes: 12 additions & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Maintainer: Ben Carrillo <[email protected]>
Section: python
Priority: optional
Build-Depends: python-all-dev (>= 2.6.6-3), libsqlcipher-dev (>=2.2.1-2~), debhelper (>= 9)
Standards-Version: 3.9.4
Standards-Version: 3.9.6
Uploaders: Micah Anderson <[email protected]>
X-Python-Version: >= 2.5

Expand All @@ -17,3 +17,14 @@ Description: DB-API 2.0 interface for SQLCIPHER 3.x
database engine. It is almost fully compliant with the Python database API
version 2.0. At the same time, it also exposes the unique features of
SQLCipher.

Package: python-sqlcipher-dbg
Section: debug
Priority: extra
Architecture: any
Depends: python-dbg, python-sqlcipher, libsqlcipher0 (>=2.2.1-2),
${misc:Depends}, ${python:Depends}, ${shlibs:Depends}
Description: DB-API 2.0 interface for SQLCIPHER 3.x
Python interface to SQLCipher (debug extension)
.
This package contains the extensions built for the python debug interpreter.
22 changes: 11 additions & 11 deletions debian/copyright
Original file line number Diff line number Diff line change
Expand Up @@ -6,47 +6,47 @@ Source: <http://github.com/leapcode/pysqlcipher/>
Files: setup.*
Copyright (C) 2013 Kali Kaneko <[email protected]>
Copyright (C) 2005-2010 Gerhard Häring <[email protected]>

.
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.

.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:

.
1. The origin of this software must not be misrepresented; you
must not claim that you wrote the original software. If you
use this software in a product, an acknowledgment in the
product documentation would be appreciated but is not
required.

.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.

.
3. This notice may not be removed or altered from any source
distribution.

Files: *
Copyright (C) 2005-2010 Gerhard Häring <[email protected]>

.
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.

.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:

.
1. The origin of this software must not be misrepresented; you
must not claim that you wrote the original software. If you
use this software in a product, an acknowledgment in the
product documentation would be appreciated but is not
required.

.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.

.
3. This notice may not be removed or altered from any source
distribution.

Expand All @@ -56,4 +56,4 @@ License: GPL-3+

License: GPL-3+
On Debian systems, the complete text of the GNU General
Public License can be found in `/usr/share/common-licenses/GPL'.
Public License can be found in `/usr/share/common-licenses/GPL'.
17 changes: 16 additions & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,31 @@
# Prevent setuptools/distribute from accessing the internet.
export http_proxy = http://127.0.0.1:9

PACKAGE=python-sqlcipher

%:
dh $@ --with python2 --buildsystem=python_distutils

override_dh_auto_build:
python$* setup.py build_sqlcipher
python$* setup.py build_with_system_sqlcipher
python$* setup.py build_py

export DEBUG_MODE=1 && export DEB_CFLAGS_MAINT_APPEND=-O0 && python$*-dbg setup.py build_with_system_sqlcipher
export DEBUG_MODE=1 && export DEB_CFLAGS_MAINT_APPEND=-O0 && python$*-dbg setup.py build_py

override_dh_auto_install:
python$* setup.py install --skip-build --root=debian/python-sqlcipher \
--install-layout=deb
python$*-dbg setup.py install --skip-build --root=debian/python-sqlcipher-dbg \
--install-layout=deb

override_dh_installdocs:
dh_installdocs
rm -rf debian/$(PACKAGE)-dbg/usr/share/doc/$(PACKAGE)-dbg
ln -s $(PACKAGE) debian/$(PACKAGE)-dbg/usr/share/doc/$(PACKAGE)-dbg

override_dh_strip:
dh_strip --dbg-package=$(PACKAGE)-dbg

override_dh_python2:
dh_python2 --no-guessing-versions
Expand Down
4 changes: 0 additions & 4 deletions debian/watch

This file was deleted.

24 changes: 23 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,37 @@ def __init__(self, *args, **kwargs):
build.__init__(self, *args, **kwargs)


DEBUG_MODE = os.environ.get("DEBUG_MODE", False)


class LibSQLCipherBuilder(build_ext):

description = ("Build C extension linking against libsqlcipher library.")

def build_extension(self, ext):
if DEBUG_MODE:
self.__remove_compiler_option("-O2")
self.__remove_compiler_option("-O1")

ext.extra_compile_args.append("-I/usr/include/sqlcipher/")
ext.extra_link_args.append("-lsqlcipher")
build_ext.build_extension(self, ext)

def __remove_compiler_option(self, option):
"""
Remove the specified compiler option.
Return true if the option was found. Return false otherwise.
"""
found = 0
for attrname in ('compiler', 'compiler_so'):
compiler = getattr(self.compiler, attrname, None)
if compiler is not None:
while option in compiler:
compiler.remove(option)
found += 1
return found


class MyBuildExt(build_ext):
amalgamation = True # We want amalgamation on the default build for now
Expand Down Expand Up @@ -353,7 +375,7 @@ def get_setup_args():
{"build_docs": DocBuilder,
"build_ext": MyBuildExt,
"build_static": AmalgamationBuilder,
"build_sqlcipher": LibSQLCipherBuilder,
"build_with_system_sqlcipher": LibSQLCipherBuilder,
"cross_bdist_wininst": cross_bdist_wininst.bdist_wininst})
return setup_args

Expand Down