Skip to content

Commit 5a88272

Browse files
committed
doc: describe how to build against remi repository
Extracted from #117 (comment)
1 parent 68887a7 commit 5a88272

File tree

1 file changed

+190
-0
lines changed

1 file changed

+190
-0
lines changed

HACKING.md

Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,196 @@ $ ./test.pkg.all.sh # verify
230230
A package is in `build/` directory, named like
231231
`php7.4-tarantool_0.3.0.40-1_amd64.deb`.
232232

233+
## Build a package against remi-php71 (CentOS)
234+
235+
For ones who needs a custom build for php-7.1 or php-7.3 from `remi-php71` (or
236+
`remi-php73`) repository for CentOS 7.
237+
238+
Apply the following patch:
239+
240+
<details>
241+
<summary>For php-7.1</summary>
242+
243+
```diff
244+
diff --git a/rpm/prebuild.sh b/rpm/prebuild.sh
245+
new file mode 100755
246+
index 0000000..c4420af
247+
--- /dev/null
248+
+++ b/rpm/prebuild.sh
249+
@@ -0,0 +1,11 @@
250+
+#!/bin/sh
251+
+
252+
+set -exu # Strict shell (w/o -o pipefail)
253+
+
254+
+# Preserve environment variables (just in case).
255+
+SUDO="sudo -E"
256+
+
257+
+${SUDO} yum install -y yum-utils
258+
+${SUDO} yum install -y https://rpms.remirepo.net/enterprise/remi-release-7.rpm
259+
+${SUDO} yum-config-manager --enable remi-php71
260+
+${SUDO} yum update -y
261+
diff --git a/test.pkg.all.sh b/test.pkg.all.sh
262+
index 138a1b0..2e89b3b 100755
263+
--- a/test.pkg.all.sh
264+
+++ b/test.pkg.all.sh
265+
@@ -3,27 +3,9 @@
266+
set -exu # Strict shell (w/o -o pipefail)
267+
268+
distros="
269+
- el:8
270+
- fedora:25
271+
- fedora:26
272+
- fedora:27
273+
- fedora:28
274+
- fedora:29
275+
- fedora:30
276+
- fedora:31
277+
- debian:stretch
278+
- debian:buster
279+
- ubuntu:xenial
280+
- ubuntu:bionic
281+
- ubuntu:eoan
282+
- ubuntu:focal
283+
+ el:7
284+
"
285+
286+
-if ! type packpack; then
287+
- echo "Unable to find packpack"
288+
- exit 1
289+
-fi
290+
-
291+
for distro in $distros; do
292+
export OS="${distro%%:*}"
293+
export DIST="${distro#*:}"
294+
@@ -31,9 +13,6 @@ for distro in $distros; do
295+
export OS=centos
296+
fi
297+
298+
- rm -rf build
299+
- packpack
300+
-
301+
docker run \
302+
--volume "$(realpath .):/tarantool-php" \
303+
--workdir /tarantool-php \
304+
diff --git a/test.pkg.sh b/test.pkg.sh
305+
index 3c1c271..5231ab5 100755
306+
--- a/test.pkg.sh
307+
+++ b/test.pkg.sh
308+
@@ -29,8 +29,15 @@ fi
309+
# Update available packages list.
310+
${PM_SYNC}
311+
312+
+# Verify against php7.1 on CentOS 7.
313+
+yum install -y yum-utils
314+
+yum install -y https://rpms.remirepo.net/enterprise/remi-release-7.rpm
315+
+yum-config-manager --enable remi-php71
316+
+yum update -y
317+
+
318+
# Install php interpreter.
319+
${PM_INSTALL_NAME} php
320+
+php --version
321+
322+
# Install php-tarantool package.
323+
${PM_INSTALL_FILE} build/${PKG_GLOB}
324+
```
325+
</details>
326+
327+
<details>
328+
<summary>For php-7.3</summary>
329+
330+
```diff
331+
diff --git a/rpm/prebuild.sh b/rpm/prebuild.sh
332+
new file mode 100755
333+
index 0000000..54359fc
334+
--- /dev/null
335+
+++ b/rpm/prebuild.sh
336+
@@ -0,0 +1,11 @@
337+
+#!/bin/sh
338+
+
339+
+set -exu # Strict shell (w/o -o pipefail)
340+
+
341+
+# Preserve environment variables (just in case).
342+
+SUDO="sudo -E"
343+
+
344+
+${SUDO} yum install -y yum-utils
345+
+${SUDO} yum install -y https://rpms.remirepo.net/enterprise/remi-release-7.rpm
346+
+${SUDO} yum-config-manager --enable remi-php73
347+
+${SUDO} yum update -y
348+
diff --git a/test.pkg.all.sh b/test.pkg.all.sh
349+
index 138a1b0..2e89b3b 100755
350+
--- a/test.pkg.all.sh
351+
+++ b/test.pkg.all.sh
352+
@@ -3,27 +3,9 @@
353+
set -exu # Strict shell (w/o -o pipefail)
354+
355+
distros="
356+
- el:8
357+
- fedora:25
358+
- fedora:26
359+
- fedora:27
360+
- fedora:28
361+
- fedora:29
362+
- fedora:30
363+
- fedora:31
364+
- debian:stretch
365+
- debian:buster
366+
- ubuntu:xenial
367+
- ubuntu:bionic
368+
- ubuntu:eoan
369+
- ubuntu:focal
370+
+ el:7
371+
"
372+
373+
-if ! type packpack; then
374+
- echo "Unable to find packpack"
375+
- exit 1
376+
-fi
377+
-
378+
for distro in $distros; do
379+
export OS="${distro%%:*}"
380+
export DIST="${distro#*:}"
381+
@@ -31,9 +13,6 @@ for distro in $distros; do
382+
export OS=centos
383+
fi
384+
385+
- rm -rf build
386+
- packpack
387+
-
388+
docker run \
389+
--volume "$(realpath .):/tarantool-php" \
390+
--workdir /tarantool-php \
391+
diff --git a/test.pkg.sh b/test.pkg.sh
392+
index 3c1c271..1df9354 100755
393+
--- a/test.pkg.sh
394+
+++ b/test.pkg.sh
395+
@@ -29,8 +29,15 @@ fi
396+
# Update available packages list.
397+
${PM_SYNC}
398+
399+
+# Verify against php7.3 on CentOS 7.
400+
+yum install -y yum-utils
401+
+yum install -y https://rpms.remirepo.net/enterprise/remi-release-7.rpm
402+
+yum-config-manager --enable remi-php73
403+
+yum update -y
404+
+
405+
# Install php interpreter.
406+
${PM_INSTALL_NAME} php
407+
+php --version
408+
409+
# Install php-tarantool package.
410+
${PM_INSTALL_FILE} build/${PKG_GLOB}
411+
```
412+
</details>
413+
414+
Steps:
415+
416+
```sh
417+
$ OS=el DIST=7 /path/to/packpack/packpack # build
418+
$ ./test.pkg.all.sh # verify
419+
```
420+
421+
A package is in `build/` directory.
422+
233423
## Packaging (obsolete)
234424

235425
Those packaging recipes are likely outdated. Kept to revisit them later.

0 commit comments

Comments
 (0)