File: rules

package info (click to toggle)
php-defaults 56
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 172 kB
  • sloc: sh: 784; makefile: 63
file content (95 lines) | stat: -rwxr-xr-x 2,583 bytes parent folder | download
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
#!/usr/bin/make -f
# -*- makefile -*-
# debian/rules for PHP defaults
# Copyright (C) 2011 Ondřej Surý
# Published under the Expat license
#
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

include /usr/share/dpkg/default.mk

PHP_DEFAULT_VERSION    := 7.0
PHP_SUPPORTED_VERSIONS := 7.0 7.1

, := ,
PHP_DEV_PACKAGES       := $(addprefix php,$(addsuffix -dev$(,),$(PHP_SUPPORTED_VERSIONS))), $(addprefix php,$(addsuffix -json$(,),$(PHP_SUPPORTED_VERSIONS)))

PHP_COMMON_DIRS        := $(addprefix /etc/php/,$(addsuffix /mods-available,$(PHP_SUPPORTED_VERSIONS)))

PHP_COMMON_DEB_VERSION := 1:$(DEB_VERSION)
PHP_DEB_VERSION        := 1:$(PHP_DEFAULT_VERSION)+$(DEB_VERSION)

SED=sed

export DH_OPTIONS

DH_SYSTEMD := --with systemd

# Disable systemd on non-Linux buildds
ifneq (linux,$(DEB_HOST_ARCH_OS))
  DH_SYSTEMD :=
endif

# Disable systemd on Ubuntu 12.04 LTS
ifeq (Ubuntu,$(DEB_VENDOR))
  ifeq (precise,$(DEB_DISTRIBUTION))
    DH_SYSTEMD      :=
  endif
endif

%:
	dh $@ $(DH_SYSTEMD)

override_dh_auto_configure:
	:

override_dh_auto_make:
	:

override_dh_auto_install:
	:

override_dh_installcron:
	dh_installcron -pphp-common --name=php

debian/control: debian/control.in debian/rules debian/changelog
	$(SED) -e "s/@PHP_VERSION@/$(PHP_DEFAULT_VERSION)/g" \
	       -e "s/@PHP_DEV_PACKAGES@/$(PHP_DEV_PACKAGES)/g" \
	    >$@ <$<
	echo >> $@
	cat debian/modulelist | while read module description; do \
	    package=php-$${module}; \
	    depends=php$(PHP_DEFAULT_VERSION)-$${module}; \
	    $(SED) -e "s/@package@/$${package}/" \
	           -e "s/@depends@/$${depends}/" \
	           -e "s/@description@/$${description}/" \
	           -e "s/@PHP_VERSION@/$(PHP_DEFAULT_VERSION)/g" \
	        < debian/php-module.control.in \
	        >> $@; \
	    echo >> $@; \
	done;
	-wrap-and-sort -ab

override_dh_installdirs:
	dh_installdirs -i -pphp-common $(PHP_COMMON_DIRS)
	dh_installdirs -i --remaining-packages

override_dh_fixperms:
	chmod 01733 debian/php-common/var/lib/php/sessions
	dh_fixperms -i -pphp-common -X/var/lib/php/sessions
	dh_fixperms -i --remaining-packages

override_dh_gencontrol:
	dh_gencontrol -pphp-common  -- -v$(PHP_COMMON_DEB_VERSION)
	dh_gencontrol -pphp-all-dev -- -v$(PHP_COMMON_DEB_VERSION)
	dh_gencontrol --remaining-packages -- -v$(PHP_DEB_VERSION)

override_dh_systemd_enable:
	dh_systemd_enable --package=php-common phpsessionclean.timer

override_dh_systemd_start:
	dh_systemd_start --package=php-common phpsessionclean.timer
	dh_systemd_start --package=php-common --no-start phpsessionclean.service

.PHONY: debian/control