~ubuntu-branches/ubuntu/intrepid/stfl/intrepid

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Bazaar Package Importer
  • Author(s): Nico Golde
  • Date: 2007-08-07 13:06:54 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070807130654-fmvsraotulj0nbri
Tags: 0.15-3
Again added fPIC to CFLAGS. Hopefully all build issues
are fixed now.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/make -f
2
2
#export DH_VERBOSE=1
3
3
 
4
 
build: build-stamp
 
4
export DH_PYCENTRAL=nomove
 
5
 
 
6
RUBY_VERSIONS = 1.8 1.9
 
7
#PYTHON_VERSIONS = 2.4 2.5
 
8
#PYVERS=$(shell pyversions -vr)
 
9
PYTHON_VERSIONS = $(shell pyversions -vr)
 
10
MAKE_DESTDIR        := $(CURDIR)/debian/tmp
 
11
MAKE_PYTHON_DESTDIR := $(MAKE_DESTDIR)/usr/lib/python
 
12
MAKE_FOUND_INTERPR  := FOUND_PERL5=0 FOUND_SWIG=1 FOUND_SPL=1 FOUND_RUBY=0 FOUND_PYTHON=0
 
13
MAKE_INSTALL_TARGET := DESTDIR=$(MAKE_DESTDIR) prefix=/usr
 
14
CFLAGS += -fPIC
 
15
 
 
16
build: build-stamp $(addprefix build-stamp-ruby-, $(RUBY_VERSIONS)) $(addprefix build-stamp-python-, $(PYTHON_VERSIONS))
5
17
build-stamp:
6
18
        dh_testdir
7
 
 
8
 
        # Add here commands to compile the package.
9
 
        CFLAGS+='-fPIC' $(MAKE) FOUND_PERL5=0 FOUND_RUBY=0 FOUND_PYTHON=0 FOUND_SWIG=0 FOUND_SPL=0
10
 
 
11
 
        touch $@
12
 
 
13
 
clean:
14
 
        dh_testdir
15
 
        dh_testroot
16
 
        rm -f build-stamp
17
 
 
 
19
        
 
20
        $(MAKE) $(MAKE_FOUND_INTERPR)
 
21
        # perl
 
22
        test ! -f perl5/Makefile || $(MAKE) -C perl5 clean
 
23
        cd perl5 && swig -perl5 stfl.i && perl Makefile.PL INSTALLDIRS=vendor
 
24
        $(MAKE) -C perl5
 
25
        
 
26
        touch $@
 
27
 
 
28
build-stamp-ruby-%:
 
29
        cp -a ruby ruby$*
 
30
        cd ruby$* && swig -ruby stfl.i && ruby$* extconf.rb
 
31
        $(MAKE) -C ruby$* clean && $(MAKE) -C ruby$* LIBS+="../libstfl.a -lncursesw" CFLAGS+="-I.. -fPIC"
 
32
        
 
33
        touch $@
 
34
 
 
35
build-stamp-python-%:
 
36
        cp -a python python$*
 
37
        cd python$* && swig -python stfl.i
 
38
        gcc -shared -fPIC python$*/stfl_wrap.c -I/usr/include/python$*  -I. libstfl.a -lncursesw -o python$*/_stfl.so
 
39
        cd python$* && python$* -c 'import stfl'
 
40
        
 
41
        touch $@
 
42
 
 
43
install: build $(addprefix install-ruby-, $(RUBY_VERSIONS)) $(addprefix install-python-, $(PYTHON_VERSIONS))
 
44
        dh_testdir
 
45
        dh_testroot
 
46
        $(MAKE) $(MAKE_INSTALL_TARGET) $(MAKE_FOUND_INTERPR)  install
 
47
        # perl
 
48
        $(MAKE) -C perl5 install DESTDIR=$(MAKE_DESTDIR) PREFIX=/usr 
 
49
 
 
50
install-ruby-%:
 
51
        $(MAKE) -C ruby$* $(MAKE_INSTALL_TARGET) sitedir=$(MAKE_DESTDIR)/usr/lib/ruby install
 
52
 
 
53
install-python-%:
 
54
        mkdir -p $(MAKE_PYTHON_DESTDIR)$*/site-packages/
 
55
        cp python$*/_stfl.so $(MAKE_PYTHON_DESTDIR)$*/site-packages/
 
56
        #cp python$*/stfl.pyc $(MAKE_PYTHON_DESTDIR)$*/site-packages/
 
57
        cp python$*/stfl.py $(MAKE_PYTHON_DESTDIR)$*/site-packages/
 
58
 
 
59
clean: $(addprefix clean-ruby-, $(RUBY_VERSIONS)) $(addprefix clean-python-, $(PYTHON_VERSIONS))
 
60
        dh_testdir
 
61
        dh_testroot
 
62
        rm -f build-stamp* 
 
63
        
18
64
        # Add here commands to clean up after the build process.
19
 
        -$(MAKE) clean
20
 
 
 
65
        [ ! -f Makefile ] || $(MAKE) clean
 
66
        rm -rf debian/tmp
 
67
        
21
68
        dh_clean
22
69
 
23
 
install: build
24
 
        dh_testdir
25
 
        dh_testroot
26
 
        dh_clean -k
27
 
        dh_installdirs
 
70
clean-ruby-%:
 
71
        rm -rf ruby$*
28
72
 
29
 
        $(MAKE) prefix=$(CURDIR)/debian/libstfl-dev/usr install
 
73
clean-python-%:
 
74
        rm -rf python$*
30
75
 
31
76
binary-indep: build install
32
 
 
33
77
binary-arch: build install
34
78
        dh_testdir
35
79
        dh_testroot
36
80
        dh_installchangelogs
37
81
        dh_installdocs
 
82
        dh_installexamples example.c example.stfl
38
83
        dh_install
39
 
        dh_installman debian/stfl.3
 
84
        dh_installman
40
85
        dh_link
41
86
        dh_strip
42
87
        dh_compress
43
88
        dh_fixperms
44
89
        dh_installdeb
45
90
        dh_shlibdeps
 
91
        dh_perl
 
92
        #dh_pycentral $(CURDIR)/debian/usr/lib/python*/site-packages
 
93
        dh_pycentral
46
94
        dh_gencontrol
47
95
        dh_md5sums
48
96
        dh_builddeb
49
97
 
50
98
binary: binary-indep binary-arch
51
 
.PHONY: build clean binary-indep binary-arch binary install