debian/rules
author Aurelien Campeas <aurelien.campeas@logilab.fr>
Fri, 25 Jan 2013 16:44:07 +0100
changeset 8684 6c7c2a02c9a0
parent 8648 67a5fccb802a
child 9174 959dbad7743e
permissions -rwxr-xr-x
[ldap test] fix bad merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     1
#!/usr/bin/make -f
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     2
# Sample debian/rules that uses debhelper.
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     3
# GNU copyright 1997 to 1999 by Joey Hess.
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     4
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     5
# Uncomment this to turn on verbose mode.
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     6
#export DH_VERBOSE=1
858
e6ae125d5903 reorganize debian packages (Closes: #1168)
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 275
diff changeset
     7
e6ae125d5903 reorganize debian packages (Closes: #1168)
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 275
diff changeset
     8
PY_VERSION:=$(shell pyversions -d)
e6ae125d5903 reorganize debian packages (Closes: #1168)
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 275
diff changeset
     9
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    10
build: build-stamp
3936
0fc300eb4746 prepare 3.5.7
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 2413
diff changeset
    11
build-stamp:
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    12
	dh_testdir
5354
ba9fe740688c [debian] don't use setuptools to build debian package
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4542
diff changeset
    13
	NO_SETUPTOOLS=1 python setup.py build
8476
864a92b10cb8 [book] Some tweaks to fix cubicweb-documentation package generation
Julien Cristau <julien.cristau@logilab.fr>
parents: 7767
diff changeset
    14
	# cubicweb.foo needs to be importable by sphinx, so create a cubicweb symlink to the source dir
864a92b10cb8 [book] Some tweaks to fix cubicweb-documentation package generation
Julien Cristau <julien.cristau@logilab.fr>
parents: 7767
diff changeset
    15
	mkdir -p debian/pythonpath
864a92b10cb8 [book] Some tweaks to fix cubicweb-documentation package generation
Julien Cristau <julien.cristau@logilab.fr>
parents: 7767
diff changeset
    16
	ln -sf $(CURDIR) debian/pythonpath/cubicweb
7767
07c74f5585d1 [debian] build the book with no auto-compression of book files (closes: #1906581)
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 7512
diff changeset
    17
	# documentation build is now made optional since it can break for old
07c74f5585d1 [debian] build the book with no auto-compression of book files (closes: #1906581)
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 7512
diff changeset
    18
	# distributions and we don't want to block a new release of Cubicweb
07c74f5585d1 [debian] build the book with no auto-compression of book files (closes: #1906581)
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 7512
diff changeset
    19
	# because of documentation issues.
8476
864a92b10cb8 [book] Some tweaks to fix cubicweb-documentation package generation
Julien Cristau <julien.cristau@logilab.fr>
parents: 7767
diff changeset
    20
	-PYTHONPATH=$${PYTHONPATH:+$${PYTHONPATH}:}$(CURDIR)/debian/pythonpath $(MAKE) -C doc/book/en all
8648
67a5fccb802a [packaging] Fix search in squeeze cubicweb-documentation package (closes #2558496)
Julien Cristau <julien.cristau@logilab.fr>
parents: 8647
diff changeset
    21
	# squeeze has a broken combination of jquery and sphinx, fix it up so search works(ish)
67a5fccb802a [packaging] Fix search in squeeze cubicweb-documentation package (closes #2558496)
Julien Cristau <julien.cristau@logilab.fr>
parents: 8647
diff changeset
    22
	if grep -q jQuery\\.className doc/html/_static/doctools.js && grep -q "jQuery JavaScript Library v1\.4\." doc/html/_static/jquery.js; then \
67a5fccb802a [packaging] Fix search in squeeze cubicweb-documentation package (closes #2558496)
Julien Cristau <julien.cristau@logilab.fr>
parents: 8647
diff changeset
    23
	    echo 'Patching doctools.js for jQuery 1.4 compat'; \
67a5fccb802a [packaging] Fix search in squeeze cubicweb-documentation package (closes #2558496)
Julien Cristau <julien.cristau@logilab.fr>
parents: 8647
diff changeset
    24
	    sed -i 's/jQuery\.className.has(node\.parentNode, className)/jQuery(node.parentNode).hasClass(className)/' doc/html/_static/doctools.js; \
67a5fccb802a [packaging] Fix search in squeeze cubicweb-documentation package (closes #2558496)
Julien Cristau <julien.cristau@logilab.fr>
parents: 8647
diff changeset
    25
	fi
8476
864a92b10cb8 [book] Some tweaks to fix cubicweb-documentation package generation
Julien Cristau <julien.cristau@logilab.fr>
parents: 7767
diff changeset
    26
	rm -rf debian/pythonpath
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    27
	touch build-stamp
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    28
3936
0fc300eb4746 prepare 3.5.7
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 2413
diff changeset
    29
clean:
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    30
	dh_testdir
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    31
	dh_testroot
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    32
	rm -f build-stamp configure-stamp
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    33
	rm -rf build
858
e6ae125d5903 reorganize debian packages (Closes: #1168)
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 275
diff changeset
    34
	#rm -rf debian/cubicweb-*/
e6ae125d5903 reorganize debian packages (Closes: #1168)
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 275
diff changeset
    35
	find . -name "*.pyc" -delete
e6ae125d5903 reorganize debian packages (Closes: #1168)
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 275
diff changeset
    36
	rm -f $(basename $(wildcard debian/*.in))
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    37
	dh_clean
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    38
858
e6ae125d5903 reorganize debian packages (Closes: #1168)
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 275
diff changeset
    39
install: build $(basename $(wildcard debian/*.in))
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    40
	dh_testdir
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    41
	dh_testroot
858
e6ae125d5903 reorganize debian packages (Closes: #1168)
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 275
diff changeset
    42
	dh_clean
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    43
	dh_installdirs
858
e6ae125d5903 reorganize debian packages (Closes: #1168)
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 275
diff changeset
    44
e6ae125d5903 reorganize debian packages (Closes: #1168)
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 275
diff changeset
    45
	#python setup.py install_lib --no-compile --install-dir=debian/cubicweb-common/usr/lib/python2.4/site-packages/
5354
ba9fe740688c [debian] don't use setuptools to build debian package
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4542
diff changeset
    46
	NO_SETUPTOOLS=1 python setup.py -q install --no-compile --prefix=debian/tmp/usr
858
e6ae125d5903 reorganize debian packages (Closes: #1168)
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 275
diff changeset
    47
e6ae125d5903 reorganize debian packages (Closes: #1168)
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 275
diff changeset
    48
	# Put all the python library and data in cubicweb-common
e6ae125d5903 reorganize debian packages (Closes: #1168)
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 275
diff changeset
    49
	# and scripts in cubicweb-server
e6ae125d5903 reorganize debian packages (Closes: #1168)
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 275
diff changeset
    50
	dh_install -vi
1821
d9d391bc8e1b fix packaging
sylvain.thenault@logilab.fr
parents: 1043
diff changeset
    51
	# cwctl in the cubicweb-ctl package
1822
b0ee88e8e759 more packaging fixes
sylvain.thenault@logilab.fr
parents: 1821
diff changeset
    52
	rm -f debian/cubicweb-common/usr/share/pyshared/cubicweb/cwctl.py
6532
6096018ac6b7 [debian] cleanup -common package
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6520
diff changeset
    53
        # wdoc in the cubicweb-web package
6096018ac6b7 [debian] cleanup -common package
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6520
diff changeset
    54
	rm -rf debian/cubicweb-common/usr/share/cubicweb/cubes/shared/wdoc
6096018ac6b7 [debian] cleanup -common package
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6520
diff changeset
    55
	rm -rf debian/cubicweb-common/usr/share/cubicweb/cubes/shared/data
858
e6ae125d5903 reorganize debian packages (Closes: #1168)
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 275
diff changeset
    56
	dh_lintian
e6ae125d5903 reorganize debian packages (Closes: #1168)
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 275
diff changeset
    57
e6ae125d5903 reorganize debian packages (Closes: #1168)
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 275
diff changeset
    58
	# Remove unittests directory (should be available in cubicweb-dev only)
2408
7fc87a20b829 properly(?) remove test from standard packages
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 1927
diff changeset
    59
	rm -rf debian/cubicweb-server/usr/lib/${PY_VERSION}/site-packages/cubicweb/server/test
2835
04034421b072 [hooks] major refactoring:
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2413
diff changeset
    60
	rm -rf debian/cubicweb-server/usr/lib/${PY_VERSION}/site-packages/cubicweb/hooks/test
2408
7fc87a20b829 properly(?) remove test from standard packages
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 1927
diff changeset
    61
	rm -rf debian/cubicweb-server/usr/lib/${PY_VERSION}/site-packages/cubicweb/sobjects/test
7fc87a20b829 properly(?) remove test from standard packages
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 1927
diff changeset
    62
	rm -rf debian/cubicweb-web/usr/lib/${PY_VERSION}/site-packages/cubicweb/web/test
2413
b1bea4cab594 properly remove tests from packages
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2412
diff changeset
    63
	rm -rf debian/cubicweb-twisted/usr/lib/${PY_VERSION}/site-packages/cubicweb/etwist/test
b1bea4cab594 properly remove tests from packages
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2412
diff changeset
    64
	rm -rf debian/cubicweb-common/usr/lib/${PY_VERSION}/site-packages/cubicweb/ext/test
2408
7fc87a20b829 properly(?) remove test from standard packages
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 1927
diff changeset
    65
	rm -rf debian/cubicweb-common/usr/lib/${PY_VERSION}/site-packages/cubicweb/entities/test
858
e6ae125d5903 reorganize debian packages (Closes: #1168)
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 275
diff changeset
    66
e6ae125d5903 reorganize debian packages (Closes: #1168)
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 275
diff changeset
    67
e6ae125d5903 reorganize debian packages (Closes: #1168)
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 275
diff changeset
    68
%: %.in
e6ae125d5903 reorganize debian packages (Closes: #1168)
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 275
diff changeset
    69
	sed "s/PY_VERSION/${PY_VERSION}/g" < $< > $@
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    70
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    71
# Build architecture-independent files here.
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    72
binary-indep: build install
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    73
	dh_testdir
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    74
	dh_testroot -i
1926
6eab1787e904 Backed out changeset a9db0eb45117
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 1918
diff changeset
    75
	dh_pycentral -i
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    76
	dh_installinit -i -n --name cubicweb -u"defaults 99"
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    77
	dh_installlogrotate -i
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    78
	dh_installdocs -i -A README
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    79
	dh_installman -i
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    80
	dh_installchangelogs -i
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    81
	dh_link -i
8647
2294fad830ca [packaging] don't compress txt files (closes #2558496)
Julien Cristau <julien.cristau@logilab.fr>
parents: 8476
diff changeset
    82
	dh_compress -i -X.py -X.ini -X.xml -X.js -X.rst -X.txt
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    83
	dh_fixperms -i
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    84
	dh_installdeb -i
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    85
	dh_gencontrol  -i
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    86
	dh_md5sums -i
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    87
	dh_builddeb -i
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    88
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    89
binary-arch:
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    90
3936
0fc300eb4746 prepare 3.5.7
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 2413
diff changeset
    91
binary: binary-indep
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    92
.PHONY: build clean binary binary-indep binary-arch
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    93