forked from vanillahsu/pecl-qrencode
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Debianized for Debian buster and php7.3
- Loading branch information
Showing
13 changed files
with
275 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
php-qrencode for Debian | ||
-------------------------- | ||
|
||
This extension has been created with dh-make-pecl which is part | ||
of dh-make-php. | ||
|
||
-- Wei-Li Tang <[email protected]>, Mon, 19 Jul 2021 15:36:21 +0800 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# php-qrencode for Debian | ||
|
||
This extension has been debianized with dh-make-pecl plus | ||
modifications which is more similar to `dh_make --native`. | ||
|
||
The dependencies are based on Debian buster and php7.3. | ||
|
||
## Build dependencies | ||
|
||
Install development packages before building the extension: | ||
|
||
``` | ||
apt install php-dev libqrencode-dev libpng-dev build-essential dpkg-dev dh-make-php xsltproc | ||
``` | ||
|
||
## Build command | ||
|
||
Run command below to build package from root of the repository: | ||
|
||
``` | ||
dpkg-buildpackage -rfakeroot -uc -b | ||
``` | ||
|
||
## TODO | ||
|
||
* The upstream documentations are not yet included in the debian package. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
php-qrencode (0.7-1) unstable; urgency=low | ||
|
||
* Debianized for Debian buster and php7.3 | ||
|
||
-- Wei-Li Tang <[email protected]> Mon, 19 Jul 2021 15:36:21 +0800 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:util="urn:xslt:functions:util" xmlns:func="http://exslt.org/functions" xmlns:str="http://exslt.org/strings" extension-element-prefixes="func str"> | ||
<xsl:output method="text"/> | ||
|
||
<func:function name="util:maximize"> | ||
<xsl:param name="string"/> | ||
<xsl:param name="line-length"/> | ||
|
||
<func:result> | ||
<xsl:variable name="tmp" select="string-length(substring-before($string,' '))"/> | ||
<xsl:choose> | ||
<xsl:when test="($tmp > $line-length) or (not(contains($string, ' ')))">0</xsl:when> | ||
<xsl:when test="(substring($string,$line-length,1) = ' ')"> | ||
<xsl:value-of select="$line-length"/> | ||
</xsl:when> | ||
<xsl:otherwise> | ||
<xsl:value-of select="util:maximize(substring-after($string, ' '), $line-length - $tmp - 1) + 1 + $tmp"/> | ||
</xsl:otherwise> | ||
</xsl:choose> | ||
</func:result> | ||
</func:function> | ||
|
||
<func:function name="util:format"> | ||
<xsl:param name="string"/> | ||
<xsl:param name="indent" select="2"/> | ||
<xsl:param name="line-length" select="76"/> | ||
|
||
<func:result> | ||
<xsl:choose> | ||
<xsl:when test="contains($string,'
') or contains($string,'
')"> | ||
<xsl:for-each select="str:tokenize($string,'

')"> | ||
<xsl:value-of select="util:format(., $indent, $line-length)"/> | ||
</xsl:for-each> | ||
</xsl:when> | ||
<xsl:when test="string-length($string) > $line-length"> | ||
<xsl:variable name="tmp" select="util:maximize($string, $line-length)"/> | ||
<xsl:value-of select="str:padding($indent,' ')"/> | ||
<xsl:value-of select="substring($string, 1, $tmp)"/> | ||
<xsl:text>
</xsl:text> | ||
<xsl:value-of select="util:format(substring($string, $tmp + 1))"/> | ||
</xsl:when> | ||
<xsl:otherwise> | ||
<xsl:value-of select="str:padding($indent,' ')"/> | ||
<xsl:value-of select="$string"/> | ||
<xsl:text>
</xsl:text> | ||
</xsl:otherwise> | ||
</xsl:choose> | ||
</func:result> | ||
</func:function> | ||
|
||
<func:function name="util:norm"> | ||
<xsl:param name="num"/> | ||
<xsl:param name="length" select="4"/> | ||
|
||
<xsl:choose> | ||
<xsl:when test="$length > string-length($num)"> | ||
<func:result select="concat('0',util:norm($num, $length - 1))"/> | ||
</xsl:when> | ||
<xsl:otherwise> | ||
<func:result select="$num"/> | ||
</xsl:otherwise> | ||
</xsl:choose> | ||
</func:function> | ||
|
||
<func:function name="util:extractnum"> | ||
<xsl:param name="string"/> | ||
|
||
<xsl:choose> | ||
<xsl:when test="$string = ''"> | ||
<func:result select="0"/> | ||
</xsl:when> | ||
<xsl:when test="$string <= '9' and $string >= '0'"> | ||
<func:result select="$string"/> | ||
</xsl:when> | ||
<xsl:otherwise> | ||
<func:result select="util:extractnum(substring($string,1,string-length($string)-1))"/> | ||
</xsl:otherwise> | ||
</xsl:choose> | ||
</func:function> | ||
|
||
<func:function name="util:ver2num"> | ||
<xsl:param name="version"/> | ||
|
||
<xsl:choose> | ||
<xsl:when test="contains($version,'.')"> | ||
<func:result select="concat(util:norm(substring-before($version,'.')), util:ver2num(substring-after($version,'.')))"/> | ||
</xsl:when> | ||
<xsl:when test="$version = number($version)"> | ||
<func:result select="concat(util:norm($version), util:norm(0))"/> | ||
</xsl:when> | ||
<xsl:otherwise> | ||
<xsl:variable name="tmp" select="util:extractnum($version)"/> | ||
<func:result select="concat(util:norm($tmp),' ', substring($version, string-length($tmp) + 1))"/> | ||
</xsl:otherwise> | ||
</xsl:choose> | ||
</func:function> | ||
|
||
<xsl:template match="package"> | ||
<xsl:apply-templates select="release"> | ||
<xsl:sort order="descending" select="util:ver2num(normalize-space(version))" data-type="text"/> | ||
</xsl:apply-templates> | ||
<xsl:apply-templates select="changelog/release"> | ||
<xsl:sort order="descending" select="util:ver2num(normalize-space(version))" data-type="text"/> | ||
</xsl:apply-templates> | ||
</xsl:template> | ||
|
||
<xsl:template match="release"> | ||
<xsl:text>Version </xsl:text> | ||
<xsl:value-of select="version"/> | ||
<xsl:text> - </xsl:text> | ||
<xsl:value-of select="date"/> | ||
<xsl:if test="state"> | ||
<xsl:text> (</xsl:text> | ||
<xsl:value-of select="state"/> | ||
<xsl:text>)</xsl:text> | ||
</xsl:if> | ||
<xsl:text>
----------------------------------------
Notes:
</xsl:text> | ||
<xsl:value-of select="util:format(notes)"/> | ||
<xsl:text>
</xsl:text> | ||
</xsl:template> | ||
|
||
</xsl:stylesheet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Source: php-qrencode | ||
Section: web | ||
Priority: optional | ||
Maintainer: Wei-Li Tang <[email protected]> | ||
Build-Depends: debhelper (>= 7), po-debconf, xsltproc , php-dev , libqrencode-dev, libpng-dev | ||
Standards-Version: 3.9.1 | ||
|
||
Package: php-qrencode | ||
Architecture: any | ||
Depends: ${shlibs:Depends}, ${php:Depends}, ${misc:Depends}, libqrencode4, libpng16-16 | ||
Description: qrencode module for PHP 7.3 | ||
php qrencode is the wrapper of libqrencode to generate qr code. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
This package was debianized by Wei-Li Tang <[email protected]> using dh-make-pecl | ||
on Mon, 19 Jul 2021 15:36:21 +0800. | ||
|
||
It was downloaded from https://github.com/vanillahsu/pecl-qrencode | ||
|
||
Upstream Author(s): | ||
|
||
Vanilla (San Tai) Hsu | ||
|
||
Copyright: | ||
|
||
Copyright (C) 2007 Vanilla (San Tai) Hsu | ||
|
||
License: | ||
|
||
BSD | ||
|
||
The Debian packaging is copyright 2009, Wei-Li Tang <[email protected]> and | ||
is licensed under the GPL, see `/usr/share/common-licenses/GPL'. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
README | ||
CREDITS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
modules/qrencode.so |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
usr/lib/php7.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
[ "$1" = "configure" ] && phpenmod qrencode | ||
|
||
#DEBHELPER# | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
; configuration for php qrencode module | ||
; priority=20 | ||
extension=qrencode.so |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/usr/bin/make -f | ||
# template debian/rules provided by dh-make-php. | ||
# GNU copyright 2005 by Uwe Steinmann. | ||
|
||
# Uncomment this to turn on verbose mode. | ||
#export DH_VERBOSE=1 | ||
|
||
# This has to be exported to make some magic below work. | ||
export DH_OPTIONS | ||
|
||
# Needed for the extension make install | ||
export INSTALL_ROOT:=debian/$(BIN_PACKAGE_NAME) | ||
|
||
CFLAGS = -O2 -Wall | ||
CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 | ||
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) | ||
CFLAGS += -g | ||
DEBUG := --enable-debug | ||
else | ||
DEBUG := --disable-debug | ||
endif | ||
|
||
PECL_PKG_NAME=qrencode | ||
PECL_PKG_REALNAME=qrencode | ||
BIN_PACKAGE_NAME=php-qrencode | ||
PHPIZE=/usr/bin/phpize | ||
PHPCONFIG=/usr/bin/php-config | ||
EXT_DIR=$(shell $(PHPCONFIG) --extension-dir | sed -e "s-/--") | ||
BINARYTARGETS=binary-arch-v7.3 | ||
BUILDTARGETS=build-v7.3 | ||
CLEANTARGETS=clean-v7.3 | ||
PHPAPIVER=$(shell /usr/bin/php-config --phpapi) | ||
PHPCONFD=$(shell echo "/etc/php/7.3/mods-available" | sed -e "s-/--") | ||
|
||
%: | ||
dh $@ | ||
|
||
override_dh_auto_configure: | ||
$(PHPIZE); | ||
./configure --with-php-config=$(PHPCONFIG) --prefix=/usr --with-qrencode | ||
|
||
override_dh_strip: | ||
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) | ||
dh_strip | ||
endif | ||
|
||
override_dh_auto_test: | ||
# do not run tests | ||
|
||
override_dh_genconf: | ||
$(shell /usr/share/dh-make-php/phppkginfo . changelog > debian/changelog) | ||
$(shell echo "php:Depends=phpapi-$(PHPAPIVER)" >> debian/$(BIN_PACKAGE_NAME).substvars) | ||
|
||
override_dh_auto_install: | ||
dh_install modules/$(PECL_PKG_NAME).so $(EXT_DIR) | ||
dh_install debian/$(PECL_PKG_NAME).ini $(PHPCONFD) | ||
dh_auto_install | ||
|
||
override_dh_clean: | ||
# Add here commands to clean up after the build process. | ||
($(MAKE) clean; \ | ||
$(PHPIZE) --clean) | ||
dh_clean |