2006-09-15 [colin] 2.4.0cvs189
[claws.git] / debian / rules
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3 # Sample debian/rules that uses debhelper.
4 # GNU copyright 1997 to 1999 by Joey Hess.
5
6 # Uncomment this to turn on verbose mode.
7 #export DH_VERBOSE=1
8
9
10 # These are used for cross-compiling and for saving the configure script
11 # from having to guess our platform (since we know it already)
12 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
13 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
14
15
16 CFLAGS = -Wall -g
17
18 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
19         CFLAGS += -O0
20 else
21         CFLAGS += -O2
22 endif
23 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
24         INSTALL_PROGRAM += -s
25 endif
26
27 config.status: configure
28         dh_testdir
29         # Add here commands to configure the package.
30         CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) \
31                 --build=$(DEB_BUILD_GNU_TYPE) \
32                 --prefix=/usr \
33                 --mandir=\$${prefix}/share/man \
34                 --infodir=\$${prefix}/share/info \
35                 --with-manualdir=\$${prefix}/share/doc/sylpheed-claws/manual \
36                 --with-faqdir=\$${prefix}/share/doc/sylpheed-claws/faq \
37                 --enable-openssl \
38                 --enable-gpgme \
39                 --enable-ipv6 \
40                 --enable-aspell \
41                 --enable-jpilot \
42                 --enable-ldap \
43                 --enable-spamassassin-plugin=yes \
44                 --enable-clamav-plugin=yes \
45                 --with-config-dir=.sylpheed-claws
46
47 build: build-stamp
48
49 build-stamp:  config.status
50         dh_testdir
51
52         # Add here commands to compile the package.
53         $(MAKE)
54
55         touch build-stamp
56
57 clean:
58         dh_testdir
59         dh_testroot
60         rm -f build-stamp 
61
62         # Add here commands to clean up after the build process.
63         -$(MAKE) distclean
64 ifneq "$(wildcard /usr/share/misc/config.sub)" ""
65         cp -f /usr/share/misc/config.sub config.sub
66 endif
67 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
68         cp -f /usr/share/misc/config.guess config.guess
69 endif
70
71
72         dh_clean 
73
74 install: build
75         dh_testdir
76         dh_testroot
77         dh_clean -k 
78         dh_installdirs
79
80         # Add here commands to install the package into debian/sylpheed-claws.
81         $(MAKE) install DESTDIR=$(CURDIR)/debian/sylpheed-claws
82         rm -f $(CURDIR)/debian/sylpheed-claws/usr/lib/sylpheed-claws/plugins/*.a
83         rm -f $(CURDIR)/debian/sylpheed-claws/usr/lib/sylpheed-claws/plugins/*.la
84         #________________________________________[libsylpheed-claws-dev]__
85         mkdir -m 755 -p $(CURDIR)/debian/libsylpheed-claws-dev/usr/lib/pkgconfig
86         mv $(CURDIR)/debian/sylpheed-claws/usr/include \
87             $(CURDIR)/debian/libsylpheed-claws-dev/usr/include
88         mv $(CURDIR)/debian/sylpheed-claws/usr/lib/pkgconfig/sylpheed-claws.pc \
89            $(CURDIR)/debian/libsylpheed-claws-dev/usr/lib/pkgconfig
90         #__________________________________________[sylpheed-claws-i18n]__
91         mkdir -m 755 -p $(CURDIR)/debian/sylpheed-claws-i18n/usr/share/locale
92         mv $(CURDIR)/debian/sylpheed-claws/usr/share/locale/* \
93            $(CURDIR)/debian/sylpheed-claws-i18n/usr/share/locale
94         #________________________________________[sylpheed-claws-clamav]__
95         mkdir -m 755 -p \
96              $(CURDIR)/debian/sylpheed-claws-clamav/usr/lib/sylpheed-claws/plugins
97         mv $(CURDIR)/debian/sylpheed-claws/usr/lib/sylpheed-claws/plugins/clamav* \
98            $(CURDIR)/debian/sylpheed-claws-clamav/usr/lib/sylpheed-claws/plugins
99         #__________________________________[sylpheed-claws-dillo-viewer]__
100         mkdir -m 755 -p \
101               $(CURDIR)/debian/sylpheed-claws-dillo-viewer/usr/lib/sylpheed-claws/plugins
102         mv $(CURDIR)/debian/sylpheed-claws/usr/lib/sylpheed-claws/plugins/dillo* \
103            $(CURDIR)/debian/sylpheed-claws-dillo-viewer/usr/lib/sylpheed-claws/plugins
104         #__________________________________[sylpheed-claws-spamassassin]__
105         mkdir -m 755 -p \
106               $(CURDIR)/debian/sylpheed-claws-spamassassin/usr/lib/sylpheed-claws/plugins
107         mv $(CURDIR)/debian/sylpheed-claws/usr/lib/sylpheed-claws/plugins/spamassassin* \
108            $(CURDIR)/debian/sylpheed-claws-spamassassin/usr/lib/sylpheed-claws/plugins
109         #______________________________________[sylpheed-claws-trayicon]__
110         mkdir -m 755 -p \
111               $(CURDIR)/debian/sylpheed-claws-trayicon/usr/lib/sylpheed-claws/plugins
112         mv $(CURDIR)/debian/sylpheed-claws/usr/lib/sylpheed-claws/plugins/trayicon* \
113            $(CURDIR)/debian/sylpheed-claws-trayicon/usr/lib/sylpheed-claws/plugins
114         #_______________________________________[sylpheed-claws-pgpmime]__
115         mkdir -m 755 -p \
116               $(CURDIR)/debian/sylpheed-claws-pgpmime/usr/lib/sylpheed-claws/plugins
117         mv $(CURDIR)/debian/sylpheed-claws/usr/lib/sylpheed-claws/plugins/pgpmime.* \
118            $(CURDIR)/debian/sylpheed-claws-pgpmime/usr/lib/sylpheed-claws/plugins
119         mv $(CURDIR)/debian/sylpheed-claws/usr/lib/sylpheed-claws/plugins/pgpcore.so \
120            $(CURDIR)/debian/sylpheed-claws-pgpmime/usr/lib/sylpheed-claws/plugins
121         #_____________________________________[sylpheed-claws-pgpinline]__
122         mkdir -m 755 -p \
123               $(CURDIR)/debian/sylpheed-claws-pgpinline/usr/lib/sylpheed-claws/plugins
124         mv $(CURDIR)/debian/sylpheed-claws/usr/lib/sylpheed-claws/plugins/pgpinline.* \
125            $(CURDIR)/debian/sylpheed-claws-pgpinline/usr/lib/sylpheed-claws/plugins
126         #_______________________________________________[sylpheed-claws]__
127         # application icons
128         mkdir -m 755 -p \
129            $(CURDIR)/debian/sylpheed-claws/usr/share/pixmaps/
130         cp $(CURDIR)/sylpheed*.png \
131            $(CURDIR)/debian/sylpheed-claws/usr/share/pixmaps/
132         # desktop entry
133         mkdir -m 755 -p \
134            $(CURDIR)/debian/sylpheed-claws/usr/share/applications
135         cp $(CURDIR)/debian/sylpheed-claws.desktop \
136            $(CURDIR)/debian/sylpheed-claws/usr/share/applications/sylpheed-claws.desktop
137
138 # Build architecture-independent files here.
139 binary-indep: build install
140 # We have nothing to do by default.
141
142 # Build architecture-dependent files here.
143 binary-arch: build install
144         dh_testdir
145         dh_testroot
146         dh_installchangelogs ChangeLog
147         dh_installdocs
148         dh_installexamples
149         dh_installman
150         dh_installmenu
151         dh_link
152         dh_strip
153         dh_compress
154         dh_fixperms
155         dh_installdeb
156         dh_shlibdeps
157         dh_gencontrol
158         dh_md5sums
159         dh_builddeb
160
161 binary: binary-indep binary-arch
162 .PHONY: build clean binary-indep binary-arch binary install