File: rules

package info (click to toggle)
mlmmj 1.3.0-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,772 kB
  • sloc: ansic: 13,308; sh: 1,709; php: 1,133; perl: 904; python: 190; makefile: 184
file content (131 lines) | stat: -rwxr-xr-x 4,443 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#!/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-arch-stamp

build-indep: build-indep-stamp

build-arch-stamp: configure-stamp
	dh_testdir
	$(MAKE)
	touch $@

build-indep-stamp:

clean:
	dh_testdir
	dh_testroot
	[ ! -f Makefile ] || $(MAKE) distclean
	rm -f build-stamp configure-stamp config.log
	dh_clean

install: install-indep install-arch

install-arch:
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs -a
	# 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 -a

install-indep:
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs -i
	dh_install -i

	# 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:
	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


DEBVERS         ?= $(shell dpkg-parsechangelog -SVersion)
VERSION         ?= $(shell echo '$(DEBVERS)' | sed -e 's/^[[:digit:]]*://' -e 's/[-].*//')
DEBPKGNAME      ?= $(shell dpkg-parsechangelog -SSource)
GIT_TAG         ?= $(shell echo '$(VERSION)' | sed -e 's/~/_/')

gen-orig-xz:
	if [ ! -f ../$(DEBPKGNAME)_$(VERSION).orig.tar.xz ] ; then \
		git archive --prefix=$(DEBPKGNAME)-$(VERSION)/ $(GIT_TAG) | xz >../$(DEBPKGNAME)_$(VERSION).orig.tar.xz ; \
	fi
	[ ! -e ../build-area ] && mkdir ../build-area || true
	[ ! -e ../build-area/$(DEBPKGNAME)_$(VERSION).orig.tar.xz ] && cp ../$(DEBPKGNAME)_$(VERSION).orig.tar.xz ../build-area

binary-arch: build-arch install-arch
	$(MAKE) -f debian/rules DH_OPTIONS=-s binary-common

binary-indep: build-indep install-indep
	$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common

binary: binary-indep binary-arch

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