Add mysql database stuff
[mspang/pyceo.git] / debian / rules
index 443ce29..90c0602 100755 (executable)
@@ -1,52 +1,44 @@
 #!/usr/bin/make -f
 
-PYTHON := python2.4
+CFLAGS  := -g -O2 -fstack-protector-all -fPIE
+LDFLAGS := -pie -Wl,--as-needed
 
-build: build-stamp
-
-build-stamp:
-       mkdir build
-       $(CC) -DFULL_PATH='"/usr/lib/csc/ceo"' -o build/ceo misc/setuid-prog.c
-       touch build-stamp
+build:
+       cd src && make CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
 
 clean:
        dh_testdir
        dh_testroot
        dh_clean
-       rm -f build-stamp
-       rm -rf build/
-       find pylib/ -name "*.pyc" -print0 | xargs -0 rm -f
+       $(MAKE) -C src clean
+       python setup.py  -q clean -a --build-base=build-ceo
+       python setupd.py -q clean -a --build-base=build-ceod
+       rm -rf build-ceo build-ceod
 
 install: build
        dh_testdir
        dh_testroot
+       dh_installdirs
+       python setup.py  -q build --build-base=build-ceo  install --no-compile -O0 --prefix=/usr --root=debian/ceo-python
+       python setupd.py -q build --build-base=build-ceod install --no-compile -O0 --prefix=/usr --root=debian/ceo-daemon \
+            --install-scripts=/usr/lib/ceod
+       $(MAKE) -C src DESTDIR=$(CURDIR)/debian/ceo-clients PREFIX=/usr install_clients
+       $(MAKE) -C src DESTDIR=$(CURDIR)/debian/ceo-daemon PREFIX=/usr install_daemon
 
-       dh_installdirs etc/csc usr/lib/$(PYTHON)/site-packages usr/share/csc \
-                      usr/lib/csc usr/bin
-       dh_install pylib/* usr/lib/$(PYTHON)/site-packages/
-       dh_install etc/* etc/csc/
-       dh_install sql/* usr/share/csc/
-       
-       dh_install bin/ceo usr/lib/csc/
-       dh_install build/ceo usr/bin/
-       
 binary-arch: build install
        dh_testdir
        dh_testroot
-       dh_installchangelogs 
-       dh_installdocs docs/*
+       dh_installchangelogs
+       dh_installdocs
        dh_installexamples
+       dh_installinit --name ceod -- start 95 2 3 4 5 . stop 05 0 1 6 .
        dh_install
-#      dh_installlogrotate
-#      dh_installcron
        dh_installman
        dh_link
        dh_strip
        dh_compress
        dh_fixperms
-#      dh_perl
-#      dh_python
-#      dh_makeshlibs
+       dh_pysupport
        dh_installdeb
        dh_shlibdeps
        dh_gencontrol