Re: Creating symlink and paths for 8.1.14

If I decided to create the .rpm it looks for these files:
Where do I have to add these dependencies ?

Do I have to install them through yum ?

[root@05f1723c2bd6 SPECS]# rpmbuild -ba php81.spec
error: Failed build dependencies:
    httpd-devel >= 2.0.46-1 is needed by php-8.1.14-1.el7.aarch64
    smtpdaemon is needed by php-8.1.14-1.el7.aarch64
    pkgconfig(libedit) is needed by php-8.1.14-1.el7.aarch64
    libtool-ltdl-devel is needed by php-8.1.14-1.el7.aarch64
    systemtap-sdt-devel is needed by php-8.1.14-1.el7.aarch64
    libacl-devel is needed by php-8.1.14-1.el7.aarch64
    pkgconfig(libsystemd) >= 209 is needed by php-8.1.14-1.el7.aarch64
    libc-client-devel is needed by php-8.1.14-1.el7.aarch64
    postgresql-devel is needed by php-8.1.14-1.el7.aarch64
    unixODBC-devel is needed by php-8.1.14-1.el7.aarch64
    firebird-devel is needed by php-8.1.14-1.el7.aarch64
    net-snmp-devel is needed by php-8.1.14-1.el7.aarch64
    pkgconfig(libxslt) >= 1.1 is needed by php-8.1.14-1.el7.aarch64
    pkgconfig(libexslt) is needed by php-8.1.14-1.el7.aarch64
    oniguruma5php-devel is needed by php-8.1.14-1.el7.aarch64
    pkgconfig(gdlib) >= 2.3.3 is needed by php-8.1.14-1.el7.aarch64
    tokyocabinet-devel is needed by php-8.1.14-1.el7.aarch64
    lmdb-devel is needed by php-8.1.14-1.el7.aarch64
    libtidy-devel is needed by php-8.1.14-1.el7.aarch64
    freetds-devel >= 0.91 is needed by php-8.1.14-1.el7.aarch64
    pkgconfig(icu-i18n) >= 71 is needed by php-8.1.14-1.el7.aarch64
    pkgconfig(icu-io) >= 71 is needed by php-8.1.14-1.el7.aarch64
    pkgconfig(icu-uc) >= 71 is needed by php-8.1.14-1.el7.aarch64
    pkgconfig(enchant-2) is needed by php-8.1.14-1.el7.aarch64
    pkgconfig(libsodium) >= 1.0.14 is needed by php-8.1.14-1.el7.aarch64

Re: Creating symlink and paths for 8.1.14

> [root@05f1723c2bd6 SPECS]# rpmbuild -ba php81.spec

Never use "rpmbuild"
Never run it as "root"

Use the "mock" command.

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: Creating symlink and paths for 8.1.14

Okay!
That's why I get the error ?
Let me create a user and then find out more about the mock command.

Re: Creating symlink and paths for 8.1.14

Hey Remi,

Thank you for the support and help!

What would be your thoughts on packaging PHP within a bash script?
The script would include the whole process of packaging PHP and remove the manual work of packaging PHP on each update.

Re: Creating symlink and paths for 8.1.14

Don't know what you expect, building a PHP package is a single command... (mock)

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: Creating symlink and paths for 8.1.14

You mean this : mock -r rhel-7-aarch64.cfg rebuild php-8.1.16-1.remi.src.rpm
But my point is to automate everything from download the srpms, prerequisites through yum if possible or rpm's then the rebuild of the srpm for the specific architecture and packaging it with mock.

Re: Creating symlink and paths for 8.1.14

Morning Remi,

Why do I get this error when building the SCL version of 8.1.16 ?

+ : SCL macro not defined

Re: Creating symlink and paths for 8.1.14

Already explained in https://forum.remirepo.net/viewtopic.ph … 437#p12437  (§2)

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: Creating symlink and paths for 8.1.14

Thanks!

Now I got this..

/home/remi/rpmbuild/BUILD/php-8.1.16/ext/standard/array.c: In function 'zif_array_sum':
/home/remi/rpmbuild/BUILD/php-8.1.16/Zend/zend_operators.h:641:2: error: invalid 'asm': invalid operand prefix '%c'
  _asm_ goto(
  ^
{standard input}: Assembler messages:
{standard input}:44579: Error: invalid expression in the address at operand 2 -- `str w6,[x20,]'
make: *** [ext/standard/array.lo] Error 1
make: *** Waiting for unfinished jobs....
error: Bad exit status from /var/tmp/rpm-tmp.Hn0fCg (%build)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.Hn0fCg (%build)


Any tips ?

Re: Creating symlink and paths for 8.1.14

You need a recent GCC

Again, answer in my mock configuration files
https://git.remirepo.net/cgit/tools/moc … 81.cfg#n10

As I already said, on EL-7 everything is old.... too old...

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: Creating symlink and paths for 8.1.14

Thanks!
That's what I though when I was having dinner.

Re: Creating symlink and paths for 8.1.14

Phew..
The majority apparently went through and it failed towards the end..

+ rm -rf '/home/remi/rpmbuild/BUILDROOT/1-php-8.1.16-1.el7.aarch64/opt/rh/1/root/usr/lib64/php/modules/*.a' '/home/remi/rpmbuild/BUILDROOT/1-php-8.1.16-1.el7.aarch64/opt/rh/1/root/usr/bin/{phptar}' /home/remi/rpmbuild/BUILDROOT/1-php-8.1.16-1.el7.aarch64/opt/rh/1/root/usr/share/pear /home/remi/rpmbuild/BUILDROOT/1-php-8.1.16-1.el7.aarch64/opt/rh/1/root/usr/lib64/libphp.a /home/remi/rpmbuild/BUILDROOT/1-php-8.1.16-1.el7.aarch64/opt/rh/1/root/usr/lib64/libphp.la
+ rm -f README.Zeus README.QNX README.CVS-RULES
+ /usr/lib/rpm/find-debuginfo.sh --strict-build-id -m --run-dwz --dwz-low-mem-die-limit 10000000 --dwz-max-die-limit 50000000 /home/remi/rpmbuild/BUILD/php-8.1.16
extracting debug info from /home/remi/rpmbuild/BUILDROOT/1-php-8.1.16-1.el7.aarch64/opt/rh/1/root/usr/bin/lsphp
*** ERROR: No build ID note found in /home/remi/rpmbuild/BUILDROOT/1-php-8.1.16-1.el7.aarch64/opt/rh/1/root/usr/bin/lsphp
error: Bad exit status from /var/tmp/rpm-tmp.hPun25 (%install)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.hPun25 (%install)

Re: Creating symlink and paths for 8.1.14

By adding %global debug_package   %{nil} I don't see the No build ID error. But got this now..

ERROR   0020: file '/opt/rh/1/root/usr/bin/php-cgi' contains an rpath referencing '..' of an absolute path [/home/remi/.gcc/10.2.0/lib/../lib64]
ERROR   0020: file '/opt/rh/1/root/usr/bin/php' contains an rpath referencing '..' of an absolute path [/home/remi/.gcc/10.2.0/lib/../lib64]
ERROR   0020: file '/opt/rh/1/root/usr/bin/phpdbg' contains an rpath referencing '..' of an absolute path [/home/remi/.gcc/10.2.0/lib/../lib64]

Re: Creating symlink and paths for 8.1.14

It seems you are not using a sane env (i.e. not using the mock command)

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

40 (edited by kdgeorgiev 2023-02-23 08:56:59)

Re: Creating symlink and paths for 8.1.14

Correct I'm not using it. What would be the best way to move forward

mock -r centos-7-aarch64.cfg rebuild <-srpm-name->.src.rpm ?
ll

But even if the rpms are now ready..

        rpm -ivh 1-php-common-8.1.16-1.el7.aarch64.rpm
        error: Failed dependencies:
    1-runtime is needed by 1-php-common-8.1.16-1.el7.aarch64

I don't have it..

Re: Creating symlink and paths for 8.1.14

> Correct I'm not using it. What would be the best way to move forward

> mock -r centos-7-aarch64.cfg rebuild <-srpm-name->.src.rpm ?

No, you need your own config, dedicated to the target SCL

>    1-runtime is needed by 1-php-common-8.1.16-1.el7.aarch64

Bad env again

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: Creating symlink and paths for 8.1.14

Well! SCL is a lot harder as you've said in previous replies.
I did manage to get a working /etc/php/ from your SRPMS.
Version is 8.1.16 but it seems that the SCL is trickier to get it working.

Re: Creating symlink and paths for 8.1.14

Thanks!

I got it working

[root@465f690e16f3 SPECS]# php81 -v
PHP 8.1.16 (cli) (built: Feb 14 2023 18:59:41) (NTS gcc aarch64)
Copyright (c) The PHP Group
Zend Engine v4.1.16, Copyright (c) Zend Technologies
[root@465f690e16f3 SPECS]#

Although like you've said it's /opt/rh , how can I replace it with opt/remi ?

Re: Creating symlink and paths for 8.1.14

Again, everything is set in my mock configuration file (see previous link)

BTW, I really think "remi" should be used only for stuff in my repository.
and it makes sense to use your own vendor name.

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

45 (edited by kdgeorgiev 2023-02-23 15:14:22)

Re: Creating symlink and paths for 8.1.14

Thanks for the heads up!
Apologies for trying to use the remi name. I doubt that we would be able to make it.
Also it looks like we may switch to single version.

Re: Creating symlink and paths for 8.1.14

Evening Remi!

I was able to build the SCL PHP with mock and your packages.
But I'm going wrong somewhere and can't get the path right.

At the moment I get /opt/kkk/php81/root/etc but I want to have this path /etc/opt/kkk/php81. Where do I go wrong ?

And I see my php.d and php.ini here /opt/kkk/php81/root/etc.

Re: Creating symlink and paths for 8.1.14

layout choice is managed by the nfsmountable/rh_layout option

which is properly set in the spec file
https://git.remirepo.net/cgit/rpms/scl- … 1.spec#n15

Or you are using a too old version of scl-utils (latest is 20130529-19.el7) not aware of this flag

Or php81-build is not installed in the mock buildroot

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: Creating symlink and paths for 8.1.14

Thanks!

Just checked on my Mock configuration template;

scl-utils                                                                                                                                                           20130529-19.el7                                                                                                                                                       
scl-utils-build                                                                                                                                                        20130529-19.el7

They're the same!
It seems I need to add the php81-build in the mock.cfg and chroot that is initialised.

Re: Creating symlink and paths for 8.1.14

> It seems I need to add the php81-build in the mock.cfg and chroot that is initialised.

Yes, as already explained in a previous answer...
https://forum.remirepo.net/viewtopic.ph … 437#p12437

=> - with php81-devel in buildroot, build the "php81-php" main package and needed extensions

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: Creating symlink and paths for 8.1.14

Local repo in my machine added to the php81 mock configuration should fix it.

Thank you Remi!