rpmbuildの下準備

っで、まずは下準備

[root@rockylinux9 ~]# cat /etc/redhat-release
Rocky Linux release 9.2 (Blue Onyx)
 
[root@rockylinux9 ~]# mkdir -p ~/rpmbuild/{SOURCES,SPECS}

pbsproソースファイルの作成

https://github.com/openpbs/openpbsから最新コードが入手可能で、
ここでは v20.0.1 を調理します. *branchで最新系列でもいいのですが、特定のバージョンで作ることにしました
まずはgitで取得します

[root@rockylinux9 ~]# git clone https://github.com/openpbs/openpbs
[root@rockylinux9 ~]# cd openpbs/
[root@rockylinux9 openpbs]# git tag
 :
v20.0.0
v20.0.1
v22.05.11
v23.06.06
 
[root@rockylinux9 openpbs]# git checkout -b v23.06.06 refs/tags/v23.06.06
Switched to a new branch 'v23.06.06'
[root@rockylinux9 openpbs]#
 
[root@rockylinux9 openpbs]# git branch
  master
* v23.06.06
[root@rockylinux9 openpbs]# less openpbs.spec
 :
%if !%{defined pbs_version}
%define pbs_version 23.06.06
 :
[root@rockylinux9 openpbs]#

ジョブ名に「/」があるとエラーになるので、回避策を入れます. これがないとrelionでOpenPBSが使えない...

diff --git a/src/lib/Libcmds/ck_job_name.c b/src/lib/Libcmds/ck_job_name.c
index 068f4ad2..05a0d113 100644
--- a/src/lib/Libcmds/ck_job_name.c
+++ b/src/lib/Libcmds/ck_job_name.c
@@ -59,7 +59,7 @@ isalnumspch(int c)
        if (isalnum(c) != 0)
                return c;
 
-       if (c == '-' || c == '_' || c == '+' || c == '.')
+       if (c == '-' || c == '_' || c == '+' || c == '.' || c == '/' )
                return c;
 
        return 0;

rpmbuildでビルドするための準備

[root@rockylinux9 openpbs]# cd ..
[root@rockylinux9 ~]# tar --exclude-vcs --transform 's/openpbs/openpbs-23.06.06/' -cvzf ~/rpmbuild/SOURCES/openpbs-23.06.06.tar.gz openpbs

これで「~/rpmbuild/SOURCES」にソースtarballが用意される(~/rpmbuild/SOURCES/openpbs-23.06.06.tar.gz)

あとはopenpbsのspecファイルを「~/rpmbuild/SPECS/」内に配置する
幸い openpbs の git にはopenpbs.specファイルが用意されているのでこれをそのまま採用します

[root@rockylinux9 ~]# cp openpbs/openpbs.spec ~/rpmbuild/SPECS/

そのままでもいいのだが、一部specファイルを修正します。

OpenPBS specファイルの修正

OpenPBSの既定の場所を変更してます. 全くの好みです. Torqueがこの場所を使っていたので

--- /root/rpmbuild/SPECS/openpbs.spec.orig      2023-06-27 12:34:07.369310030 +0900
+++ /root/rpmbuild/SPECS/openpbs.spec   2023-06-27 12:34:23.604448966 +0900
@@ -56,7 +56,7 @@
 %endif
 
 %if !%{defined pbs_home}
-%define pbs_home /var/spool/pbs
+%define pbs_home /var/lib/pbs
 %endif
 
 %if !%{defined pbs_dbuser}

rpmbuildの実行

その前にOpenPBSのbiuldに必要なパッケージをdnfでインストール
OSインストール時に「Develpment Tools」を入れていれば下記でOKみたい

[root@rockylinux9 ~]# dnf --enablerepo=devel install expat-devel hwloc-devel libX11-devel libXt-devel libedit-devel libical-devel libpq-devel ncurses-devel perl postgresql-contrib python3-devel swig tcl-devel tk-devel libtool-ltdl-devel

そうしてrpmbuildを実行します

[root@rockylinux9 ~]# rpmbuild -ba rpmbuild/SPECS/openpbs.spec

完成品がこれ

[root@rockylinux9 ~]# ls -l rpmbuild/RPMS/x86_64/
total 19780
-rw-r--r--. 1 root root 1696132 Jun 27 12:54 openpbs-client-23.06.06-0.x86_64.rpm
-rw-r--r--. 1 root root 1737324 Jun 27 12:54 openpbs-client-debuginfo-23.06.06-0.x86_64.rpm
-rw-r--r--. 1 root root  745840 Jun 27 12:54 openpbs-debuginfo-23.06.06-0.x86_64.rpm
-rw-r--r--. 1 root root 1563466 Jun 27 12:54 openpbs-debugsource-23.06.06-0.x86_64.rpm
-rw-r--r--. 1 root root  538411 Jun 27 12:54 openpbs-devel-23.06.06-0.x86_64.rpm
-rw-r--r--. 1 root root 1960283 Jun 27 12:54 openpbs-execution-23.06.06-0.x86_64.rpm
-rw-r--r--. 1 root root 2316532 Jun 27 12:54 openpbs-execution-debuginfo-23.06.06-0.x86_64.rpm
-rw-r--r--. 1 root root 2744314 Jun 27 12:54 openpbs-server-23.06.06-0.x86_64.rpm
-rw-r--r--. 1 root root 6931544 Jun 27 12:54 openpbs-server-debuginfo-23.06.06-0.x86_64.rpm
[root@rockylinux9 ~]#

品目が分かりやすくていい

rockylinux8で v14.1.2 のpbspro を作るには

[root@rockylinux ~]# cat /etc/redhat-release
Rocky Linux release 8.8 (Green Obsidian)
[root@rockylinux ~]# mkdir -p ~/rpmbuild/{SOURCES,SPECS}
[root@rockylinux ~]# git clone https://github.com/openpbs/openpbs
[root@rockylinux ~]# cd openpbs/
[root@rockylinux openpbs]# git checkout -b v14.1.2 refs/tags/v14.1.2
[root@rockylinux openpbs]# git branch
  master
* v14.1.2
[root@rockylinux openpbs]#
[root@rockylinux ~]# dnf --enablerepo=devel install expat-devel hwloc-devel libX11-devel libXt-devel libedit-devel libical-devel \
    libpq-devel ncurses-devel perl postgresql-contrib python3-devel swig tcl-devel tk-devel libtool-ltdl-devel \
    python2-devel
 
[root@rockylinux ~]# alternatives --config python
 
There are 3 programs which provide 'python'.
 
  Selection    Command
-----------------------------------------------
*+ 1           /usr/libexec/no-python
   2           /usr/bin/python3
   3           /usr/bin/python2
 
Enter to keep the current selection[+], or type selection number: 3
[root@rockylinux ~]#
[root@rockylinux ~]# python -V
Python 2.7.18
[root@rockylinux ~]#
diff --git a/m4/with_libical.m4 b/m4/with_libical.m4
index dc14512b..279c53de 100644
--- a/m4/with_libical.m4
+++ b/m4/with_libical.m4
@@ -47,9 +47,9 @@ AC_DEFUN([PBS_AC_WITH_LIBICAL],
     libical_dir=["/usr"]
   )
   AC_MSG_CHECKING([for libical])
-  AS_IF([test -r "$libical_dir/include/ical.h"],
+  AS_IF([test -r "$libical_dir/include/libical/ical.h"],
     AS_IF([test "$libical_dir" != "/usr"],
-      [libical_inc="-I$libical_dir/include"]),
+      [libical_inc="-I$libical_dir/include/libical"]),
     AC_MSG_ERROR([libical headers not found.]))
   AS_IF([test "$libical_dir" = "/usr"],
     # Using system installed libical
diff --git a/src/lib/Libcmds/ck_job_name.c b/src/lib/Libcmds/ck_job_name.c
index 2fd99ebf..49bfc1df 100644
--- a/src/lib/Libcmds/ck_job_name.c
+++ b/src/lib/Libcmds/ck_job_name.c
@@ -55,7 +55,7 @@ isalnumspch(int c)
        if (isalnum(c) != 0)
                return c;
 
-       if (c == '-' || c == '_' || c == '+')
+       if (c == '-' || c == '_' || c == '+' || c == '.' || c == '/' )
                return c;
 
        return 0;
diff --git a/src/lib/Libutil/pbs_aes_encrypt.c b/src/lib/Libutil/pbs_aes_encrypt.c
index a81c7c58..092178fa 100644
--- a/src/lib/Libutil/pbs_aes_encrypt.c
+++ b/src/lib/Libutil/pbs_aes_encrypt.c
@@ -31,27 +31,27 @@ extern unsigned char pbs_aes_iv[];
 int
 pbs_encrypt_data(char *uncrypted, int *credtype, size_t len, char **crypted, size_t *outlen)
 {
-        EVP_CIPHER_CTX ctx;
+        EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new();;
         int plen, len2 = 0;
         char *cblk;
 
-        EVP_CIPHER_CTX_init(&ctx);
+        EVP_CIPHER_CTX_init(ctx);
 
-        if (EVP_EncryptInit_ex(&ctx, EVP_aes_256_cbc(), NULL, (const unsigned char *) pbs_aes_key, (const unsigned char *) pbs_aes_iv) == 0)
+        if (EVP_EncryptInit_ex(ctx, EVP_aes_256_cbc(), NULL, (const unsigned char *) pbs_aes_key, (const unsigned char *) pbs_aes_iv) == 0)
                 return -1;
 
-        plen = len + EVP_CIPHER_CTX_block_size(&ctx) + 1;
+        plen = len + EVP_CIPHER_CTX_block_size(ctx) + 1;
         cblk = malloc(plen);
         if (!cblk)
                 return -1;
 
-        if (EVP_EncryptUpdate(&ctx, cblk, &plen, uncrypted, len) == 0)
+        if (EVP_EncryptUpdate(ctx, cblk, &plen, uncrypted, len) == 0)
                 return -1;
 
-        if (EVP_EncryptFinal_ex(&ctx, cblk + plen, &len2) == 0)
+        if (EVP_EncryptFinal_ex(ctx, cblk + plen, &len2) == 0)
                 return -1;
 
-        EVP_CIPHER_CTX_cleanup(&ctx);
+        EVP_CIPHER_CTX_free(ctx);
 
         *crypted = cblk;
         *outlen = plen + len2;
@@ -88,27 +88,27 @@ pbs_encrypt_pwd(char *str, int *credtype, char **credbuf, size_t *credlen)
 int
 pbs_decrypt_data(char *crypted, int credtype, size_t len, char **uncrypted, size_t *outlen)
 {
-        EVP_CIPHER_CTX ctx;
+        EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new();
         char *cblk;
         int plen, len2 = 0;
 
 
-        EVP_CIPHER_CTX_init(&ctx);
+        EVP_CIPHER_CTX_init(ctx);
 
-        if (EVP_DecryptInit_ex(&ctx, EVP_aes_256_cbc(), NULL, (const unsigned char *) pbs_aes_key, (const unsigned char *) pbs_aes_iv) == 0)
+        if (EVP_DecryptInit_ex(ctx, EVP_aes_256_cbc(), NULL, (const unsigned char *) pbs_aes_key, (const unsigned char *) pbs_aes_iv) == 0)
                 return -1;
 
-        cblk = malloc(len + EVP_CIPHER_CTX_block_size(&ctx) + 1);
+        cblk = malloc(len + EVP_CIPHER_CTX_block_size(ctx) + 1);
         if (!cblk)
                 return -1;
 
-        if (EVP_DecryptUpdate(&ctx, cblk, &plen, crypted, len) == 0)
+        if (EVP_DecryptUpdate(ctx, cblk, &plen, crypted, len) == 0)
                 return -1;
 
-        if (EVP_DecryptFinal_ex(&ctx, cblk + plen, &len2) == 0)
+        if (EVP_DecryptFinal_ex(ctx, cblk + plen, &len2) == 0)
                 return -1;
 
-        EVP_CIPHER_CTX_cleanup(&ctx);
+        EVP_CIPHER_CTX_free(ctx);
 
         *uncrypted = cblk;
         *outlen = plen + len2;
diff --git a/src/lib/Libutil/pbs_ical.c b/src/lib/Libutil/pbs_ical.c
index 948ebc57..4a8abab0 100644
--- a/src/lib/Libutil/pbs_ical.c
+++ b/src/lib/Libutil/pbs_ical.c
@@ -62,7 +62,7 @@
 
 #include "pbs_error.h"
 #ifdef LIBICAL
-#include "ical.h"
+#include "libical/ical.h"
 #endif
 
 #define DATE_LIMIT (3*(60*60*24*365)) /* Limit to 3 years from now */
@@ -99,6 +99,7 @@ get_num_occurrences(char *rrule, time_t dtstart, char *tz)
        time_t now;
        time_t date_limit;
        int num_resv = 0;
+       int icalerror_errors_are_fatal;
 
        /* if any of the argument is NULL, we are dealing with
         * advance reservation, so return 1 occurrence */
@@ -119,7 +120,7 @@ get_num_occurrences(char *rrule, time_t dtstart, char *tz)
 
        rt = icalrecurrencetype_from_string(rrule);
 
-       start = icaltime_from_timet(dtstart, 0);
+       start = icaltime_from_timet_with_zone(dtstart, 0, localzone);
        icaltimezone_convert_time(&start, icaltimezone_get_utc_timezone(), localzone);
 
        itr = (struct icalrecur_iterator_impl*) icalrecur_iterator_new(rt, start);
@@ -178,6 +179,7 @@ get_occurrence(char *rrule, time_t dtstart, char *tz, int idx)
        struct icalrecur_iterator_impl *itr;
        int i;
        time_t next_occr = dtstart;
+       int icalerror_errors_are_fatal;
 
        if (rrule == NULL)
                return dtstart;
@@ -196,7 +198,7 @@ get_occurrence(char *rrule, time_t dtstart, char *tz, int idx)
 
        rt = icalrecurrencetype_from_string(rrule);
 
-       start = icaltime_from_timet(dtstart, 0);
+       start = icaltime_from_timet_with_zone(dtstart, 0, localzone);
        icaltimezone_convert_time(&start, icaltimezone_get_utc_timezone(), localzone);
        next = start;
 
@@ -268,6 +270,7 @@ check_rrule(char *rrule, time_t dtstart, time_t dtend, char *tz, int *err_code)
        long min_occr_duration = -1;
        long tmp_occr_duration = 0;
        long duration;
+       int icalerror_errors_are_fatal;
 
        *err_code = 0;
        icalerror_clear_errno();
@@ -336,7 +339,7 @@ check_rrule(char *rrule, time_t dtstart, time_t dtend, char *tz, int *err_code)
                return 0;
        }
 
-       start = icaltime_from_timet(dtstart, 0);
+       start = icaltime_from_timet_with_zone(dtstart, 0, localzone);
        icaltimezone_convert_time(&start, icaltimezone_get_utc_timezone(), localzone);
 
        itr = (struct icalrecur_iterator_impl*) icalrecur_iterator_new(rt, start);
diff --git a/src/resmom/mom_main.c b/src/resmom/mom_main.c
index cefd2a0a..34ed3e6b 100644
--- a/src/resmom/mom_main.c
+++ b/src/resmom/mom_main.c
@@ -10457,7 +10457,7 @@ mom_topology(void)
        if (hwloc_topology_init(&topology) == -1)
                ret = -1;
        else if ((hwloc_topology_load(topology) == -1) ||
-               (hwloc_topology_export_xmlbuffer(topology, &xmlbuf, &xmllen) == -1)) {
+               (hwloc_topology_export_xmlbuffer(topology, &xmlbuf, &xmllen, HWLOC_TOPOLOGY_EXPORT_XML_FLAG_V1) == -1)) {
                hwloc_topology_destroy(topology);
                ret = -1;
        }
diff --git a/test/fw/bin/pbs_loganalyzer b/test/fw/bin/pbs_loganalyzer
index bacd764f..28dbc4ae 100644
--- a/test/fw/bin/pbs_loganalyzer
+++ b/test/fw/bin/pbs_loganalyzer
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python2
 # coding: utf-8
 
 # Copyright (C) 1994-2016 Altair Engineering, Inc.
diff --git a/test/fw/bin/pbs_stat b/test/fw/bin/pbs_stat
index 83af397c..832de5ef 100644
--- a/test/fw/bin/pbs_stat
+++ b/test/fw/bin/pbs_stat
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python2
 # coding: utf-8
 
 # Copyright (C) 1994-2016 Altair Engineering, Inc.
[root@rockylinux openpbs]# cd ..
[root@rockylinux ~]# tar --exclude-vcs --transform 's/openpbs/pbspro-14.1.2/' -cvzf ~/rpmbuild/SOURCES/pbspro-14.1.2.tar.gz openpbs
[root@rockylinux ~]# cp openpbs/pbspro.spec ~/rpmbuild/SPECS/
[root@rockylinux ~]# vi rpmbuild/SPECS/pbspro.spec
diff -u openpbs/pbspro.spec ./rpmbuild/SPECS/pbspro.spec
--- openpbs/pbspro.spec 2024-05-29 22:53:56.148393717 +0900
+++ ./rpmbuild/SPECS/pbspro.spec        2024-05-30 01:19:11.982147204 +0900
@@ -42,7 +42,7 @@
 %define pbs_version 14.1.2
 %define pbs_release 0
 %define pbs_prefix /opt/pbs
-%define pbs_home /var/spool/pbs
+%define pbs_home /var/lib/pbs
 %define pbs_dbuser postgres
 %define pbs_dist %{pbs_name}-%{pbs_version}.tar.gz
 
@@ -79,8 +79,7 @@
 BuildRequires: ncurses-devel
 BuildRequires: perl
 BuildRequires: postgresql-devel
-BuildRequires: python-devel >= 2.6
-BuildRequires: python-devel < 3.0
+BuildRequires: python2-devel >= 2.6
 BuildRequires: tcl-devel
 BuildRequires: tk-devel
 BuildRequires: swig
@@ -100,8 +99,8 @@
 %endif
 
 # Pure python extensions use the 32 bit library path
-%{!?py_site_pkg_32: %global py_site_pkg_32 %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(0)")}
-%{!?py_site_pkg_64: %global py_site_pkg_64 %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
+%{!?py_site_pkg_32: %global py_site_pkg_32 %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(0)")}
+%{!?py_site_pkg_64: %global py_site_pkg_64 %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
 
 %description
 PBS Professional&#174; is a fast, powerful workload manager and
@@ -123,8 +122,7 @@
 Requires: expat
 Requires: libedit
 Requires: postgresql-server
-Requires: python >= 2.6
-Requires: python < 3.0
+Requires: python2 >= 2.6
 Requires: sendmail
 Requires: tcl
 Requires: tk
@@ -156,8 +154,7 @@
 Conflicts: pbs-mom
 Conflicts: pbs-cmds
 Requires: expat
-Requires: python >= 2.6
-Requires: python < 3.0
+Requires: python2 >= 2.6
 Autoreq: 1
 
 %description %{pbs_execution}
@@ -181,8 +178,7 @@
 Conflicts: pbs
 Conflicts: pbs-mom
 Conflicts: pbs-cmds
-Requires: python >= 2.6
-Requires: python < 3.0
+Requires: python2 >= 2.6
 Autoreq: 1
 
 %description %{pbs_client}
@@ -205,6 +201,7 @@
 
 %build
 [ -d build ] && rm -rf build
+./autogen.sh
 mkdir build
 cd build
 ../configure \
[root@rockylinux ~]# rpmbuild -ba rpmbuild/SPECS/openpbs.spec
最新の60件
2024-07-25 2024-07-24 2024-07-16 2024-07-15 2024-07-12 2024-07-07 2024-06-29 2024-06-22 2024-06-21 2024-06-17 2024-06-14 2024-06-11 2024-06-10 2024-06-08 2024-06-07 2024-06-02 2024-06-01 2024-05-30 2024-05-16 2024-04-26 2024-04-15 2024-04-11 2024-04-06 2024-04-05 2024-03-30 2024-03-29 2024-03-19 2024-03-15 2024-03-06 2024-03-05 2024-03-03 2024-02-23 2024-02-22 2024-02-21 2024-02-20 2024-02-19 2024-02-18 2024-02-13 2024-02-12 2024-02-09 2024-02-04 2024-02-03

edit


トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2024-05-30 (木) 01:20:00