File: rules

package info (click to toggle)
mlmmj 1.2.18.0-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 2,412 kB
  • sloc: ansic: 10,997; sh: 1,498; php: 1,133; perl: 872; makefile: 147
file content (96 lines) | stat: -rwxr-xr-x 3,534 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/usr/bin/make -f
# -*- makefile -*-

#export DH_VERBOSE=1

# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

WEB_ADMIN_DEST = $(CURDIR)/debian/mlmmj-php-web-admin/usr/share/mlmmj-php-web-admin
WEB_ADMIN_SRC = $(CURDIR)/contrib/web/php-admin

USER_ADMIN_SRC = $(CURDIR)/contrib/web/php-user

CONFFLAGS := --prefix=/usr --mandir=/usr/share/man
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
	CONFFLAGS += --build=$(DEB_BUILD_GNU_TYPE)
else
	CONFFLAGS += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
endif

configure: configure-stamp
configure-stamp:
	dh_testdir
	./configure $(CONFFLAGS) $(shell dpkg-buildflags --export=configure)
	touch configure-stamp
build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp
build-stamp: configure-stamp  
	dh_testdir
	$(MAKE)
	touch $@
clean:
	dh_testdir
	dh_testroot
	[ ! -f Makefile ] || $(MAKE) distclean
	rm -f build-stamp configure-stamp config.log
	dh_clean 
install: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs
	# Add here commands to install the package into debian/mlmmj.
	$(MAKE) DESTDIR=$(CURDIR)/debian/mlmmj install
	rm $(CURDIR)/debian/mlmmj/usr/bin/mlmmj-make-ml.sh
	install -m 755 -D $(CURDIR)/debian/mlmmj-make-ml.Debian \
		$(CURDIR)/debian/mlmmj/usr/share/doc/mlmmj/mlmmj-make-ml.Debian
	dh_install -s
	# mlmmj-php-web
	install -m 644 -D $(USER_ADMIN_SRC)/mlmmj.php	$(CURDIR)/debian/mlmmj-php-web/usr/share/mlmmj-php-web/mlmmj.php
	install -m 644 -D $(USER_ADMIN_SRC)/example.html $(CURDIR)/debian/mlmmj-php-web/usr/share/mlmmj-php-web/index.html
	install -m 644 -D $(USER_ADMIN_SRC)/README	$(CURDIR)/debian/mlmmj-php-web/usr/share/doc/mlmmj-php-web/README
	install -m 644 -D $(USER_ADMIN_SRC)/example.html $(CURDIR)/debian/mlmmj-php-web/usr/share/doc/mlmmj-php-web/examples/examples.html

	### mlmmj-php-web-admin ###
	# Create dirs
	install -d $(WEB_ADMIN_DEST)/htdocs
	install -d $(CURDIR)/debian/mlmmj-php-web-admin/etc/mlmmj-php-web-admin
	install -d $(CURDIR)/debian/mlmmj-php-web-admin/etc/mlmmj-php-web-admin/templates
	# Copy the content
	install -m 644 $(WEB_ADMIN_SRC)/htdocs/*.php		$(WEB_ADMIN_DEST)/htdocs
	install -m 644 $(WEB_ADMIN_SRC)/htdocs/dot.htaccess	$(WEB_ADMIN_DEST)/htdocs/.htaccess
	install -m 644 -D $(WEB_ADMIN_SRC)/README		$(CURDIR)/debian/mlmmj-php-web-admin/usr/share/doc/mlmmj-php-web-admin/README
	install -m 644 $(WEB_ADMIN_SRC)/conf/*			$(CURDIR)/debian/mlmmj-php-web-admin/etc/mlmmj-php-web-admin
	install -m 644 $(WEB_ADMIN_SRC)/templates/*		$(CURDIR)/debian/mlmmj-php-web-admin/etc/mlmmj-php-web-admin/templates
	# Make sure we're using /etc for conf files
	ln -s /etc/mlmmj-php-web-admin				$(CURDIR)/debian/mlmmj-php-web-admin/usr/share/mlmmj-php-web-admin/conf
	ln -s /etc/mlmmj-php-web-admin/templates		$(CURDIR)/debian/mlmmj-php-web-admin/usr/share/mlmmj-php-web-admin/templates

binary-common: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs ChangeLog
	dh_installdocs
	dh_installexamples
	dh_installdebconf       
	dh_installcron
	dh_installman
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary-indep: binary-common
binary-arch: binary-common
binary: binary-indep binary-arch

.PHONY: build build-arch build-indep clean binary-indep binary-arch binary install configure