Source: sassphp
Followup-For: Bug #861637

Rhonda,

like in the attached patch.

Sorry for not having a better documentation, but I am extremely bad at
documenting my own work.  (Would be happy to accept any patches that
makes the documentation of dh-php better though.)

O.

-- System Information:
Debian Release: 9.0
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable-debug'), (500, 
'testing-debug'), (500, 'unstable'), (1, 'experimental-debug'), (1, 
'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 4.4.0-67-generic (SMP w/24 CPU cores)
Locale: LANG=en_DK.UTF-8, LC_CTYPE=en_DK.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
>From b08a1913ed970d783bd7401f56207d9473670b81 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= <[email protected]>
Date: Thu, 4 May 2017 10:27:59 +0200
Subject: [PATCH] Update packaging to dh-php

---
 debian/control                                 |  5 +--
 debian/{php7.0-sassphp.php => php-sassphp.php} |  1 -
 debian/rules                                   | 47 ++++++++------------------
 3 files changed, 17 insertions(+), 36 deletions(-)
 rename debian/{php7.0-sassphp.php => php-sassphp.php} (50%)

diff --git a/debian/control b/debian/control
index 4a3ff48..da157d5 100644
--- a/debian/control
+++ b/debian/control
@@ -2,15 +2,16 @@ Source: sassphp
 Section: web
 Priority: optional
 Maintainer: Rhonda D'Vine <[email protected]>
-Build-Depends: debhelper (>= 9), libsass-dev, php7.0-dev, dh-php
+Build-Depends: debhelper (>= 9), libsass-dev, php-all-dev, dh-php
 Standards-Version: 3.9.8
 Homepage: https://github.com/absalomedia/sassphp
 Vcs-Git: https://github.com/strg-at/sassphp.git
 Vcs-Browser: https://github.com/strg-at/sassphp/tree/debian
 
-Package: php7.0-sassphp
+Package: php-sass
 Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends}, ${php:Depends}
+Provides: ${php:Provides}
 Description: PHP bindings to libsass - fast, native Sass parsing in PHP
  The sass extension for PHP gives you an object-oriented system of parsing Sass
  from within your PHP applications. Under the hood it uses libsass to provide
diff --git a/debian/php7.0-sassphp.php b/debian/php-sassphp.php
similarity index 50%
rename from debian/php7.0-sassphp.php
rename to debian/php-sassphp.php
index b102494..228bf89 100644
--- a/debian/php7.0-sassphp.php
+++ b/debian/php-sassphp.php
@@ -1,2 +1 @@
-mod modules/sass.so
 mod debian/sass.ini
diff --git a/debian/rules b/debian/rules
index fb35047..32990f8 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,39 +1,20 @@
 #!/usr/bin/make -f
-# See debhelper(7) (uncomment to enable)
-# output every command that modifies files on the build system.
-#DH_VERBOSE = 1
+PECL_NAME_OVERRIDE := sass
+DH_PHP_VERSIONS_OVERRIDE := $(shell /usr/sbin/phpquery -V)
+include /usr/share/dh-php/pkg-pecl.mk
 
-# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/*
-DPKG_EXPORT_BUILDFLAGS = 1
-include /usr/share/dpkg/default.mk
+DIR_TARGETS = $(addprefix build-,$(DH_PHP_VERSIONS))
 
-# see FEATURE AREAS in dpkg-buildflags(1)
-#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+$(warning CONFIGURE_TARGETS: $(CONFIGURE_TARGETS))
+$(warning BUILD_TARGETS: $(BUILD_TARGETS))
+$(warning INSTALL_TARGETS: $(INSTALL_TARGETS))
 
-# see ENVIRONMENT in dpkg-buildflags(1)
-# package maintainers to append CFLAGS
-#export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
-# package maintainers to append LDFLAGS
-#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
+PECL_SOURCE=$(filter-out debian $(DIR_TARGETS),$(wildcard *))
+$(foreach ver,$(DH_PHP_VERSIONS),$(eval PECL_SOURCE_$(ver) := $(PECL_SOURCE)))
+$(foreach ver,$(DH_PHP_VERSIONS),$(mkdir build-$(ver)))
 
+override_dh_testdir: $(DIR_TARGETS)
+       dh_testdir
 
-# main packaging script based on dh7 syntax
-%:
-       dh $@ --with php
-
-# debmake generated override targets
-# This is example for Cmake (See http://bugs.debian.org/641051 )
-#override_dh_auto_configure:
-#      dh_auto_configure -- \
-#      -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)
-
-override_dh_auto_clean:
-       dh_auto_clean
-       rm -f Makefile.global acinclude.m4 aclocal.m4 build/libtool.m4 
build/ltoptions.m4 build/ltsugar.m4 build/ltversion.m4 build/lt~obsolete.m4 
build/mkdep.awk build/scan_makefile_in.awk build/shtool config.guess config.h 
config.h.in config.nice config.sub configure configure.in ltmain.sh 
run-tests.php
-
-override_dh_auto_configure:
-       phpize
-       ./configure
-
-override_dh_auto_install:
-       INSTALL_ROOT=$(CURDIR)/debian/php7.0-sassphp dh_auto_install
+build-%:
+       mkdir -p build-$(*)
-- 
2.11.0

Reply via email to