]> git.saurik.com Git - wxWidgets.git/blobdiff - debian/rules
Committing menubar changes again after CVS trashed them.
[wxWidgets.git] / debian / rules
index 9544df479563ad0dc66ea5f20a447c5468f84f92..17d49a9165ddaaae6f8a1d5baceb1f4e2a398da8 100755 (executable)
@@ -13,20 +13,28 @@ export DH_COMPAT=2
 release:=$(shell dpkg-parsechangelog | sed -n 's/^Source: wxwindows//p')
 
 # Packages to build:
+package_wxbase_lib=libwxbase$(release)
+package_wxbase_dev=libwxbase$(release)-dev
 package_gtk_lib=libwxgtk$(release)
 package_gtk_dev=libwxgtk$(release)-dev
 package_gtk_py=libwxgtk$(release)-python
 package_doc=wxwin$(release)-doc
+package_examples=wxwin$(release)-examples
 
 # Build directories:
+objdir_wxbase_shared=objs_wxbase_sh
+objdir_wxbase_static=objs_wxbase_st
 objdir_gtk_shared=objs_gtk_sh
 objdir_gtk_static=objs_gtk_st
 objdir_doc_cruft=objs_doc_con
 objdir_doc=docs/wxWindows-manual.html
-objdirs=$(objdir_gtk_shared) $(objdir_gtk_static) $(objdir_doc)
+objdir_examples=docs/examples
+objdirs=$(objdir_wxbase_shared) $(objdir_wxbase_static) $(objdir_gtk_shared) \
+       $(objdir_gtk_static) $(objdir_doc) $(objdir_examples)
 
-build_stamps=build-gtk-shared-stamp build-gtk-static-stamp \
-             build-gtk-python-stamp build-doc-stamp
+build_stamps=build-wxbase-shared-stamp build-wxbase-static-stamp \
+             build-gtk-shared-stamp build-gtk-static-stamp \
+             build-gtk-python-stamp build-examples-stamp build-doc-stamp
 
 wxconfig:=$(shell pwd)/$(objdir_gtk_shared)/wx-config \
                --prefix=$(shell pwd) \
@@ -43,6 +51,22 @@ debian/wxwin-doc.doc-base: debian/wxwin-doc.doc-base.in
 
 build: debian/control debian/wxwin-doc.doc-base $(build_stamps)
 
+build-wxbase-shared-stamp:
+       dh_testdir
+       mkdir $(objdir_wxbase_shared)
+       cd $(objdir_wxbase_shared) \
+               && ../configure --prefix=/usr --disable-gui --enable-burnt_name \
+               && $(MAKE)
+       touch $@
+
+build-wxbase-static-stamp:
+       dh_testdir
+       mkdir $(objdir_wxbase_static)
+       cd $(objdir_wxbase_static) \
+               && ../configure --prefix=/usr --disable-gui --disable-shared \
+               && $(MAKE)
+       touch $@
+
 build-gtk-shared-stamp:
        dh_testdir
        mkdir $(objdir_gtk_shared)
@@ -79,13 +103,32 @@ build-doc-stamp: build-gtk-shared-stamp
        cd $(objdir_doc_cruft) \
                && LD_LIBRARY_PATH=../$(objdir_gtk_shared)/lib \
                   ../$(objdir_gtk_shared)/utils/tex2rtf/src/tex2rtf \
-                  ../docs/latex/wx/manual.tex ../$(objdir_doc)/wxwin -twice -html
+                  ../docs/latex/wx/manual.tex ../$(objdir_doc)/wxwin.htm -twice -html
        cp docs/latex/wx/*.gif $(objdir_doc)
        rm -rf $(objdir_doc_cruft)
        rm -f $(objdir_doc)/wxwin.con $(objdir_doc)/wxwin.hh* \
              $(objdir_doc)/wxwin.htx $(objdir_doc)/wxwin.ref
        touch $@
 
+build-examples-stamp:
+       dh_testdir
+       mkdir $(objdir_examples)
+       cp -a samples $(objdir_examples)
+       cp -a demos $(objdir_examples)
+       cp -a utils/wxPython/demo $(objdir_examples)/wxPython
+       @for d in $(objdir_examples)/demos $(objdir_examples)/samples; do \
+               (cd $$d \
+                       && mv Makefile.in Makefile \
+                       && rm -f configure* \
+                       && find -name 'Makefile.in' -exec rm -f '{}' ';' \
+                       && for f in $$(find -type d); do \
+                               if [ -f $$f/makefile.unx ]; then \
+                                       mv $$f/makefile.unx $$f/Makefile; \
+                               fi; \
+                       done) \
+       done;
+       touch $@
+
 clean: debian/control
        dh_testdir
        dh_testroot
@@ -94,19 +137,30 @@ clean: debian/control
        -cd utils/wxPython/modules/html && $(MAKE) clean
        -cd utils/wxPython/modules/utils && $(MAKE) clean
        dh_clean
+       rm -f debian/$(package_wxbase_lib).*
+       rm -f debian/$(package_wxbase_dev).*
        rm -f debian/$(package_gtk_lib).*
        rm -f debian/$(package_gtk_dev).*
        rm -f debian/$(package_gtk_py).*
        rm -f debian/$(package_doc).*
+       rm -f debian/$(package_examples).*
 
 install: build
        dh_testdir
        dh_testroot
+       @for f in dirs docs files postinst; do \
+               echo "generating control file $(package_wxbase_lib).$$f"; \
+               cp debian/libwxbase.$$f debian/$(package_wxbase_lib).$$f; \
+       done;
+       @for f in dirs docs files links postinst prerm; do \
+               echo "generating control file $(package_wxbase_dev).$$f"; \
+               cp debian/libwxbase-dev.$$f debian/$(package_wxbase_dev).$$f; \
+       done;
        @for f in dirs docs files postinst; do \
                echo "generating control file $(package_gtk_lib).$$f"; \
                cp debian/libwxgtk.$$f debian/$(package_gtk_lib).$$f; \
        done;
-       @for f in dirs docs files; do \
+       @for f in dirs docs files links postinst prerm; do \
                echo "generating control file $(package_gtk_dev).$$f"; \
                cp debian/libwxgtk-dev.$$f debian/$(package_gtk_dev).$$f; \
        done;
@@ -118,11 +172,19 @@ install: build
                echo "generating control file $(package_doc).$$f"; \
                cp debian/wxwin-doc.$$f debian/$(package_doc).$$f; \
        done;
+       @for f in docs examples; do \
+               echo "generating control file $(package_examples).$$f"; \
+               cp debian/wxwin-examples.$$f debian/$(package_examples).$$f; \
+       done;
        dh_clean -k
        dh_installdirs
        cd $(objdir_gtk_shared) \
                && $(MAKE) install prefix=`pwd`/../debian/tmp/usr
+       rm -f debian/tmp/usr/bin/wx-config
        cp $(objdir_gtk_static)/lib/*.a debian/tmp/usr/lib
+       cp -a $(objdir_wxbase_shared)/lib/* debian/tmp/usr/lib
+       cp $(objdir_wxbase_shared)/wxbase-config debian/tmp/usr/bin/
+       cp $(objdir_wxbase_static)/lib/*.a debian/tmp/usr/lib
        cd utils/wxPython/src \
                && ../distrib/build.py -i \
                        TARGETDIR=../../../debian/tmp/usr/lib/python1.5/site-packages/wxPython \
@@ -136,6 +198,7 @@ install: build
                && ../../distrib/build.py -i \
                        TARGETDIR=../../../../debian/tmp/usr/lib/python1.5/site-packages/wxPython \
                        WXDIR=../../../..
+       rm -rf debian/tmp/usr/lib/python1.5/site-packages/wxPython/demo
        find debian/tmp/usr/lib/python1.5/site-packages/wxPython \
                -name '*.py?' -exec rm '{}' ';'
        dh_movefiles
@@ -157,7 +220,9 @@ binary-arch: build install
                libpngpf.3 \
                zlib.3 \
                png.5
-       dh_installchangelogs 
+       dh_installchangelogs
+       dh_installexamples
+       dh_link
        dh_strip
        dh_compress
        dh_fixperms