#author("2024-10-26T18:13:39+00:00","default:sysosa","sysosa")
#author("2024-10-27T09:47:07+00:00","default:sysosa","sysosa")
***rpmbuildの下準備 [#j273d720]
っで、まずは下準備
#code(nonumber){{
[root@openpbs ~]# cat /etc/redhat-release
Rocky Linux release 8.10 (Green Obsidian)
[root@openpbs ~]#

[root@openpbs ~]# mkdir -p ~/rpmbuild/{SOURCES,SPECS}
}}


***pbsproソースファイルの作成 [#d82340c1]
[[https://github.com/openpbs/openpbs>+https://github.com/openpbs/openpbs]]から最新コードが入手可能です.
&size(10){最新の「a84a5315fb860037bd9d0b380396e2010511237c」はubuntu24向けでRHEL9でコンパイルするとエラーがでる};
&size(10){tagのv23.06.06には無害なのですが「pbs_mom;TPP;pbs_mom(Thread 0);tpp_mbox_read;Unable to read from msg box」がずっと継続的に流れる..};
&size(10){2024.10時点では「20e112a2c16968eec72c4b16a9dbd397ad7601fb」がよさげ};

#code(nonumber){{
[root@openpbs ~]# git clone https://github.com/openpbs/openpbs
[root@openpbs ~]# cd openpbs/
[root@openpbs openpbs]# git tag | tail -n 3
v20.0.1
v22.05.11
v23.06.06
[root@openpbs openpbs]# git checkout -b v23.06.06 refs/tags/v23.06.06
Switched to a new branch 'v23.06.06'

[root@openpbs openpbs]# git branch
  master
* v23.06.06
[root@openpbs openpbs]# less openpbs.spec
 :
%if !%{defined pbs_version}
%define pbs_version 23.06.06
 :
[root@openpbs openpbs]#
}}

ジョブ名に「/」があるとエラーになるので、回避策を入れます.   &size(10){これがないとrelionでOpenPBSが使えない...};
#code(diff,nonumber){{
--- 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でビルドするための準備 [#lf45984a]

#code(nonumber){{
[root@openpbs openpbs]# cd ..
[root@openpbs ~]# 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ファイルが用意されているのでこれをそのまま採用します

#code(nonumber){{
[root@openpbs ~]# cp openpbs/openpbs.spec ~/rpmbuild/SPECS/
}}
そのままでもいいのだが、一部specファイルを修正します。

***OpenPBS specファイルの修正 [#f88ebabd]
OpenPBSの既定の場所を変更してます.  &size(10){全くの好みです. Torqueがこの場所を使っていたので};
#code(diff,nonumber){{
--- rpmbuild/SPECS/openpbs.spec.orig    2024-10-08 18:09:33.682257512 +0900
+++ rpmbuild/SPECS/openpbs.spec 2024-10-08 18:10:28.850805680 +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の実行 [#s821d4df]
その前にOpenPBSのbiuldに必要なパッケージをdnfでインストール
&size(10){OSインストール時に「Develpment Tools」を入れていれば下記でOKみたい};
#code(nonumber){{
[root@openpbs ~]# 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 libpciaccess-devel numactl-devel
[root@openpbs ~]# 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を実行します
#code(nonumber){{
[root@openpbs ~]# rpmbuild -ba rpmbuild/SPECS/openpbs.spec
}}


完成品がこれ
#code(nonumber){{
[root@openpbs ~]# ls -l rpmbuild/RPMS/x86_64/
-rw-r--r--. 1 root root 1762096 Oct  9 19:16 openpbs-client-23.06.06-0.x86_64.rpm
-rw-r--r--. 1 root root 1790716 Oct  9 19:16 openpbs-client-debuginfo-23.06.06-0.x86_64.rpm
-rw-r--r--. 1 root root  584400 Oct  9 19:16 openpbs-debuginfo-23.06.06-0.x86_64.rpm
-rw-r--r--. 1 root root 1849008 Oct  9 19:16 openpbs-debugsource-23.06.06-0.x86_64.rpm
-rw-r--r--. 1 root root  531156 Oct  9 19:16 openpbs-devel-23.06.06-0.x86_64.rpm
-rw-r--r--. 1 root root 2081620 Oct  9 19:16 openpbs-execution-23.06.06-0.x86_64.rpm
-rw-r--r--. 1 root root 2429128 Oct  9 19:16 openpbs-execution-debuginfo-23.06.06-0.x86_64.rpm
-rw-r--r--. 1 root root 2981852 Oct  9 19:16 openpbs-server-23.06.06-0.x86_64.rpm
-rw-r--r--. 1 root root 6960124 Oct  9 19:16 openpbs-server-debuginfo-23.06.06-0.x86_64.rpm
[root@openpbs ~]#
}}
品目が分かりやすくていい


***rockylinux8で v14.1.2 のpbspro を作るには [#g7cb398d]

#code(nonumber){{
[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]# 
}}
#code(nonumber){{
[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 ~]#
}}


#code(diff,nonumber){{
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.
}}


#code(nonumber){{
[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
}}
#code(diff,nonumber){{
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 \
 
}}
#code(diff,nonumber){{
[root@rockylinux ~]# rpmbuild -ba rpmbuild/SPECS/openpbs.spec
}}
1

トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS