This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
aix:rpm_install [2023/10/12 14:11] manu |
aix:rpm_install [2025/06/03 18:05] (current) manu [RPM DB corrupt] |
||
|---|---|---|---|
| Line 166: | Line 166: | ||
| ====== RPM: create a package ====== | ====== RPM: create a package ====== | ||
| - | <code> | + | Compile your libraries and binaries and put them on the relative target path starting to /opt/freeware/src/packages/BUILD |
| - | Se mettre sur 1 machine AIX5.2 (car les .rpm ont une compatibilité ascendante) | + | |
| - | Créer un fichier .spec dans /opt/freeware/src/packages/SPECS | + | Create a spec file with the files names |
| + | <cli prompt='#'> | ||
| + | [root@labo]/opt/freeware/src/packages# cat SPECS/libssh2\-1.11.1.spec | ||
| + | Name: libssh2 | ||
| + | Version: 1.11.1 | ||
| + | Release: 2 | ||
| + | Summary: A library implementing the SSH2 protocol | ||
| - | Ex : logrorate-3.5.9.spec | + | Group: System Environment/Libraries |
| + | License: BSD | ||
| + | URL: https://app-bldns01-h.oi.bdl.lu/doku.php?id=aix:libssh2_compile | ||
| + | Source0: https://github.com/libssh2/libssh2.git | ||
| + | BuildRequires: zlib-devel | ||
| + | BuildRequires: pkg-config, make | ||
| + | BuildRequires: libgcc >= 6.3.0-1 | ||
| + | Requires: zlib | ||
| + | Requires: libgcc >= 8.3.0-1 | ||
| + | |||
| + | %description | ||
| + | libssh2 is a library implementing the SSH2 protocol as defined by | ||
| + | Internet Drafts: SECSH-TRANS(22), SECSH-USERAUTH(25), | ||
| + | SECSH-CONNECTION(23), SECSH-ARCH(20), SECSH-FILEXFER(06)*, | ||
| + | SECSH-DHGEX(04), and SECSH-NUMBERS(10). | ||
| + | |||
| + | The library is available as 32-bit and 64-bit. | ||
| + | |||
| + | %files | ||
| + | /opt/freeware/lib/libssh2.a | ||
| + | /opt/freeware/lib64/libssh2.a | ||
| + | |||
| + | %changelog | ||
| + | * Tue Jun 04 2024 - 1.11.1-1 | ||
| + | - Build custom | ||
| + | </cli> | ||
| + | |||
| + | Test package creation, and adapt the file location (depnding from RPM generation!) | ||
| + | <cli prompt='#'> | ||
| + | [root@labo]/opt/freeware/src/packages# /usr/bin/rpmbuild -bb SPECS/libssh2-1.11.1.spec | ||
| + | Processing files: libssh2-1.11.1-2.ppc | ||
| + | error: File not found: /var/tmp/libssh2-1.11.1-2.ppc/opt/freeware/lib/libssh2.a | ||
| + | error: File not found: /var/tmp/libssh2-1.11.1-2.ppc/opt/freeware/lib64/libssh2.a | ||
| + | |||
| + | RPM build errors: | ||
| + | File not found: /var/tmp/libssh2-1.11.1-2.ppc/opt/freeware/lib/libssh2.a | ||
| + | File not found: /var/tmp/libssh2-1.11.1-2.ppc/opt/freeware/lib64/libssh2.a | ||
| + | |||
| + | |||
| + | [root@labo]/opt/freeware/src/packages# mkdir -p /var/tmp/libssh2-1.11.1-2.ppc/opt/freeware/lib | ||
| + | [root@labo]/opt/freeware/src/packages# mkdir -p /var/tmp/libssh2-1.11.1-2.ppc/opt/freeware/lib64/ | ||
| + | [root@labo]/opt/freeware/src/packages# cp BUILD/opt/freeware/lib/libssh2.a /var/tmp/libssh2-1.11.1-2.ppc/opt/freeware/lib | ||
| + | [root@labo]/opt/freeware/src/packages# cp BUILD/opt/freeware/lib64/libssh2.a /var/tmp/libssh2-1.11.1-2.ppc/opt/freeware/lib64 | ||
| + | </cli> | ||
| + | |||
| + | Now you are ready to build the RPM package | ||
| + | <cli prompt='#'> | ||
| + | [root@systemh]/opt/freeware/src/packages# /usr/bin/rpmbuild -bb SPECS/libssh2\-1.11.1.spec | ||
| + | Processing files: libssh2-1.11.1-2.ppc | ||
| + | warning: Deprecated external dependency generator is used! | ||
| + | Finding Provides: /usr/opt/rpm/lib/rpm/find-provides | ||
| + | Finding Requires(interp): | ||
| + | Finding Requires(rpmlib): | ||
| + | Finding Requires(verify): | ||
| + | Finding Requires(pre): | ||
| + | Finding Requires(post): | ||
| + | Finding Requires(preun): | ||
| + | Finding Requires(postun): | ||
| + | Finding Requires(pretrans): | ||
| + | Finding Requires(posttrans): | ||
| + | Finding Requires: /usr/opt/rpm/lib/rpm/find-requires | ||
| + | Finding Conflicts: | ||
| + | Finding Obsoletes: | ||
| + | Finding Recommends: | ||
| + | Finding Suggests: | ||
| + | Finding Supplements: | ||
| + | Finding Enhances: | ||
| + | Provides: libssh2 = 1.11.1-2 libssh2.a(libssh2.so.1) | ||
| + | Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 | ||
| + | Requires: libc.a(shr.o) libc.a(shr_64.o) libcrypto.a(libcrypto.so.3) libgcc_s.a(shr.o) | ||
| + | Wrote: /opt/freeware/src/packages/RPMS/ppc/libssh2-1.11.1-2.aix7.2.ppc.rpm | ||
| + | Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.DJB7ea | ||
| + | + umask 022 | ||
| + | + cd /opt/freeware/src/packages/BUILD | ||
| + | + /bin/rm -rf /var/tmp/libssh2-1.11.1-2.ppc | ||
| + | + RPM_EC=0 | ||
| + | + jobs -p | ||
| + | + exit 0 | ||
| + | [root@systemh]/opt/freeware/src/packages# ll /opt/freeware/src/packages/RPMS/ppc/libssh2-1.11.1-2.aix7.2.ppc.rpm | ||
| + | 684 -rw-r--r-- 1 root system 697152 Jun 4 17:23 /opt/freeware/src/packages/RPMS/ppc/libssh2-1.11.1-2.aix7.2.ppc.rpm | ||
| + | [root@systemh]/opt/freeware/src/packages# rpm -qpl /opt/freeware/src/packages/RPMS/ppc/libssh2-1.11.1-2.aix7.2.ppc.rpm | ||
| + | /opt/freeware/lib/libssh2.a | ||
| + | /opt/freeware/lib64/libssh2.a | ||
| + | </cli> | ||
| + | |||
| + | Another example of spec file | ||
| + | |||
| + | create a spec file .spec dans /opt/freeware/src/packages/SPECS | ||
| + | |||
| + | Ex : logrorate-3.5.9.spec | ||
| + | <code> | ||
| Summary : A utility for rotate log following different parmeters. | Summary : A utility for rotate log following different parmeters. | ||
| Name : logrotate | Name : logrotate | ||
| Line 238: | Line 333: | ||
| ====== ERRORS ====== | ====== ERRORS ====== | ||
| + | |||
| + | ===== YUM lua_newuserdata ===== | ||
| + | |||
| + | After upgrading the rpm package db4, RPMDB is corrupt | ||
| + | <cli prompt='#'> | ||
| + | root@devsrv - /mnt/rpm # yum update | ||
| + | There was a problem importing one of the Python modules | ||
| + | required to run yum. The error leading to this problem was: | ||
| + | |||
| + | rtld: 0712-001 Symbol lua_newuserdata was referenced | ||
| + | from module /usr/opt/rpm/lib/librpmio.so(), but a runtime definition | ||
| + | of the symbol was not found. | ||
| + | |||
| + | Please install a package which provides this module, or | ||
| + | verify that the module is installed correctly. | ||
| + | |||
| + | It's possible that the above module doesn't match the | ||
| + | current version of Python, which is: | ||
| + | 2.7.18 (default, Dec 15 2022, 05:12:43) | ||
| + | [GCC 8.3.0] | ||
| + | |||
| + | If you cannot solve this problem yourself, please go to | ||
| + | the yum faq at: | ||
| + | http://yum.baseurl.org/wiki/Faq | ||
| + | </cli> | ||
| + | |||
| + | uninstall the packages yum (rpm -qa | grep yum) | ||
| + | <code> | ||
| + | yum-metadata-parser-1.1.4-2.ppc | ||
| + | yum-3.4.3-8.noarch | ||
| + | </code> | ||
| + | |||
| + | Download and install the DNF bundle instead from https://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/ezinstall/ppc/ | ||
| + | |||
| + | <cli prompt='#'> | ||
| + | root@devsrv - /mnt/dnf_bundle_aix_71_72_v8# ./install_dnf.sh -d | ||
| + | </cli> | ||
| ===== RPM DB corrupt ===== | ===== RPM DB corrupt ===== | ||