Synched debian/ subdirectory with John Goerzen's arch repo.
[perl4caml.git] / debian / rules
index 53017b6..9a1242a 100755 (executable)
@@ -6,20 +6,44 @@
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
+
+
+
+CFLAGS = -Wall -g
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+       CFLAGS += -O0
+else
+       CFLAGS += -O2
+endif
+ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+       INSTALL_PROGRAM += -s
+endif
+
+# shared library versions, option 1
+version=2.0.5
+major=2
+# option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so
+#version=`ls src/.libs/lib*.so.* | \
+# awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'`
+#major=`ls src/.libs/lib*.so.* | \
+# awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'`
+
 configure: configure-stamp
 configure-stamp:
        dh_testdir
+       # Add here commands to configure the package.
+
        touch configure-stamp
 
+
 build: build-stamp
 build-stamp: configure-stamp 
        dh_testdir
 
-       if [ -x /usr/bin/ocamlopt ]; then \
-       $(MAKE) BUILD_OPT=1; \
-       else \
-       $(MAKE) BUILD_OPT=0; \
-       fi
+       # Add here commands to compile the package.
+       $(MAKE)
+
        touch build-stamp
 
 clean:
@@ -27,7 +51,10 @@ clean:
        dh_testroot
        rm -f build-stamp configure-stamp
 
+       # Add here commands to clean up after the build process.
        -$(MAKE) clean
+       -rm -rf html
+
        dh_clean 
 
 install: build
@@ -36,10 +63,10 @@ install: build
        dh_clean -k 
        dh_installdirs
 
-       $(MAKE) install DESTDIR=$(CURDIR)/debian/libperl-ocaml
+       # Add here commands to install the package into debian/tmp
+       $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
+       cd debian/tmp && find . -name ".arch-ids" -exec rm -rf {} \;
 
-       # Move the remaining development files across.
-       dh_movefiles -plibperl-ocaml-dev --sourcedir=debian/libperl-ocaml
 
 # Build architecture-independent files here.
 binary-indep: build install
@@ -49,6 +76,7 @@ binary-indep: build install
 binary-arch: build install
        dh_testdir
        dh_testroot
+       dh_movefiles -a
        dh_installchangelogs 
        dh_installdocs
        dh_installexamples
@@ -64,7 +92,8 @@ binary-arch: build install
 #      dh_installinfo
        dh_installman
        dh_link
-#      dh_strip                # XXX fails - why?
+       # dh_strip is broken on this package!
+       #dh_strip
        dh_compress
        dh_fixperms
 #      dh_perl