Skip to content
This repository was archived by the owner on Mar 29, 2024. It is now read-only.

Commit 594c28e

Browse files
committed
Add PPA packaging scripts for php-v8, [skip ci]
1 parent c2050e1 commit 594c28e

File tree

11 files changed

+154
-3
lines changed

11 files changed

+154
-3
lines changed

scripts/ppa-packaging/libv8/debian/control.in.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Build-Depends: @cdbs@,
66
Standards-Version: 3.9.8
77
Section: libs
88
Homepage: https://developers.google.com/v8/
9-
Vcs-Browser: https://github.com/pinepain/ppa-packaging
10-
Vcs-Git: https://github.com/pinepain/ppa-packaging.git
9+
Vcs-Browser: https://github.com/pinepain/php-v8
10+
Vcs-Git: https://github.com/pinepain/php-v8.git
1111

1212
Package: libv8-__API__-dev
1313
Section: libdevel

scripts/ppa-packaging/package.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<package>
3+
<name>NAME</name>
4+
<version>
5+
<release>VERSION</release>
6+
</version>
7+
</package>
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# PPA archive
2+
#PPA=ppa:username/ppa-name
3+
4+
# List of target distributions
5+
DISTROS=trusty wily xenial
6+
7+
DEBUILD=debuild -S
8+
9+
all: _phony
10+
11+
_phony:
12+
13+
distro: work/${NAME}_${VERSION}
14+
15+
PECL_FULL_NAME=${PECL_NAME}-${VERSION}
16+
17+
work/${NAME}_${VERSION}:
18+
\
19+
mkdir work || true ; \
20+
cd work ; \
21+
mkdir ${NAME}_${VERSION} || true ; \
22+
cd ${NAME}_${VERSION} ; \
23+
if test -z "${GIT_FAST}"; then \
24+
git clone "${GIT_URL}" "${PECL_FULL_NAME}" ; \
25+
cd "${PECL_FULL_NAME}" ; \
26+
git fetch origin "${GIT_VERSION}"; \
27+
git checkout "${GIT_VERSION}" ; \
28+
else \
29+
git clone --depth=1 --branch="${GIT_VERSION}" "${GIT_URL}" "${PECL_FULL_NAME}" ; \
30+
cd "${PECL_FULL_NAME}" ; \
31+
fi; \
32+
\
33+
git submodule init ; git submodule update; \
34+
\
35+
if test -n "${GIT_POST_HOOK}"; then \
36+
../../../${GIT_POST_HOOK} ${GIT_VERSION}; \
37+
fi; \
38+
\
39+
cd .. ; \
40+
cp ../../../package.xml package.xml ;\
41+
sed -i -e "s/NAME/${PECL_NAME}/g" package.xml ; \
42+
sed -i -e "s/VERSION/${VERSION}/g" package.xml ; \
43+
cd .. ; \
44+
tar --exclude .git --exclude '*.pyc' -cf - ${NAME}_${VERSION} | gzip -n9c > ${NAME}_${VERSION}.orig.tar.gz
45+
46+
source-build:
47+
$(MAKE) _build DEBUILD="debuild -S -sa"
48+
49+
build:
50+
$(MAKE) _build DEBUILD=debuild
51+
52+
install: build
53+
sudo dpkg -i work/*.deb
54+
55+
_build: distro
56+
\
57+
if test -z "$$DEBEMAIL" -o -z "$$DEBFULLNAME"; then \
58+
echo "DEBFULLNAME and DEBEMAIL environmental variable should be set" ; \
59+
echo "For example:" ; \
60+
echo "export DEBEMAIL=\"[email protected]\"" ; \
61+
echo "export DEBFULLNAME=\"Full Name\"" ;\
62+
exit 1; \
63+
fi
64+
\
65+
cd "work/${NAME}_${VERSION}" ; \
66+
for distro in ${DISTROS}; do \
67+
NEW_VER="${VERSION}-ppa${PPA_VERSION}~$$distro"; \
68+
rm -Rf debian ; cp -r ../../debian . ; \
69+
sed -i -e "s/DISTRO/$$distro/g" debian/changelog ; \
70+
for file in debian/*.$$distro; do \
71+
if [ -f $$file ]; then \
72+
rename -f "s/\.$$distro$$//" $$file ; \
73+
fi ; \
74+
done ; \
75+
CUR_NAME=`dpkg-parsechangelog | grep '^Source: ' | awk '{print $$2}'`; \
76+
CUR_VER=`dpkg-parsechangelog | grep '^Version: ' | awk '{print $$2}'`; \
77+
if dpkg --compare-versions $$NEW_VER gt $$CUR_VER; then \
78+
echo "New version. Will update changelog and build source package" ; \
79+
dch -v $$NEW_VER --package="${NAME}" -D $$distro --force-distribution \
80+
"New version based on ${GIT_VERSION} (${GIT_URL})" ; \
81+
DEB_MAINTAINER_MODE=1 debuild clean ; \
82+
else \
83+
if dpkg --compare-versions $$NEW_VER ne $$CUR_VER; then \
84+
echo "ERROR: Cannot rebuild source package, because new version is earlier \
85+
than the one specified in changelog ($$NEW_VER < $$CUR_VER)" ; \
86+
exit 1; \
87+
fi ; \
88+
echo "Same version, just rebuild source package" ; \
89+
fi ; \
90+
${DEBUILD} ; \
91+
done
92+
93+
dput: source-build
94+
\
95+
cd "work" ; \
96+
for distro in ${DISTROS}; do \
97+
dput -f "${PPA}" "${NAME}_${VERSION}-ppa${PPA_VERSION}~$$distro""_source.changes" ; \
98+
done ; \
99+
\
100+
cd .. ; \
101+
NEW_VER="${VERSION}-ppa${PPA_VERSION}~DISTRO"; \
102+
CUR_VER=`dpkg-parsechangelog | grep '^Version: ' | awk '{print $$2}'`; \
103+
if dpkg --compare-versions $$NEW_VER gt $$CUR_VER; then \
104+
dch -v $$NEW_VER --package="${NAME}" -D DISTRO --force-distribution \
105+
"New version based on ${GIT_VERSION} (${GIT_URL})" ; \
106+
fi
107+
108+
clean:
109+
@rm -Rf work

scripts/ppa-packaging/packaging.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
DISTROS=trusty wily xenial
66

77
DEBUILD=debuild -S
8-
DEBUILD="echo ok"
98

109
all: _phony
1110

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
php-v8 (0.1.0-ppa1~DISTRO) DISTRO; urgency=medium
2+
3+
* New version based on v0.1.0 (https://github.com/pinepain/php-v8.git)
4+
5+
-- Bogdan Padalko <[email protected]> Sat, 20 Aug 2016 20:18:39 +0000
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
9
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Source: php-v8
2+
Section: php
3+
Priority: optional
4+
Maintainer: Bogdan Padalko <[email protected]>
5+
Build-Depends: debhelper (>= 9),
6+
dh-php (>= 0.12~),
7+
libv8-5.4-dev (>= 5.4.420),
8+
php-all-dev
9+
Standards-Version: 3.9.8
10+
Homepage: https://github.com/pinepain/php-v8
11+
Vcs-Browser: https://github.com/pinepain/php-v8
12+
Vcs-Git: https://github.com/pinepain/php-v8.git
13+
14+
Package: php-v8
15+
Architecture: any
16+
Depends: ${misc:Depends},
17+
${php:Depends},
18+
${shlibs:Depends}
19+
Provides: ${php:Provides}
20+
Description: PHP extension for V8 JavaScript engine
21+
This extension brings V8 JavaScript engine API to PHP with some
22+
abstraction in mind and provides an accurate native V8 C++ API
23+
implementation available from PHP.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
mod debian/v8.ini
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/make -f
2+
DH_PHP_VERSIONS_OVERRIDE=7.0 7.1
3+
include /usr/share/dh-php/pkg-pecl.mk
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.0 (quilt)

0 commit comments

Comments
 (0)