4a5959482e7fea4675fd927d820b966228ce6496
1 #!/usr/bin/make -f
2 # debian/rules for mlmmj
3 # (based on the sample debian/rules by Joey Hess
4 # and Craig Small as shipped with dh-make).
6 # Uncomment this to turn on verbose mode.
7 #export DH_VERBOSE=1
9 include /usr/share/dpatch/dpatch.make
11 # These are used for cross-compiling and for saving the configure script
12 # from having to guess our platform (since we know it already)
13 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
14 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
16 confflags := --prefix=/usr --mandir=/usr/share/man
17 ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
18 confflags += --build=$(DEB_BUILD_GNU_TYPE)
19 else
20 confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
21 endif
24 CFLAGS = -Wall -g
25 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
26 CFLAGS += -O0
27 else
28 CFLAGS += -O2
29 endif
32 config.status: configure patch-stamp
33 dh_testdir
34 ./configure $(confflags) CFLAGS="$(CFLAGS)"
36 build: build-stamp
38 build-stamp: config.status
39 dh_testdir
41 $(MAKE)
43 touch build-stamp
45 clean: unpatch
46 dh_testdir
47 dh_testroot
48 rm -f build-stamp
49 [ ! -f Makefile ] || $(MAKE) distclean
50 dh_clean
52 install-arch: build
53 dh_testdir
54 dh_testroot
55 dh_clean -k
56 dh_installdirs -a
58 $(MAKE) install DESTDIR=$(CURDIR)/debian/mlmmj
60 # Don't advertise that mlmmj-make-ml is a shell script
61 # And install our own version of mlmmj-make-ml, until upstream
62 # has stabilised somewhat
63 rm -f $(CURDIR)/debian/mlmmj/usr/bin/mlmmj-make-ml.sh
64 install -m 755 -D $(CURDIR)/debian/mlmmj-make-ml \
65 $(CURDIR)/debian/mlmmj/usr/bin/mlmmj-make-ml
66 mv debian/mlmmj/usr/share/man/man1/mlmmj-make-ml.sh.1 \
67 debian/mlmmj/usr/share/man/man1/mlmmj-make-ml.1
68 dh_install -s
70 install-indep:
71 dh_testdir
72 dh_testroot
73 dh_clean -k
74 dh_installdirs -i
76 # mlmmj-php-web
77 install -m 644 -D $(CURDIR)/contrib/web/php-user/mlmmj.php \
78 $(CURDIR)/debian/mlmmj-php-web/var/www/mlmmj-php-web/mlmmj.php
79 install -m 644 -D $(CURDIR)/contrib/web/php-user/README \
80 $(CURDIR)/debian/mlmmj-php-web/usr/share/doc/mlmmj-php-web/README
81 install -m 644 -D $(CURDIR)/contrib/web/php-user/example.html \
82 $(CURDIR)/debian/mlmmj-php-web/usr/share/doc/mlmmj-php-web/examples/examples.html
83 # mlmmj-php-web-admin
84 install -d $(CURDIR)/debian/mlmmj-php-web-admin/var/www/mlmmj-php-web-admin
85 install -m 644 $(CURDIR)/contrib/web/php-admin/htdocs/*.php \
86 $(CURDIR)/debian/mlmmj-php-web-admin/var/www/mlmmj-php-web-admin/
87 install -m 644 $(CURDIR)/contrib/web/php-admin/htdocs/dot.htaccess \
88 $(CURDIR)/debian/mlmmj-php-web-admin/var/www/mlmmj-php-web-admin/.htaccess
89 install -m 644 -D $(CURDIR)/contrib/web/php-admin/README \
90 $(CURDIR)/debian/mlmmj-php-web-admin/usr/share/doc/mlmmj-php-web-admin/README
91 install -d $(CURDIR)/debian/mlmmj-php-web-admin/usr/share/mlmmj-php-web-admin/conf
92 install -d $(CURDIR)/debian/mlmmj-php-web-admin/usr/share/mlmmj-php-web-admin/templates
93 install -m 644 $(CURDIR)/contrib/web/php-admin/conf/* \
94 $(CURDIR)/debian/mlmmj-php-web-admin/usr/share/mlmmj-php-web-admin/conf/
95 install -m 644 $(CURDIR)/contrib/web/php-admin/templates/* \
96 $(CURDIR)/debian/mlmmj-php-web-admin/usr/share/mlmmj-php-web-admin/templates/
97 install -m 644 -D $(CURDIR)/debian/htpasswd \
98 $(CURDIR)/debian/mlmmj-php-web-admin/etc/mlmmj-php-web-admin/htpasswd
100 binary-common:
101 dh_testdir
102 dh_testroot
103 dh_installchangelogs ChangeLog
104 dh_installdocs -A FAQ TUNABLES TODO UPGRADE README README.access \
105 README.exim4 README.sendmail
106 dh_installdebconf
107 dh_installexamples
108 dh_installdebconf
109 dh_installcron
110 dh_link
111 dh_strip
112 dh_compress
113 dh_fixperms
114 dh_installdeb
115 dh_shlibdeps
116 dh_gencontrol
117 dh_md5sums
118 dh_builddeb
120 binary-arch: build-arch install-arch
121 $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
123 binary-indep: build-indep install-indep
124 $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
126 binary: binary-arch binary-indep
128 build: build-arch build-indep
130 .PHONY: build-arch build-indep clean binary-indep binary-arch binary-common install-indep install-arch build