~compiz-team/compiz/compiz.fix_1077866

« back to all changes in this revision

Viewing changes to debian/rules

first packaging

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/make -f
 
2
# -*- makefile -*-
 
3
 
 
4
# Uncomment this to turn on verbose mode.
 
5
#export DH_VERBOSE=1
 
6
export COMPIZ_DEB_BUILD=1
 
7
DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
 
8
gles2_architectures := armel armhf
 
9
 
 
10
CORE_ABIVERSION := $(shell sed -rn 's/^\#define[[:space:]]+CORE_ABIVERSION[[:space:]]+//p' include/core/abiversion.h )
 
11
 
 
12
DEFAULT_PLUGINS = "ccp"
 
13
 
 
14
override_dh_quilt_patch:
 
15
        dh_quilt_patch
 
16
        if test -r debian/patches/series.$(DEB_HOST_ARCH); then \
 
17
          pc=".pc.$(DEB_HOST_ARCH)"; \
 
18
          test -d "$(CURDIR)/$$pc" || mkdir "$(CURDIR)/$$pc"; \
 
19
          cp debian/patches/series.$(DEB_HOST_ARCH) $(CURDIR)/$$pc/series; \
 
20
          cd $(CURDIR); \
 
21
          QUILT_PC="$$pc" quilt upgrade || true; \
 
22
          QUILT_PC="$$pc" QUILT_PATCHES="debian/patches/" quilt push -a || true; \
 
23
        fi; \
 
24
 
 
25
override_dh_quilt_unpatch:
 
26
        if test -r debian/patches/series.$(DEB_HOST_ARCH); then \
 
27
          pc=".pc.$(DEB_HOST_ARCH)"; \
 
28
          cd $(CURDIR); \
 
29
          QUILT_PC="$$pc" QUILT_PATCHES="debian/patches/" quilt pop -a || true; \
 
30
        fi; \
 
31
        dh_quilt_unpatch
 
32
 
 
33
override_dh_auto_configure:
 
34
        # currently, segfault if CMAKE_BUILD_TYPE=Release
 
35
        LDFLAGS=$(shell echo $$LDFLAGS | sed -e 's/\-Wl,-Bsymbolic-functions //')
 
36
ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH), $(gles2_architectures)))
 
37
        dh_auto_configure -- -DCOMPIZ_BUILD_WITH_RPATH=FALSE -DCOMPIZ_DEFAULT_PLUGINS=\"$(DEFAULT_PLUGINS)\" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCOMPIZ_PACKAGING_ENABLED=TRUE -DUSE_GSETTINGS=OFF -DCOMPIZ_DISABLE_GS_SCHEMAS_INSTALL=ON -DCOMPIZ_DISABLE_PLUGIN_KDE=ON -DCOMPIZ_BUILD_TESTING=OFF -DUSE_KDE4=OFF -DBUILD_GLES=ON
 
38
else
 
39
        dh_auto_configure -- -DCOMPIZ_BUILD_WITH_RPATH=FALSE -DCOMPIZ_DEFAULT_PLUGINS=\"$(DEFAULT_PLUGINS)\" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCOMPIZ_PACKAGING_ENABLED=TRUE -DUSE_GSETTINGS=OFF -DCOMPIZ_DISABLE_GS_SCHEMAS_INSTALL=ON -DCOMPIZ_DISABLE_PLUGIN_KDE=ON -DCOMPIZ_BUILD_TESTING=OFF -DUSE_KDE4=OFF
 
40
endif
 
41
 
 
42
override_dh_install:
 
43
        # Language packs
 
44
        for d in $$(find debian/tmp -type f \( -name "*.desktop" -o -name "*.directory" \) ); do \
 
45
                sed -ri '/^(Name|GenericName|Comment|X-GNOME-FullName)\[/d' $$d; \
 
46
                echo "X-Ubuntu-Gettext-Domain=compiz" >> $$d; \
 
47
        done;
 
48
 
 
49
        # create compiz keybindings file based on the metacity ones.
 
50
        mkdir -p $(CURDIR)/debian/tmp/usr/share/gnome-control-center/keybindings/
 
51
        # keep package=metacity to get the right translation :)
 
52
        for i in launchers navigation screenshot system windows ; do \
 
53
            sed 's/wm_name=\"Metacity\"/wm_name=\"Compiz\"/' /usr/share/gnome-control-center/keybindings/50-metacity-$${i}.xml > $(CURDIR)/debian/tmp/usr/share/gnome-control-center/keybindings/50-compiz-$${i}.xml ; \
 
54
    done
 
55
        # add some selected keys
 
56
        sed -i 's#key=\"/apps/metacity/general/num_workspaces\" comparison=\"gt\"##g' $(CURDIR)/debian/tmp/usr/share/gnome-control-center/keybindings/50-compiz-navigation.xml
 
57
 
 
58
        # cmake findcompiz_install use COMPIZ_DESTDIR and using COMPIZ_DESTDIR and
 
59
        # DESTDIR together is completely broken upstream
 
60
        # So, doing the same in debian/rules to find a way to install things in the
 
61
        # right place, sorry for the kittens
 
62
ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH), $(gles2_architectures)))
 
63
        cmake_dir=`cmake --system-information 2> /dev/null | grep "^CMAKE_ROOT " | sed -e 's/.*"\(.*\)"/\1/'` && \
 
64
        mkdir -p debian/tmp$${cmake_dir}/Modules && \
 
65
        cp cmake/FindCompiz.cmake debian/tmp$${cmake_dir}/Modules && cp cmake/FindOpenGLES2.cmake debian/tmp$${cmake_dir}/Modules
 
66
else
 
67
        cmake_dir=`cmake --system-information 2> /dev/null | grep "^CMAKE_ROOT " | sed -e 's/.*"\(.*\)"/\1/'` && \
 
68
        mkdir -p debian/tmp$${cmake_dir}/Modules && \
 
69
        cp cmake/FindCompiz.cmake debian/tmp$${cmake_dir}/Modules
 
70
endif
 
71
 
 
72
        # remove .a files
 
73
        rm -f debian/tmp/usr/lib/*.a
 
74
 
 
75
        dh_install --fail-missing
 
76
 
 
77
        # remove the compizconfig dev file from compiz-dev
 
78
        rm debian/compiz-dev/usr/share/compiz/cmake/LibCompizConfigCommon.cmake
 
79
 
 
80
override_dh_gencontrol:
 
81
        dh_gencontrol -- -Vcoreabiversion=$(CORE_ABIVERSION)
 
82
 
 
83
override_dh_auto_test:
 
84
        #dh_auto_test
 
85
 
 
86
%:
 
87
        dh $@ --parallel --with quilt,python2
 
88