source: orange/install-scripts/debian/control-files/rules @ 8952:6001b75d99cc

Revision 8952:6001b75d99cc, 6.0 KB checked in by mitar, 3 years ago (diff)

Updated Debian control files.

  • Property exe set to *
Line 
1#!/usr/bin/make -f
2# -*- makefile -*-
3# Sample debian/rules that uses debhelper.
4# This file was originally written by Joey Hess and Craig Small.
5# As a special exception, when this file is copied by dh-make into a
6# dh-make output file, you may use that output file without restriction.
7# This special exception was added by Craig Small in version 0.37 of dh-make.
8
9# Uncomment this to turn on verbose mode.
10#export DH_VERBOSE=1
11
12PYTHON_VERSIONS = $(shell pyversions -vr)
13
14configure: configure-stamp
15configure-stamp:
16    dh_testdir
17    # Nothing to be done
18    touch $@
19
20build: build-stamp
21build-stamp: configure-stamp 
22    dh_testdir
23
24    set -e -x ; \
25    for py in $(PYTHON_VERSIONS); do \
26        mkdir source-output$$py ; \
27        cp -r source source-output$$py/source ; \
28        PYTHON=`which python$$py` $(MAKE) -C source-output$$py/source ; \
29        PYTHON=`which python$$py` $(MAKE) -C source-output$$py/source/crs ; \
30        mv source-output$$py/source/crs/_orngCRS.so source-output$$py ; \
31        rm -rf source-output$$py/source ; \
32    done
33
34    touch $@
35
36clean:
37    dh_testdir
38    dh_testroot
39    rm -f build-stamp configure-stamp
40
41    $(MAKE) -C source clean
42    $(MAKE) -C source/crs clean
43   
44    rm -f _orngCRS.so
45
46    set -e -x ; \
47    for py in $(PYTHON_VERSIONS); do \
48        rm -rf source-output$$py ; \
49    done
50
51    dh_clean
52
53install: build
54    dh_testdir
55    dh_testroot
56    dh_prep
57
58    rm -f COPYING doc/COPYING
59    rm -f INSTALL.linux.txt doc/INSTALL.linux.txt
60
61    # Documentation for orange-canvas
62    mkdir -p $(CURDIR)/debian/tmp/usr/share/doc/orange-canvas/
63    cp LICENSES $(CURDIR)/debian/tmp/usr/share/doc/orange-canvas/
64    cp doc/style.css $(CURDIR)/debian/tmp/usr/share/doc/orange-canvas/
65    cp -r doc/widgets/ $(CURDIR)/debian/tmp/usr/share/doc/orange-canvas/
66
67    # Install icon
68    mkdir -p $(CURDIR)/debian/tmp/usr/share/pixmaps/
69    mv $(CURDIR)/debian/tmp/usr/share/doc/orange-canvas/widgets/icon.xpm $(CURDIR)/debian/tmp/usr/share/pixmaps/orange.xpm
70
71    # Documentation for python-orange
72    mkdir -p $(CURDIR)/debian/tmp/usr/share/doc/python-orange/
73    cp LICENSES $(CURDIR)/debian/tmp/usr/share/doc/python-orange/
74    cp -r doc/* $(CURDIR)/debian/tmp/usr/share/doc/python-orange/
75    rm -rf $(CURDIR)/debian/tmp/usr/share/doc/python-orange/widgets/
76
77    # Files for both orange-canvas and python-orange
78    set -e -x ; \
79    for py in $(PYTHON_VERSIONS); do \
80        mkdir -p $(CURDIR)/debian/tmp/usr/lib/python$$py/dist-packages/orange/ ; \
81        find . -mindepth 1 -maxdepth 1 -not -name debian -not -name 'source-output*' -exec cp -r {} $(CURDIR)/debian/tmp/usr/lib/python$$py/dist-packages/orange/ ';' ; \
82        cp -r source-output$$py/* $(CURDIR)/debian/tmp/usr/lib/python$$py/dist-packages/orange/ ; \
83    done
84   
85    # Cleans up
86    set -e -x ; \
87    for py in $(PYTHON_VERSIONS); do \
88        cd $(CURDIR)/debian/tmp/usr/lib/python$$py/dist-packages/orange/ ; \
89        rm -rf COPYING LICENSES doc/ source/ debian/ ; \
90        rm -rf c45.dll liborange_include.a updateOrange.py ; \
91    done
92
93    # Installation registration
94    set -e -x ; \
95    for py in $(PYTHON_VERSIONS); do \
96        echo "orange" > $(CURDIR)/debian/tmp/usr/lib/python$$py/dist-packages/orange.pth ; \
97        echo "datasetsPath=\"/usr/share/doc/python-orange/datasets/\"" > $(CURDIR)/debian/tmp/usr/lib/python$$py/dist-packages/orange/orngConfiguration.py ; \
98    done
99
100    # Generates executable
101    mkdir -p $(CURDIR)/debian/tmp/usr/bin/
102    set -e -x ; \
103    for py in $(PYTHON_VERSIONS); do \
104        echo "#!/bin/bash" > $(CURDIR)/debian/tmp/usr/bin/orange-py$$py ; \
105        echo "exec -a \"\$$0\" /usr/bin/python$$py" /usr/lib/python$$py/dist-packages/orange/OrangeCanvas/orngCanvas.pyw "\"\$$@\"" >> $(CURDIR)/debian/tmp/usr/bin/orange-py$$py ; \
106        chmod +x $(CURDIR)/debian/tmp/usr/bin/orange-py$$py ; \
107    done
108
109    echo "#!/bin/bash" > $(CURDIR)/debian/tmp/usr/bin/orange
110    echo "PYVER=\`pyversions -vd\`" >> $(CURDIR)/debian/tmp/usr/bin/orange
111    echo "PYEXE=\$$(which \`pyversions -d\`)" >> $(CURDIR)/debian/tmp/usr/bin/orange
112    echo "exec -a \"\$$0\" \$$PYEXE /usr/lib/python\$$PYVER/dist-packages/orange/OrangeCanvas/orngCanvas.pyw \"\$$@\"" >> $(CURDIR)/debian/tmp/usr/bin/orange
113    chmod +x $(CURDIR)/debian/tmp/usr/bin/orange
114
115# Build architecture-independent files here.
116binary-indep: build install
117# We have nothing to do by default.
118
119# Build architecture-dependent files here.
120# Order between orange-canvas and python-orange is important so that dh_install moves files correctly
121binary-arch: python-orange orange-canvas
122
123python-orange orange-canvas: build install
124    dh_testdir
125    dh_testroot
126    dh_installchangelogs -p$@
127    dh_installdocs -p$@
128#   dh_installexamples -p$@
129
130    # We temporary rename file so that it is left for orange-canvas
131    set -e -x ; \
132    if [ "$@" = "python-orange" ]; then \
133        rename 's/\.so$$/-so/' $(CURDIR)/debian/tmp/usr/lib/python*/*-packages/orange/orangeqt.so ; \
134    fi
135
136    dh_install -p$@ --sourcedir=debian/tmp --exclude=build-stamp --exclude=configure-stamp
137    cd debian/tmp ; rm -rf `cat ../$@.install`
138
139    # We rename it back
140    set -e -x ; \
141    if [ "$@" = "python-orange" ]; then \
142        rename 's/-so$$/.so/' $(CURDIR)/debian/tmp/usr/lib/python*/*-packages/orange/orangeqt-so ; \
143    fi
144
145    dh_installmenu -p$@
146#   dh_installdebconf -p$@
147#   dh_installlogrotate -p$@
148#   dh_installemacsen -p$@
149#   dh_installpam -p$@
150#   dh_installmime -p$@
151#   dh_installinit -p$@
152#   dh_installcron -p$@
153#   dh_installinfo -p$@
154    dh_installman -p$@
155    dh_link -p$@
156    dh_strip -p$@
157    dh_compress -p$@ -X.tab -X.csv
158    dh_fixperms -p$@
159#   dh_perl -p$@
160    dh_python2 -p$@
161    dh_makeshlibs -p$@
162    dh_installdeb -p$@
163    dh_shlibdeps -p$@
164
165    # We make dependencies less strict
166    perl -i -p -e 's/(, )?python \(>= ([^.\)]+\.[^.)]+)\.[^)]+\)/$$1python (>= $$2)/g' $(CURDIR)/debian/$@.substvars
167
168    # Require at least one version of libpython, not all of them; we move all of them to Recommends
169    perl -n -e 'if (/^shlibs:Depends=.*?(libpython[^,]+(?:, libpython[^,]+)*)/) { print "shlibs:Recommends=$$1\n" }' $(CURDIR)/debian/$@.substvars >> $(CURDIR)/debian/$@.substvars
170    perl -i -p -e '1 while s/^(shlibs:Depends=.*?)(libpython[^,]+), (libpython[^,]+)/$$1$$2 | $$3/g' $(CURDIR)/debian/$@.substvars
171
172    dh_gencontrol -p$@
173    dh_md5sums -p$@
174    dh_builddeb -p$@
175
176binary: binary-indep binary-arch
177
178.PHONY: build clean binary-indep binary-arch binary install configure
Note: See TracBrowser for help on using the repository browser.