Skip to content

Commit

Permalink
******
Browse files Browse the repository at this point in the history
*DO NOT MERGE UNTIL chainguard-dev/melange#754 goes in.
*****

After installing with apk add php-8.3 also installs the php-8.3-config

```
22ea88231f3b:/work/packages# apk add ./aarch64/php-8.3-8.3_rc3-r14.apk
(1/8) Installing xz (5.4.4-r0)
(2/8) Installing libxml2 (2.11.5-r1)
(3/8) Installing php-8.3-config (8.3_rc3-r14)
(4/8) Installing ncurses-terminfo-base (6.4_p20230722-r1)
(5/8) Installing ncurses (6.4_p20230722-r1)
(6/8) Installing readline (8.2-r2)
(7/8) Installing sqlite (3.40.0-r1)
(8/8) Installing php-8.3 (8.3_rc3-r14)
OK: 32 MiB in 27 packages

22ea88231f3b:/work/packages# apk info -L php-8.3-config
php-8.3-config-8.3_rc3-r14 contains:
etc/php/php.ini
var/lib/db/sbom/php-8.3-config-8.3_rc3-r14.spdx.json

22ea88231f3b:/work/packages# apk info -L php-8.3
php-8.3-8.3_rc3-r14 contains:
bin/php
usr/bin/phar
usr/bin/phar.phar
usr/bin/php
usr/share/man/man1/phar.1
usr/share/man/man1/phar.phar.1
usr/share/man/man1/php-cgi.1
usr/share/man/man1/php-config.1
usr/share/man/man1/php.1
usr/share/man/man1/phpdbg.1
usr/share/man/man1/phpize.1
usr/share/man/man8/php-fpm.8
usr/share/php/fpm/status.html
var/lib/db/sbom/php-8.3-8.3_rc3-r14.spdx.json
```

Spot checking an extension:
```
22ea88231f3b:/work/packages# apk add ./aarch64/php-8.3-gettext-8.3_rc3-r14.apk
(1/2) Installing php-8.3-gettext-config (8.3_rc3-r14)
(2/2) Installing php-8.3-gettext (8.3_rc3-r14)

22ea88231f3b:/work/packages# apk info -L php-8.3-gettext
php-8.3-gettext-8.3_rc3-r14 contains:
usr/lib/php/modules/gettext.so
var/lib/db/sbom/php-8.3-gettext-8.3_rc3-r14.spdx.json

22ea88231f3b:/work/packages# apk info -L php-8.3-gettext-config
php-8.3-gettext-config-8.3_rc3-r14 contains:
etc/php/conf.d/gettext.ini
var/lib/db/sbom/php-8.3-gettext-config-8.3_rc3-r14.spdx.json
```

Signed-off-by: Ville Aikas <[email protected]>
  • Loading branch information
vaikas committed Oct 17, 2023
1 parent 14df26f commit 60b13e3
Showing 1 changed file with 47 additions and 17 deletions.
64 changes: 47 additions & 17 deletions php-8.3.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package:
name: php-8.3
version: 8.3_rc3
epoch: 0
epoch: 1
description: "the PHP programming language"
copyright:
- license: PHP-3.01
Expand All @@ -11,6 +11,7 @@ package:
# - php=${{package.full-version}}
runtime:
- libxml2
- ${{package.name}}-config

environment:
contents:
Expand Down Expand Up @@ -140,15 +141,10 @@ pipeline:
runs: |
cd $HOME/php-${{vars.mangled-package-version}}
INSTALL_ROOT=${{targets.destdir}} DESTDIR=${{targets.destdir}} make install
mkdir -p "${{targets.destdir}}/bin" && ln -s /usr/bin/php "${{targets.destdir}}/bin/php"
- uses: strip

- name: Copy configuration and set up alias on /bin
runs: |
mkdir -p "${{targets.destdir}}/etc/php/conf.d"
mv $HOME/php-${{vars.mangled-package-version}}/php.ini-production ${{targets.destdir}}/etc/php/php.ini
mkdir -p "${{targets.destdir}}/bin" && ln -s /usr/bin/php "${{targets.destdir}}/bin/php"
data:
- name: extensions
items:
Expand Down Expand Up @@ -192,22 +188,44 @@ data:
odbc: UnixODBC

subpackages:
- name: ${{package.name}}-config
# DO NOT USE PROVIDES UNTIL A RELEASE HAS BEEN MADE (not a release candidate)
# dependencies:
# provides:
# - php-${{range.key}}-config=${{package.full-version}}
pipeline:
- runs: |
mkdir -p "${{targets.subpkgdir}}/etc/php/conf.d"
mv $HOME/php-${{vars.mangled-package-version}}/php.ini-production ${{targets.subpkgdir}}/etc/php/php.ini
- range: extensions
name: "${{package.name}}-${{range.key}}"
description: "The ${{range.value}} extension"
dependencies:
runtime:
- "${{package.name}}-${{range.key}}-config"
# DO NOT USE PROVIDES UNTIL A RELEASE HAS BEEN MADE (not a release candidate)
#dependencies:
# provides:
# - php-${{range.key}}=${{package.full-version}}
pipeline:
- runs: |
export EXTENSIONS_DIR=usr/lib/php/modules
export CONF_DIR="${{targets.subpkgdir}}/etc/php/conf.d"
mkdir -p "${{targets.subpkgdir}}"/$EXTENSIONS_DIR $CONF_DIR
mkdir -p "${{targets.subpkgdir}}"/$EXTENSIONS_DIR
mv "${{targets.destdir}}/$EXTENSIONS_DIR/${{range.key}}.so" \
"${{targets.subpkgdir}}/$EXTENSIONS_DIR/${{range.key}}.so"
prefix=
[ "${{range.key}}" != "opcache" ] || prefix="zend_"
- range: extensions
name: "${{package.name}}-${{range.key}}-config"
description: "The ${{range.value}} extension configuration"
# DO NOT USE PROVIDES UNTIL A RELEASE HAS BEEN MADE (not a release candidate)
#dependencies:
# provides:
# - php-${{range.key}}-config=${{package.full-version}}
pipeline:
- runs: |
export CONF_DIR="${{targets.subpkgdir}}/etc/php/conf.d"
mkdir -p $CONF_DIR
prefix=[ "${{range.key}}" != "opcache" ] || prefix="zend_"
echo "${prefix}extension=${{range.key}}.so" > $CONF_DIR/"${{range.key}}.ini"
- name: ${{package.name}}-dev
Expand All @@ -223,7 +241,7 @@ subpackages:
mv ${{targets.destdir}}/usr/bin/phpize ${{targets.subpkgdir}}/usr/bin/
mv ${{targets.destdir}}/usr/lib ${{targets.subpkgdir}}/usr
- name: ${{package.name}}-cgi
- name: "${{package.name}}-cgi"
description: PHP 8.3 CGI
# DO NOT USE PROVIDES UNTIL A RELEASE HAS BEEN MADE (not a release candidate)
#dependencies:
Expand All @@ -234,7 +252,7 @@ subpackages:
mkdir -p ${{targets.subpkgdir}}/usr/bin
mv ${{targets.destdir}}/usr/bin/php-cgi ${{targets.subpkgdir}}/usr/bin/
- name: ${{package.name}}-dbg
- name: "${{package.name}}-dbg"
description: Interactive PHP Debugger
# DO NOT USE PROVIDES UNTIL A RELEASE HAS BEEN MADE (not a release candidate)
#dependencies:
Expand All @@ -245,16 +263,28 @@ subpackages:
mkdir -p ${{targets.subpkgdir}}/usr/bin
mv ${{targets.destdir}}/usr/bin/phpdbg ${{targets.subpkgdir}}/usr/bin/
- name: ${{package.name}}-fpm
- name: "${{package.name}}-fpm"
description: PHP 8.3 FastCGI Process Manager (FPM)
# DO NOT USE PROVIDES UNTIL A RELEASE HAS BEEN MADE (not a release candidate)
dependencies:
runtime:
- "${{package.name}}-fpm-config"
# DO NOT USE PROVIDES UNTIL A RELEASE HAS BEEN MADE (not a release candidate)
# provides:
# - php-fpm=${{package.full-version}}
pipeline:
- runs: |
mkdir -p ${{targets.subpkgdir}}/usr/sbin ${{targets.subpkgdir}}/etc/php/php-fpm.d
mkdir -p ${{targets.subpkgdir}}/usr/sbin
mv ${{targets.destdir}}/usr/sbin/php-fpm ${{targets.subpkgdir}}/usr/sbin/
- name: ${{package.name}}-fpm-config
description: PHP 8.3 FastCGI Process Manager (FPM) configuration
# DO NOT USE PROVIDES UNTIL A RELEASE HAS BEEN MADE (not a release candidate)
# dependencies:
# provides:
# - php-fpm-config=${{package.full-version}}
pipeline:
- runs: |
mkdir -p ${{targets.subpkgdir}}/etc/php/php-fpm.d
mv ${{targets.destdir}}/etc/php/php-fpm.conf.default ${{targets.subpkgdir}}/etc/php/php-fpm.conf
mv ${{targets.destdir}}/etc/php/php-fpm.d/www.conf.default ${{targets.subpkgdir}}/etc/php/php-fpm.d/www.conf \
&& { \
Expand Down

0 comments on commit 60b13e3

Please sign in to comment.