debian: added support for hardened builds
[barry/progweb.git] / debian / rules
blobaf9013c59d559a4dcf52f234477256a7d6173ef5
1 #!/usr/bin/make -f
2 # Based on the multi2 sample debian/rules file:
3 # ---
4 # Sample debian/rules that uses debhelper.
5 # This file is public domain software, originally written by Joey Hess.
7 #export DH_VERBOSE=1
8 include /usr/share/cdbs/1/rules/debhelper.mk
9 include /usr/share/cdbs/1/class/autotools.mk
10 #include /usr/share/cdbs/1/rules/simple-patchsys.mk
12 # The following is for systems that support hardened builds.
13 # Not all systems have this support, so make it conditional on buildflags.mk
14 ifneq ($(strip $(wildcard /usr/share/dpkg/buildflags.mk)),)
15 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
16 export DEB_CFLAGS_MAINT_APPEND = -Wall
17 include /usr/share/dpkg/buildflags.mk
18 endif
20 # where sources are
21 DEB_SRCDIR = .
23 # in which directory to build
24 DEB_BUILDDIR = .
26 # in which directory to install the sofware
27 DEB_DESTDIR = $(CURDIR)/debian/tmp
29 #CDBS automatically handles common flags to pass to the configure script,
30 #but it is possible to give some extra parameters :
31 DEB_CONFIGURE_EXTRA_FLAGS := --enable-boost --enable-nls --with-zlib --enable-gui --enable-desktop $(BARRY_CONFIGURE_OPTS) --with-libusb --enable-rpathhack --with-evolution
32 COMMON_CONFIGURE_FLAGS := --prefix=/usr
33 DEB_INSTALL_DOCS_ALL =
35 install/barry-util::
36 ifeq ($(DEB_HOST_ARCH_OS), linux)
37 # Install udev rules for the barry-util package
38 install -d $(CURDIR)/debian/barry-util/lib/udev/rules.d
39 install -m 0644 \
40 $(DEB_SRCDIR)/udev/10-blackberry.rules \
41 $(DEB_SRCDIR)/udev/99-blackberry-perms.rules \
42 $(CURDIR)/debian/barry-util/lib/udev/rules.d
43 endif
44 # Install modprobe blacklist file for bcharge, into barry-util package
45 install -d $(CURDIR)/debian/barry-util/etc/modprobe.d
46 install -m 0644 $(DEB_SRCDIR)/modprobe/blacklist-berry_charge.conf $(CURDIR)/debian/barry-util/etc/modprobe.d/blacklist-berry_charge.conf
47 # Install default ppp options and chat scripts
48 install -d $(CURDIR)/debian/barry-util/etc/ppp/peers
49 install -m 0644 \
50 $(DEB_SRCDIR)/ppp/barry-rogers \
51 $(DEB_SRCDIR)/ppp/barry-minimal \
52 $(DEB_SRCDIR)/ppp/barry-verizon \
53 $(DEB_SRCDIR)/ppp/barry-sprint \
54 $(DEB_SRCDIR)/ppp/barry-telus \
55 $(DEB_SRCDIR)/ppp/barry-o2ireland \
56 $(DEB_SRCDIR)/ppp/barry-tmobileus \
57 $(DEB_SRCDIR)/ppp/barry-att_cingular \
58 $(DEB_SRCDIR)/ppp/barry-chinamobile \
59 $(DEB_SRCDIR)/ppp/barry-kpn \
60 $(DEB_SRCDIR)/ppp/barry-orange-spain \
61 $(DEB_SRCDIR)/ppp/barry-orangeuk \
62 $(DEB_SRCDIR)/ppp/barry-mts \
63 $(DEB_SRCDIR)/ppp/barry-optus-au \
64 $(DEB_SRCDIR)/ppp/barry-vodafone-au \
65 $(CURDIR)/debian/barry-util/etc/ppp/peers
66 install -d $(CURDIR)/debian/barry-util/etc/chatscripts
67 install -m 0640 \
68 $(DEB_SRCDIR)/ppp/barry-rogers.chat \
69 $(DEB_SRCDIR)/ppp/barry-minimal.chat \
70 $(DEB_SRCDIR)/ppp/barry-verizon.chat \
71 $(DEB_SRCDIR)/ppp/barry-sprint.chat \
72 $(DEB_SRCDIR)/ppp/barry-telus.chat \
73 $(DEB_SRCDIR)/ppp/barry-o2ireland.chat \
74 $(DEB_SRCDIR)/ppp/barry-tmobileus.chat \
75 $(DEB_SRCDIR)/ppp/barry-att_cingular.chat \
76 $(DEB_SRCDIR)/ppp/barry-chinamobile.chat \
77 $(DEB_SRCDIR)/ppp/barry-kpn.chat \
78 $(DEB_SRCDIR)/ppp/barry-orange-spain.chat \
79 $(DEB_SRCDIR)/ppp/barry-orangeuk.chat \
80 $(DEB_SRCDIR)/ppp/barry-mts.chat \
81 $(DEB_SRCDIR)/ppp/barry-optus-au.chat \
82 $(DEB_SRCDIR)/ppp/barry-vodafone-au.chat \
83 $(CURDIR)/debian/barry-util/etc/chatscripts
84 # Install hal fdi configs
85 install -d $(CURDIR)/debian/barry-util/usr/share/hal/fdi/information/10freedesktop
86 install -d $(CURDIR)/debian/barry-util/usr/share/hal/fdi/policy/10osvendor
87 install -m 0644 $(DEB_SRCDIR)/hal/fdi/information/10freedesktop/10-blackberry.fdi $(CURDIR)/debian/barry-util/usr/share/hal/fdi/information/10freedesktop
88 install -m 0644 $(DEB_SRCDIR)/hal/fdi/policy/10osvendor/19-blackberry-acl.fdi $(CURDIR)/debian/barry-util/usr/share/hal/fdi/policy/10osvendor
89 # Install hal support script
90 install -d $(CURDIR)/debian/barry-util/usr/lib/barry
91 install -m 0755 $(DEB_SRCDIR)/hal/hal-blackberry $(CURDIR)/debian/barry-util/usr/lib/barry
92 # Install bash and zsh completion scripts
93 install -d $(CURDIR)/debian/barry-util/etc/bash_completion.d
94 install -m 0644 \
95 $(DEB_SRCDIR)/bash/bjavaloader \
96 $(DEB_SRCDIR)/bash/btool \
97 $(CURDIR)/debian/barry-util/etc/bash_completion.d
98 # Install examples/ into libbarry-dev
99 install -d $(CURDIR)/debian/libbarry-dev/usr/share/doc/libbarry-dev/examples
100 install -m 0644 $(DEB_SRCDIR)/examples/*.cc \
101 $(CURDIR)/debian/libbarry-dev/usr/share/doc/libbarry-dev/examples
103 install/barrybackup-gui::
104 # Install barry icon
105 install -d $(CURDIR)/debian/barrybackup-gui/usr/share/pixmaps
106 install -m 0644 $(DEB_SRCDIR)/logo/barry_logo_debian_menu_icon.xpm $(CURDIR)/debian/barrybackup-gui/usr/share/pixmaps/barry_backup_menu_icon.xpm
107 # Install Gnome .desktop file
108 install -d $(CURDIR)/debian/barrybackup-gui/usr/share/applications
109 install -m 0644 $(DEB_SRCDIR)/menu/barrybackup.desktop $(CURDIR)/debian/barrybackup-gui/usr/share/applications
111 install/barrydesktop::
112 # Install barry icon
113 install -d $(CURDIR)/debian/barrydesktop/usr/share/pixmaps
114 install -m 0644 $(DEB_SRCDIR)/logo/barry_logo_debian_menu_icon.xpm $(CURDIR)/debian/barrydesktop/usr/share/pixmaps/barry_desktop_menu_icon.xpm
115 # Install Gnome .desktop file
116 install -d $(CURDIR)/debian/barrydesktop/usr/share/applications
117 install -m 0644 $(DEB_SRCDIR)/menu/barrydesktop.desktop $(CURDIR)/debian/barrydesktop/usr/share/applications
119 post-patches::
120 @rm -f $(CURDIR)/deb_srcdir
121 @ln -s $(DEB_SRCDIR) $(CURDIR)/deb_srcdir
122 @test -x $(DEB_SRCDIR)/configure && echo "allready autoreconf" || (cd $(DEB_SRCDIR) && autoreconf -i)
124 os22-binary::
125 # DEB_SRCDIR can be relative, so change into directory to use pwd.
127 # Note: that the compiler flags below depend on opensync-plugin's
128 # debian/rules having a DESTDIR target of opensync-plugin/debian/tmp
129 (cd $(DEB_SRCDIR) && \
130 export TREE_BUILD_CXXFLAGS="-I`pwd`/opensync-plugin/debian/tmp/usr/include/barry18" && \
131 export TREE_BUILD_LDFLAGS="-L`pwd`/opensync-plugin/debian/tmp/usr/lib" && \
132 export PKG_CONFIG_PATH="`pwd`:$(PKG_CONFIG_PATH)" && \
133 export LD_LIBRARY_PATH="`pwd`/opensync-plugin/debian/tmp/usr/lib:$(LD_LIBRARY_PATH)" && \
134 cd opensync-plugin && \
135 debian/rules TREE_BUILD_DIR="`pwd`/.." binary)
137 os22-clean::
138 (cd $(DEB_SRCDIR)/opensync-plugin && debian/rules clean)
140 os4x-binary::
141 # DEB_SRCDIR can be relative, so change into directory to use pwd.
143 # Note: that the compiler flags below depend on opensync-plugin-0.4x's
144 # debian/rules having a DESTDIR target of opensync-plugin-0.4x/debian/tmp
145 (cd $(DEB_SRCDIR) && \
146 export TREE_BUILD_CXXFLAGS="-I`pwd`/opensync-plugin-0.4x/debian/tmp/usr/include/barry18" && \
147 export TREE_BUILD_LDFLAGS="-L`pwd`/opensync-plugin-0.4x/debian/tmp/usr/lib" && \
148 export PKG_CONFIG_PATH="`pwd`:$(PKG_CONFIG_PATH)" && \
149 export LD_LIBRARY_PATH="`pwd`/opensync-plugin-0.4x/debian/tmp/usr/lib:$(LD_LIBRARY_PATH)" && \
150 cd opensync-plugin-0.4x && \
151 debian/rules TREE_BUILD_DIR="`pwd`/.." binary)
153 os4x-clean::
154 (cd $(DEB_SRCDIR)/opensync-plugin-0.4x && debian/rules clean)
156 clean::
157 -@rm -f $(CURDIR)/deb_srcdir