call fpclass only once when replacing isnan for solaris
[rrdtool.git] / debian / rules
1 #!/usr/bin/make -f
2 #-*- makefile -*-
3 # Made with the aid of dh_make, by Craig Small
4 # Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
5 # This version is for a hypothetical package that builds an
6 # architecture-dependant package, as well as an architecture-independant
7 # package.
8
9 package:=rrdtool
10
11 top_srcdir:=$(shell pwd)
12 tmp:=$(top_srcdir)/debian/tmp
13
14 # TCL installation stuff (must match tcl/Makefile.am)
15 tclconfigdir = /usr/lib/tcl8.4
16
17 # Uncomment this to turn on verbose mode. 
18 #export DH_VERBOSE=1
19
20 # This is the debhelper compatability version to use.
21 export DH_COMPAT=2
22
23 # Defaults
24 CFLAGS := -O2
25
26 # Handle DEB_BUILD_OPTIONS
27 ifneq "$(findstring debug,$(DEB_BUILD_OPTIONS))" ""
28 CFLAGS += -g
29 endif
30
31 # Whack the flags to compile additional dependent pieces
32 CFLAGS += -I/usr/include/libart-2.0 -I/usr/include/freetype2
33
34 ##NO_TCL CFLAGS += -I/usr/include/tcl8.4
35
36 configure: configure-stamp
37 configure-stamp:
38         dh_testdir
39         # Make sure we can find tcl stuff (configure won't fail)
40         test -f $(tclconfigdir)/tclConfig.sh
41
42         # match the configure script to the build environment, as needed
43         #aclocal
44         #automake
45         #autoconf
46
47         # Configure C and Tcl stuff
48 ##NO_TCL        CFLAGS="$(CFLAGS)" ./configure --prefix=/usr --enable-shared=yes --enable-static=yes --with-tcllib=$(tclconfigdir) --enable-local-libpng=yes --enable-local-zlib=yes
49         CFLAGS="$(CFLAGS)" ./configure --prefix=/usr --enable-shared=yes --enable-static=yes --enable-local-libpng=yes --enable-local-zlib=yes
50
51         # Configure Perl stuff
52         cd bindings/perl-piped && \
53                 rm -f Makefile && \
54                 perl Makefile.PL INSTALLDIRS=vendor
55
56         cd bindings/perl-shared && \
57                 rm -f Makefile && \
58                 perl Makefile.PL INSTALLDIRS=vendor
59
60         touch configure-stamp
61
62 build: build-stamp
63 build-stamp: configure-stamp
64         dh_testdir
65
66         # Build most stuff
67         $(MAKE)
68
69         # We now build perl-piped and perl-shared separately
70         cd bindings/perl-piped && make OPTIMIZE="$(CFLAGS)"
71         cd bindings/perl-shared && make OPTIMIZE="$(CFLAGS)"
72
73         touch build-stamp
74
75 clean:
76         dh_testdir
77         dh_testroot
78         rm -f build-stamp configure-stamp
79
80         # Add here commands to clean up after the build process.
81         -$(MAKE) distclean
82
83         -rm bindings/perl*/Makefile.old bindings/perl*/Makefile
84
85         dh_clean
86
87 install: build-stamp
88         dh_testdir
89         dh_testroot
90         dh_clean -k
91         dh_installdirs
92
93         # Add here commands to install the package into debian/tmp.
94 ##NO_TCL        $(MAKE) install site-tcl-install DESTDIR=$(tmp)
95         $(MAKE) install DESTDIR=$(tmp)
96
97         mkdir -p $(tmp)/usr/share/doc
98         mv $(tmp)/usr/doc $(tmp)/usr/share/doc/rrdtool
99         mkdir -p $(tmp)/usr/share/rrdtool
100         mv $(tmp)/usr/examples $(tmp)/usr/share/rrdtool
101         mv $(tmp)/usr/html $(tmp)/usr/share/rrdtool
102
103         ## touch-up perl docs
104         mv $(tmp)/usr/man $(tmp)/usr/share
105         mkdir -p $(tmp)/usr/share/man/man3
106         mv $(tmp)/usr/share/man/man1/RRDs.1 $(tmp)/usr/share/man/man3/RRDs.3pm
107         mv $(tmp)/usr/share/man/man1/RRDp.1 $(tmp)/usr/share/man/man3/RRDp.3pm
108         mv $(tmp)/usr/lib/perl $(tmp)/usr/lib/perl5
109
110         ## trim off the doc sources
111         find $(tmp) -name "*.pod" | xargs rm -f
112
113         dh_movefiles
114
115 # Build architecture-independent files here.
116 binary-indep: build install
117 #       dh_testversion
118         dh_testdir -i
119         dh_testroot -i
120         dh_installdocs -i
121 #       dh_installexamples -i
122 #       dh_installmenu -i
123 #       dh_installemacsen -i
124 #       dh_installpam -i
125 #       dh_installinit -i
126 #       dh_installcron -i
127 #       dh_installmanpages -i
128 #       dh_installinfo -i
129 #       dh_undocumented
130 #LATER  dh_installchangelogs -i ChangeLog
131         dh_link -i
132         dh_compress -i
133         dh_fixperms -i
134         # You may want to make some executables suid here.
135 #       dh_suidregister -i
136         dh_installdeb -i
137         dh_perl -i
138         dh_gencontrol -i
139         dh_md5sums -i
140         dh_builddeb -i
141
142 # Build architecture-dependent files here.
143 binary-arch: build install
144 #       dh_testversion
145         dh_testdir -a
146         dh_testroot -a
147         dh_installdocs -a
148 #       dh_installexamples -a
149 #       dh_installmenu -a
150 #       dh_installemacsen -a
151 #       dh_installpam -a
152 #       dh_installinit -a
153 #       dh_installcron -a
154 #       dh_installmanpages -a
155 #       dh_installinfo -a
156 #       dh_undocumented
157 #LATER  dh_installchangelogs -a ChangeLog
158 ifeq "$(findstring nostrip,$(DEB_BUILD_OPTIONS))" ""
159         dh_strip -a
160 endif
161         dh_link -a
162         dh_compress -a -Xexamples/
163         dh_fixperms -a
164         # You may want to make some executables suid here.
165 #       dh_suidregister -a
166 #       dh_makeshlibs -a
167         dh_installdeb -a
168         dh_perl -a
169         dh_shlibdeps -a -ldebian/librrd0/usr/lib
170         dh_gencontrol -a
171         dh_md5sums -a
172         dh_builddeb -a
173
174 source diff:                                                                  
175         @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
176
177 binary: binary-indep binary-arch
178 .PHONY: build clean binary-indep binary-arch binary install