File: rules

package info (click to toggle)
symfony 2.3.21%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 31,028 kB
  • sloc: php: 162,090; xml: 2,839; sh: 422; sql: 246; makefile: 78
file content (110 lines) | stat: -rwxr-xr-x 4,606 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
#!/usr/bin/make -f

%:
	dh $@ --with phpcomposer

override_dh_auto_clean:
	rm -rf debian/packages_to_build

override_dh_auto_build:
	mkdir debian/packages_to_build
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
	# Check if licenses of all images are properly covered in d/copyright
	./debian/licensing/bin/check_image_licenses --check
else
	@echo "** image license check disabled"
endif
	# Walk through the parts of upstream's code that should be packaged into
	# separate Debian binary packages and write down a package-to-build info
	# file containing shell variables for each package.
	# Those files will be traverse later on in different targets of this
	# makefile (debian/rules). They solely exists to not repeat the extraction
	# of those variables in each of those target over and over again.
	set -e;\
	 for src_path in $$(find src/Symfony/ -mindepth 2 -maxdepth 2 -type d); do \
	  src_part=$$(basename $$(dirname $$src_path)); \
	  src_name=$$(basename $$src_path); \
	  deb_pkg_name=php-$$(cat $$src_path/composer.json | jq -r '.name | tostring' | sed -r 's|/|-|'); \
	  if [ $$(grep -c -E -e "^Package: $$deb_pkg_name\$$" debian/control) -ne 1 ]; then \
	   echo "W: No Debian package '$$deb_pkg_name' defined in debian/control," 1>&2; \
	   echo "   therefor not considering Symfony $$src_part '$$src_name'," 1>&2; \
	   continue; \
	  fi; \
	  echo "# This file contains some variables sourced" > debian/packages_to_build/$$deb_pkg_name; \
	  echo "# by various targets in debian/rules" >> debian/packages_to_build/$$deb_pkg_name; \
	  echo "deb_pkg_name='$$deb_pkg_name'" >> debian/packages_to_build/$$deb_pkg_name; \
	  echo "src_path='$$src_path'" >> debian/packages_to_build/$$deb_pkg_name; \
	  echo "src_part='$$src_part'" >> debian/packages_to_build/$$deb_pkg_name; \
	  echo "src_name='$$src_name'" >> debian/packages_to_build/$$deb_pkg_name; \
	 done

override_dh_auto_test:
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
	phpunit --exclude-group online,tty,benchmark,intl-data
else
	@echo "** tests disabled"
endif

override_dh_phpcomposer:
	# In debian/packages_to_build/ a file containing shell variables exists
	# for each package that should be build. Source one file after another
	# to make the shell variables available and run dh_phpcomposer for each
	# package.
	set -e;\
	 for package_info_file in $$(find debian/packages_to_build/ -mindepth 1 -maxdepth 1 -type f); do \
	  . $$package_info_file; \
	  dh_phpcomposer --package=$$deb_pkg_name --sourcedir=$$src_path; \
	 done

override_dh_install:
	# In debian/packages_to_build/ a file containing shell variables exists
	# for each package that should be build. Source one file after another
	# to make the shell variables available and run dh_install in order to
	# provide the PHP runtime code for each package.
	set -e; \
	 for package_info_file in $$(find debian/packages_to_build/ -mindepth 1 -maxdepth 1 -type f); do \
	  . $$package_info_file; \
	  dh_install \
	   -X.git -X.md -Xcomposer.json -XConsole/Resources \
	   -XDoctrine/Test -XForm/Test -XFrameworkBundle/Test \
	   -XLICENSE -Xmeta -Xphpunit.xml.dist -XResources/bin -XTests \
	   --package=$$deb_pkg_name \
	   $$src_path/* \
	   usr/share/php/Symfony/$$src_part/$$src_name/; \
	 done

override_dh_installdocs:
	dh_installdocs
	# In debian/packages_to_build/ a file containing shell variables exists
	# for each package that should be build. Source one file after another
	# to make the shell variables available and run dh_installdocs in order
	# to provide some basic documentation for each package.
	set -e; \
	 for package_info_file in $$(find debian/packages_to_build/ -mindepth 1 -maxdepth 1 -type f); do \
	  . $$package_info_file; \
	  if [ $$(ls $$src_path/*.md | wc -l) -eq 0 ]; then \
	   continue; \
	  fi; \
	  dh_installdocs \
	   -XCHANGELOG.md \
	   --package=$$deb_pkg_name \
	   $$src_path/*.md; \
	 done

override_dh_installchangelogs:
	for i in CHANGELOG-* ; do cat $$i >> CHANGELOG && echo '' >> CHANGELOG ; done
	dh_installchangelogs
	# In debian/packages_to_build/ a file containing shell variables exists
	# for each package that should be build. Source one file after another
	# to make the shell variables available and run dh_installchangelogs in
	# order to provide upstream changelogs for each package.
	set -e; \
	 for package_info_file in $$(find debian/packages_to_build/ -mindepth 1 -maxdepth 1 -type f); do \
	  . $$package_info_file; \
	  if [ ! -f "$$src_path/CHANGELOG.md" ]; then \
	   continue; \
	  fi; \
	  dh_installchangelogs \
	   --package=$$deb_pkg_name \
	   $$src_path/CHANGELOG.md; \
	 done