debian/rules
branch3.24
changeset 11832 e8be49ecb522
parent 11631 faf279e33298
child 11836 21c72857178f
equal deleted inserted replaced
11831:d1fbe53885e9 11832:e8be49ecb522
     1 #!/usr/bin/make -f
     1 #!/usr/bin/make -f
     2 # Sample debian/rules that uses debhelper.
     2 # Sample debian/rules that uses debhelper.
     3 # GNU copyright 1997 to 1999 by Joey Hess.
     3 # GNU copyright 1997 to 1999 by Joey Hess.
     4 
     4 
     5 # Uncomment this to turn on verbose mode.
     5 # Uncomment this to turn on verbose mode.
     6 #export DH_VERBOSE=1
     6 # export DH_VERBOSE=1
     7 
     7 
     8 build: build-stamp
     8 export PYBUILD_NAME=cubicweb
     9 build-stamp:
     9 export PYBUILD_DISABLE_python2=test
    10 	dh_testdir
       
    11 	python setup.py build
       
    12 	# cubicweb.foo needs to be importable by sphinx, so create a cubicweb symlink to the source dir
       
    13 	mkdir -p debian/pythonpath
       
    14 	ln -sf $(CURDIR)/cubicweb debian/pythonpath
       
    15 	# documentation build is now made optional since it can break for old
       
    16 	# distributions and we don't want to block a new release of Cubicweb
       
    17 	# because of documentation issues.
       
    18 	-PYTHONPATH=$${PYTHONPATH:+$${PYTHONPATH}:}$(CURDIR)/debian/pythonpath $(MAKE) -C doc all
       
    19 	rm -rf debian/pythonpath
       
    20 	touch build-stamp
       
    21 
    10 
    22 clean:
    11 %:
    23 	dh_testdir
    12 	dh $@ --with python2,sphinxdoc --buildsystem=pybuild
    24 	rm -f build-stamp configure-stamp
       
    25 	rm -rf build
       
    26 	#rm -rf debian/cubicweb-*/
       
    27 	find . -name "*.pyc" -delete
       
    28 	-$(MAKE) -C doc clean
       
    29 	dh_clean
       
    30 
    13 
    31 install: build
    14 override_dh_auto_build: export http_proxy=127.0.0.1:9
    32 	dh_testdir
    15 override_dh_auto_build: export https_proxy=127.0.0.1:9
    33 	dh_testroot
    16 override_dh_auto_build:
    34 	dh_clean
    17 	dh_auto_build
    35 	dh_installdirs
    18 ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
       
    19 	PYTHONPATH=. sphinx-build -N -bhtml doc/ debian/cubicweb-doc/html
       
    20 endif
    36 
    21 
    37 	python setup.py -q install --no-compile --prefix=debian/tmp/usr
    22 override_dh_install:
       
    23 	dh_install --sourcedir=debian/python-${PYBUILD_NAME}
    38 
    24 
    39 	# Put all the python library and data in cubicweb-common
    25 override_dh_installchangelogs:
    40 	# and scripts in cubicweb-server
    26 	dh_installchangelogs -Xdoc/changes
    41 	dh_install -vi --sourcedir=debian/tmp
       
    42 	# cwctl in the cubicweb-ctl package
       
    43 	rm -f debian/cubicweb-common/usr/lib/python*/*/cubicweb/cwctl.py
       
    44         # wdoc in the cubicweb-web package
       
    45 	rm -rf debian/cubicweb-common/usr/share/cubicweb/cubes/shared/wdoc
       
    46 	rm -rf debian/cubicweb-common/usr/share/cubicweb/cubes/shared/data
       
    47 	dh_lintian
       
    48 
    27 
    49 	# Remove unittests directory (should be available in cubicweb-dev only)
       
    50 	rm -rf debian/cubicweb-server/usr/lib/python2*/*-packages/cubicweb/dataimport/test
       
    51 	rm -rf debian/cubicweb-server/usr/lib/python2*/*-packages/cubicweb/server/test
       
    52 	rm -rf debian/cubicweb-server/usr/lib/python2*/*-packages/cubicweb/hooks/test
       
    53 	rm -rf debian/cubicweb-server/usr/lib/python2*/*-packages/cubicweb/sobjects/test
       
    54 	rm -rf debian/cubicweb-web/usr/lib/python2*/*-packages/cubicweb/web/test
       
    55 	rm -rf debian/cubicweb-twisted/usr/lib/python2*/*-packages/cubicweb/etwist/test
       
    56 	rm -rf debian/cubicweb-common/usr/lib/python2*/*-packages/cubicweb/ext/test
       
    57 	rm -rf debian/cubicweb-common/usr/lib/python2*/*-packages/cubicweb/entities/test
       
    58 	rm -rf debian/cubicweb-pyramid/usr/lib/python2*/*-packages/cubicweb/pyramid/tests
       
    59 
       
    60 
       
    61 # Build architecture-independent files here.
       
    62 binary-indep: build install
       
    63 	dh_testdir
       
    64 	dh_testroot -i
       
    65 	dh_python2 -i
       
    66 	dh_python2 -i /usr/share/cubicweb
       
    67 	dh_installinit -i -n --name cubicweb -u"defaults 99"
       
    68 	dh_installlogrotate -i
       
    69 	dh_installdocs -i -A README
       
    70 	dh_installman -i
       
    71 	dh_installchangelogs -i -Xdoc/changes
       
    72 	dh_link -i
       
    73 	dh_compress -i -X.py -X.ini -X.xml -X.js -X.rst -X.txt -Xchangelog.html
       
    74 	dh_fixperms -i
       
    75 	dh_installdeb -i
       
    76 	dh_gencontrol  -i
       
    77 	dh_md5sums -i
       
    78 	dh_builddeb -i
       
    79 
       
    80 binary-arch:
       
    81 
       
    82 binary: binary-indep
       
    83 .PHONY: build clean binary binary-indep binary-arch
       
    84