1 #!/usr/bin/make -f
2 # -*- makefile -*-
3 # Sample debian/rules that uses debhelper.
4 # GNU copyright 1997 to 1999 by Joey Hess.
6 # Uncomment this to turn on verbose mode.
7 #export DH_VERBOSE=1
9 export PACKAGE=mlmmj
10 export DH_OPTIONS
11 export TEXTDIR = $(CURDIR)/debian/mlmmj/usr/share/mlmmj/text.skel
12 CONFIGURERUN=no
14 include /usr/share/dpatch/dpatch.make
16 # These are used for cross-compiling and for saving the configure script
17 # from having to guess our platform (since we know it already)
18 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
19 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
21 confflags := --prefix=/usr --mandir=/usr/share/man
22 ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
23 confflags += --build=$(DEB_BUILD_GNU_TYPE)
24 else
25 confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
26 endif
29 export CFLAGS = -Wall -g
30 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
31 CFLAGS += -O0
32 else
33 CFLAGS += -O2
34 endif
37 config.status: patch-stamp configure
38 ./configure $(confflags)
40 build-arch: build-arch-stamp config.status
41 dh_testdir
43 # Add here commands to compile the package.
44 $(MAKE)
45 #/usr/bin/docbook-to-man debian/mlmmj.sgml > mlmmj.1
47 build-arch-stamp:
48 touch build-arch-stamp
49 build-indep-stamp:
50 touch build-indep-stamp
52 build-indep: build-indep-stamp config.status
54 clean: unpatch
55 [ ! -f Makefile ] || $(MAKE) distclean
56 rm -f build-stamp build-indep-stamp build-arch-stamp config.log configure-stamp
57 rm -rf $(CURDIR)/debian/DEBIAN
58 dh_clean
60 install-arch: build-arch
61 dh_testdir
62 dh_testroot
63 dh_clean -k
64 dh_installdirs
66 # Add here commands to install the package into debian/mlmmj.
67 $(MAKE) install DESTDIR=$(CURDIR)/debian/mlmmj
69 # Install translated list texts
71 install -d \
72 $(TEXTDIR)/da/ \
73 $(TEXTDIR)/cz/ \
74 $(TEXTDIR)/it/ \
75 $(TEXTDIR)/de/ \
76 $(TEXTDIR)/es/
77 install -m 644 listtexts/da/* $(TEXTDIR)/da/
78 install -m 644 listtexts/cz/* $(TEXTDIR)/cz/
79 install -m 644 listtexts/it/* $(TEXTDIR)/it/
80 install -m 644 listtexts/de/* $(TEXTDIR)/de/
81 install -m 644 listtexts/es/* $(TEXTDIR)/es/
83 # Don't advertise that mlmmj-make-ml is a shell script
84 # And install our own version of mlmmj-make-ml, until upstream
85 # has stabilised somewhat
86 rm -f $(CURDIR)/debian/mlmmj/usr/bin/mlmmj-make-ml.sh
87 install -m 755 -D $(CURDIR)/debian/mlmmj-make-ml.sh \
88 $(CURDIR)/debian/mlmmj/usr/bin/mlmmj-make-ml
89 rmdir $(CURDIR)/debian/mlmmj/usr/sbin
90 dh_install -s
92 install-indep: build-indep
93 # mlmmj-php-web
94 install -m 644 -D $(CURDIR)/contrib/web/php-user/mlmmj.php \
95 $(CURDIR)/debian/mlmmj-php-web/usr/share/mlmmj-php-web/mlmmj.php
96 install -m 644 -D $(CURDIR)/contrib/web/php-user/README \
97 $(CURDIR)/debian/mlmmj-php-web/usr/share/doc/mlmmj-php-web/README
98 install -m 644 -D $(CURDIR)/contrib/web/php-user/example.html \
99 $(CURDIR)/debian/mlmmj-php-web/usr/share/doc/mlmmj-php-web/examples/examples.html
100 # mlmmj-php-web-admin
101 install -d $(CURDIR)/debian/mlmmj-php-web-admin/usr/share/mlmmj-php-web-admin
102 install -m 644 $(CURDIR)/contrib/web/php-admin/htdocs/*.php \
103 $(CURDIR)/debian/mlmmj-php-web-admin/usr/share/mlmmj-php-web-admin/
104 install -m 644 $(CURDIR)/contrib/web/php-admin/htdocs/dot.htaccess \
105 $(CURDIR)/debian/mlmmj-php-web-admin/usr/share/mlmmj-php-web-admin/.htaccess
106 install -m 644 -D $(CURDIR)/contrib/web/php-admin/README \
107 $(CURDIR)/debian/mlmmj-php-web-admin/usr/share/doc/mlmmj-php-web-admin/README
108 install -d $(CURDIR)/debian/mlmmj-php-web-admin/usr/share/mlmmj-php-web-admin/conf
109 install -d $(CURDIR)/debian/mlmmj-php-web-admin/usr/share/mlmmj-php-web-admin/templates
110 install -m 644 $(CURDIR)/contrib/web/php-admin/conf/* \
111 $(CURDIR)/debian/mlmmj-php-web-admin/usr/share/mlmmj-php-web-admin/conf/
112 install -m 644 $(CURDIR)/contrib/web/php-admin/templates/* \
113 $(CURDIR)/debian/mlmmj-php-web-admin/usr/share/mlmmj-php-web-admin/templates/
114 install -m 644 -D $(CURDIR)/debian/htpasswd \
115 $(CURDIR)/debian/mlmmj-php-web-admin/etc/mlmmj-php-web-admin/htpasswd
117 binary-common:
118 dh_testdir
119 dh_testroot
120 dh_installchangelogs ChangeLog
121 dh_installdocs -A FAQ TUNABLES TODO UPGRADE AUTHORS README README.access VERSION README.exim4 README.sendmail
122 dh_installdebconf
123 dh_installexamples
124 # dh_install
125 # dh_installmenu
126 dh_installdebconf
127 # dh_installlogrotate
128 # dh_installemacsen
129 # dh_installpam
130 # dh_installmime
131 # dh_installinit
132 dh_installcron
133 # dh_installinfo
134 dh_link
135 dh_strip
136 dh_compress
137 dh_fixperms
138 # dh_perl
139 # dh_python
140 # dh_makeshlibs
141 dh_installdeb
142 dh_shlibdeps
143 dh_gencontrol
144 dh_md5sums
145 dh_builddeb
147 binary-arch: build-arch install-arch
148 $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
150 binary-indep: build-indep install-indep
151 $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
153 binary: binary-arch binary-indep
155 build: build-arch build-indep
157 .PHONY: build-arch build-indep clean binary-indep binary-arch binary-common install-indep install-arch build configure