Accepting request 644809 from home:wanghaisu:branches:Base:System
Update to 1.7.0. Fixed all comments of sr#644757 from Martin except python_sitelib. OBS-URL: https://build.opensuse.org/request/show/644809 OBS-URL: https://build.opensuse.org/package/show/Base:System/libstoragemgmt?expand=0&rev=48
This commit is contained in:
parent
2b83cf0ba9
commit
ee8dcc0941
@ -1,258 +0,0 @@
|
|||||||
commit edbd5fed3cb5f4f48dcc7ee97f601d2ea3537911
|
|
||||||
Author: Gris Ge <fge@redhat.com>
|
|
||||||
Date: Fri Mar 23 20:38:55 2018 +0800
|
|
||||||
|
|
||||||
Fix GCC 8 compile warnings.
|
|
||||||
|
|
||||||
* Fix '-Werror=format-truncation' warning by increase the buffer size.
|
|
||||||
* Fix '-Werror=cast-function-type' warning by disable it for Python c
|
|
||||||
extension, reason:
|
|
||||||
https://stackoverflow.com/questions/10264080/python-c-extension-why-are-methods-that-use-keyword-arguments-cast-to-pycfunct
|
|
||||||
|
|
||||||
diff --git a/c_binding/libsg.c b/c_binding/libsg.c
|
|
||||||
index 75ee39d..4689369 100644
|
|
||||||
--- a/c_binding/libsg.c
|
|
||||||
+++ b/c_binding/libsg.c
|
|
||||||
@@ -367,8 +367,9 @@ static int _sg_io_open(char *err_msg, const char *disk_path, int *fd,
|
|
||||||
* The 'sense_key' is the output pointer.
|
|
||||||
* Return 0 if sense_key is _T10_SPC_SENSE_KEY_NO_SENSE or
|
|
||||||
* _T10_SPC_SENSE_KEY_RECOVERED_ERROR, return -1 otherwise.
|
|
||||||
+ * sense_err_msg should be char[_LSM_ERR_MSG_LEN / 2]
|
|
||||||
*/
|
|
||||||
-static int _check_sense_data(char *err_msg, uint8_t *sense_data,
|
|
||||||
+static int _check_sense_data(char *sense_err_msg, uint8_t *sense_data,
|
|
||||||
uint8_t *sense_key);
|
|
||||||
|
|
||||||
static int _extract_ata_sense_data(char *err_msg, uint8_t *sense_data,
|
|
||||||
@@ -485,14 +486,14 @@ int _sg_io_vpd(char *err_msg, int fd, uint8_t page_code, uint8_t *data)
|
|
||||||
int rc_vpd_00 = 0;
|
|
||||||
char strerr_buff[_LSM_ERR_MSG_LEN];
|
|
||||||
uint8_t sense_key = _T10_SPC_SENSE_KEY_NO_SENSE;
|
|
||||||
- char sense_err_msg[_LSM_ERR_MSG_LEN];
|
|
||||||
+ char sense_err_msg[_LSM_ERR_MSG_LEN / 2];
|
|
||||||
ssize_t data_len = 0;
|
|
||||||
|
|
||||||
assert(err_msg != NULL);
|
|
||||||
assert(fd >= 0);
|
|
||||||
assert(data != NULL);
|
|
||||||
|
|
||||||
- memset(sense_err_msg, 0, _LSM_ERR_MSG_LEN);
|
|
||||||
+ memset(sense_err_msg, 0, sizeof(sense_err_msg));
|
|
||||||
|
|
||||||
switch(page_code) {
|
|
||||||
case _SG_T10_SPC_VPD_ATA_INFO:
|
|
||||||
@@ -812,7 +813,7 @@ static int _sg_io_open(char *err_msg, const char *disk_path, int *fd, int oflag)
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
-static int _check_sense_data(char *err_msg, uint8_t *sense_data,
|
|
||||||
+static int _check_sense_data(char *sense_err_msg, uint8_t *sense_data,
|
|
||||||
uint8_t *sense_key)
|
|
||||||
{
|
|
||||||
int rc = -1;
|
|
||||||
@@ -856,8 +857,9 @@ static int _check_sense_data(char *err_msg, uint8_t *sense_data,
|
|
||||||
rc = 0;
|
|
||||||
goto out;
|
|
||||||
default:
|
|
||||||
- _lsm_err_msg_set(err_msg, "Got unknown sense data response code %02x",
|
|
||||||
- sense_hdr->response_code);
|
|
||||||
+ snprintf(sense_err_msg, _LSM_ERR_MSG_LEN / 2,
|
|
||||||
+ "Got unknown sense data response code %02x",
|
|
||||||
+ sense_hdr->response_code);
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
/* TODO(Gris Ge): Handle ADDITIONAL SENSE CODE field and ADDITIONAL SENSE
|
|
||||||
@@ -879,11 +881,12 @@ static int _check_sense_data(char *err_msg, uint8_t *sense_data,
|
|
||||||
/* As sense_key is 4 bytes and we covered all 16 values in
|
|
||||||
* _T10_SPC_SENSE_KEY_STR, there will be no out of index error.
|
|
||||||
*/
|
|
||||||
- _lsm_err_msg_set(err_msg, "Got SCSI sense data, key %s(0x%02x), "
|
|
||||||
- "ADDITIONAL SENSE CODE 0x%02x, ADDITIONAL SENSE CODE "
|
|
||||||
- "QUALIFIER 0x%02x, all sense data in hex: %s",
|
|
||||||
- _T10_SPC_SENSE_KEY_STR[*sense_key], *sense_key,
|
|
||||||
- asc, ascq, sense_data_str);
|
|
||||||
+ snprintf(sense_err_msg, _LSM_ERR_MSG_LEN / 2 ,
|
|
||||||
+ "Got SCSI sense data, key %s(0x%02x), "
|
|
||||||
+ "ADDITIONAL SENSE CODE 0x%02x, ADDITIONAL SENSE CODE "
|
|
||||||
+ "QUALIFIER 0x%02x, all sense data in hex: %s",
|
|
||||||
+ _T10_SPC_SENSE_KEY_STR[*sense_key], *sense_key,
|
|
||||||
+ asc, ascq, sense_data_str);
|
|
||||||
}
|
|
||||||
|
|
||||||
out:
|
|
||||||
@@ -921,13 +924,13 @@ int _sg_io_recv_diag(char *err_msg, int fd, uint8_t page_code, uint8_t *data)
|
|
||||||
char strerr_buff[_LSM_ERR_MSG_LEN];
|
|
||||||
uint8_t sense_data[_T10_SPC_SENSE_DATA_MAX_LENGTH];
|
|
||||||
uint8_t sense_key = _T10_SPC_SENSE_KEY_NO_SENSE;
|
|
||||||
- char sense_err_msg[_LSM_ERR_MSG_LEN];
|
|
||||||
+ char sense_err_msg[_LSM_ERR_MSG_LEN / 2];
|
|
||||||
|
|
||||||
assert(err_msg != NULL);
|
|
||||||
assert(fd >= 0);
|
|
||||||
assert(data != NULL);
|
|
||||||
|
|
||||||
- memset(sense_err_msg, 0, _LSM_ERR_MSG_LEN);
|
|
||||||
+ memset(sense_err_msg, 0, sizeof(sense_err_msg));
|
|
||||||
|
|
||||||
/* SPC-5 rev 07, Table 219 - RECEIVE DIAGNOSTIC RESULTS command */
|
|
||||||
cdb[0] = RECEIVE_DIAGNOSTIC; /* OPERATION CODE */
|
|
||||||
@@ -975,14 +978,14 @@ int _sg_io_send_diag(char *err_msg, int fd, uint8_t *data, uint16_t data_len)
|
|
||||||
char strerr_buff[_LSM_ERR_MSG_LEN];
|
|
||||||
uint8_t sense_data[_T10_SPC_SENSE_DATA_MAX_LENGTH];
|
|
||||||
uint8_t sense_key = _T10_SPC_SENSE_KEY_NO_SENSE;
|
|
||||||
- char sense_err_msg[_LSM_ERR_MSG_LEN];
|
|
||||||
+ char sense_err_msg[_LSM_ERR_MSG_LEN / 2];
|
|
||||||
|
|
||||||
assert(err_msg != NULL);
|
|
||||||
assert(fd >= 0);
|
|
||||||
assert(data != NULL);
|
|
||||||
assert(data_len > 0);
|
|
||||||
|
|
||||||
- memset(sense_err_msg, 0, _LSM_ERR_MSG_LEN);
|
|
||||||
+ memset(sense_err_msg, 0, sizeof(sense_err_msg));
|
|
||||||
|
|
||||||
/* SPC-5 rev 07, Table 219 - RECEIVE DIAGNOSTIC RESULTS command */
|
|
||||||
cdb[0] = SEND_DIAGNOSTIC; /* OPERATION CODE */
|
|
||||||
@@ -1078,7 +1081,7 @@ int _sg_io_mode_sense(char *err_msg, int fd, uint8_t page_code,
|
|
||||||
int ioctl_errno = 0;
|
|
||||||
char strerr_buff[_LSM_ERR_MSG_LEN];
|
|
||||||
uint8_t sense_key = _T10_SPC_SENSE_KEY_NO_SENSE;
|
|
||||||
- char sense_err_msg[_LSM_ERR_MSG_LEN];
|
|
||||||
+ char sense_err_msg[_LSM_ERR_MSG_LEN / 2];
|
|
||||||
struct _sg_t10_mode_para_hdr *mode_hdr = NULL;
|
|
||||||
uint16_t block_dp_len = 0;
|
|
||||||
uint16_t mode_data_len = 0;
|
|
||||||
@@ -1087,7 +1090,7 @@ int _sg_io_mode_sense(char *err_msg, int fd, uint8_t page_code,
|
|
||||||
assert(fd >= 0);
|
|
||||||
assert(data != NULL);
|
|
||||||
|
|
||||||
- memset(sense_err_msg, 0, _LSM_ERR_MSG_LEN);
|
|
||||||
+ memset(sense_err_msg, 0, sizeof(sense_err_msg));
|
|
||||||
memset(data, 0, _SG_T10_SPC_MODE_SENSE_MAX_LEN);
|
|
||||||
|
|
||||||
/* SPC-5 Table 171 - MODE SENSE(10) command */
|
|
||||||
@@ -1257,7 +1260,7 @@ static int _sg_log_sense(char *err_msg, int fd, uint8_t page_code,
|
|
||||||
int ioctl_errno = 0;
|
|
||||||
char strerr_buff[_LSM_ERR_MSG_LEN];
|
|
||||||
uint8_t sense_key = _T10_SPC_SENSE_KEY_NO_SENSE;
|
|
||||||
- char sense_err_msg[_LSM_ERR_MSG_LEN];
|
|
||||||
+ char sense_err_msg[_LSM_ERR_MSG_LEN / 2];
|
|
||||||
struct _sg_t10_log_para_hdr *log_hdr = NULL;
|
|
||||||
uint16_t log_data_len = 0;
|
|
||||||
|
|
||||||
@@ -1265,7 +1268,7 @@ static int _sg_log_sense(char *err_msg, int fd, uint8_t page_code,
|
|
||||||
assert(fd >= 0);
|
|
||||||
assert(data != NULL);
|
|
||||||
|
|
||||||
- memset(sense_err_msg, 0, _LSM_ERR_MSG_LEN);
|
|
||||||
+ memset(sense_err_msg, 0, sizeof(sense_err_msg));
|
|
||||||
memset(cdb, 0, _T10_SPC_LOG_SENSE_CMD_LEN);
|
|
||||||
|
|
||||||
cdb[0] = LOG_SENSE;
|
|
||||||
@@ -1320,14 +1323,14 @@ int _sg_request_sense(char *err_msg, int fd, uint8_t *returned_sense_data)
|
|
||||||
uint8_t sense_data[_T10_SPC_SENSE_DATA_MAX_LENGTH];
|
|
||||||
int ioctl_errno = 0;
|
|
||||||
uint8_t sense_key = _T10_SPC_SENSE_KEY_NO_SENSE;
|
|
||||||
- char sense_err_msg[_LSM_ERR_MSG_LEN];
|
|
||||||
+ char sense_err_msg[_LSM_ERR_MSG_LEN / 2];
|
|
||||||
char strerr_buff[_LSM_ERR_MSG_LEN];
|
|
||||||
|
|
||||||
assert(err_msg != NULL);
|
|
||||||
assert(fd >= 0);
|
|
||||||
assert(returned_sense_data != NULL);
|
|
||||||
|
|
||||||
- memset(sense_err_msg, 0, _LSM_ERR_MSG_LEN);
|
|
||||||
+ memset(sense_err_msg, 0, sizeof(sense_err_msg));
|
|
||||||
memset(cdb, 0, _T10_SPC_REQUEST_SENSE_CMD_LEN);
|
|
||||||
|
|
||||||
cdb[0] = REQUEST_SENSE;
|
|
||||||
diff --git a/c_binding/utils.h b/c_binding/utils.h
|
|
||||||
index 15d0c97..f63b6e3 100644
|
|
||||||
--- a/c_binding/utils.h
|
|
||||||
+++ b/c_binding/utils.h
|
|
||||||
@@ -23,7 +23,7 @@
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdbool.h>
|
|
||||||
|
|
||||||
-#define _LSM_ERR_MSG_LEN 1024
|
|
||||||
+#define _LSM_ERR_MSG_LEN 4096
|
|
||||||
|
|
||||||
#define _good(rc, rc_val, out) \
|
|
||||||
do { \
|
|
||||||
diff --git a/plugin/simc/db.c b/plugin/simc/db.c
|
|
||||||
index 7b3613e..aad9f30 100644
|
|
||||||
--- a/plugin/simc/db.c
|
|
||||||
+++ b/plugin/simc/db.c
|
|
||||||
@@ -768,7 +768,7 @@ void _db_sql_trans_rollback(sqlite3 *db)
|
|
||||||
int _db_data_add(char *err_msg, sqlite3 *db, const char *table_name, ...)
|
|
||||||
{
|
|
||||||
int rc = LSM_ERR_OK;
|
|
||||||
- char sql_cmd[_BUFF_SIZE];
|
|
||||||
+ char sql_cmd[_BUFF_SIZE * 4];
|
|
||||||
char keys_str[_BUFF_SIZE];
|
|
||||||
char values_str[_BUFF_SIZE];
|
|
||||||
const char *key_str = NULL;
|
|
||||||
diff --git a/plugin/simc/nfs_ops.c b/plugin/simc/nfs_ops.c
|
|
||||||
index 4d7235d..b8bcde5 100644
|
|
||||||
--- a/plugin/simc/nfs_ops.c
|
|
||||||
+++ b/plugin/simc/nfs_ops.c
|
|
||||||
@@ -159,7 +159,7 @@ int nfs_export_fs(lsm_plugin_ptr c, const char *fs_id, const char *export_path,
|
|
||||||
uint64_t sim_fs_id = 0;
|
|
||||||
uint64_t sim_exp_id = 0;
|
|
||||||
char tmp_export_path[_BUFF_SIZE];
|
|
||||||
- char vpd83[_BUFF_SIZE];
|
|
||||||
+ char vpd83[_VPD_83_LEN];
|
|
||||||
|
|
||||||
_UNUSED(flags);
|
|
||||||
_lsm_err_msg_clear(err_msg);
|
|
||||||
diff --git a/plugin/simc/san_ops.c b/plugin/simc/san_ops.c
|
|
||||||
index 57161ad..2c9fbde 100644
|
|
||||||
--- a/plugin/simc/san_ops.c
|
|
||||||
+++ b/plugin/simc/san_ops.c
|
|
||||||
@@ -1111,7 +1111,7 @@ int volume_unmask(lsm_plugin_ptr c, lsm_access_group *group, lsm_volume *volume,
|
|
||||||
char err_msg[_LSM_ERR_MSG_LEN];
|
|
||||||
char condition[_BUFF_SIZE];
|
|
||||||
struct _vector *vec = NULL;
|
|
||||||
- char sql_cmd_check_mask[_BUFF_SIZE];
|
|
||||||
+ char sql_cmd_check_mask[_BUFF_SIZE * 4];
|
|
||||||
|
|
||||||
_UNUSED(flags);
|
|
||||||
_lsm_err_msg_clear(err_msg);
|
|
||||||
diff --git a/plugin/simc/utils.h b/plugin/simc/utils.h
|
|
||||||
index 6914e59..90bb54a 100644
|
|
||||||
--- a/plugin/simc/utils.h
|
|
||||||
+++ b/plugin/simc/utils.h
|
|
||||||
@@ -36,7 +36,7 @@ struct _simc_private_data {
|
|
||||||
|
|
||||||
#define _UNUSED(x) (void)(x)
|
|
||||||
#define _MD5_HASH_STR_LEN MD5_DIGEST_LENGTH * 2 + 1
|
|
||||||
-#define _LSM_ERR_MSG_LEN 1024
|
|
||||||
+#define _LSM_ERR_MSG_LEN 4096
|
|
||||||
|
|
||||||
#define _VPD_83_LEN 17
|
|
||||||
/* ^ 6h IEEE Registered ID which it 16 bits hex string. */
|
|
||||||
@@ -63,8 +63,8 @@ struct _simc_private_data {
|
|
||||||
#define _snprintf_buff(err_msg, rc, out, buff, format, ...) \
|
|
||||||
do { \
|
|
||||||
if (buff != NULL) \
|
|
||||||
- snprintf(buff, _BUFF_SIZE, format, ##__VA_ARGS__); \
|
|
||||||
- if (strlen(buff) == _BUFF_SIZE - 1 ) { \
|
|
||||||
+ snprintf(buff, sizeof(buff)/sizeof(char), format, ##__VA_ARGS__); \
|
|
||||||
+ if (strlen(buff) == sizeof(buff)/sizeof(char) - 1 ) { \
|
|
||||||
rc = LSM_ERR_PLUGIN_BUG; \
|
|
||||||
_lsm_err_msg_set(err_msg, "Buff too small"); \
|
|
||||||
goto out; \
|
|
||||||
diff --git a/python_binding/Makefile.am b/python_binding/Makefile.am
|
|
||||||
index 56a4710..cacb6a0 100644
|
|
||||||
--- a/python_binding/Makefile.am
|
|
||||||
+++ b/python_binding/Makefile.am
|
|
||||||
@@ -21,7 +21,8 @@ endif
|
|
||||||
|
|
||||||
pyexec_LTLIBRARIES = lsm/_clib.la
|
|
||||||
pyexecdir = $(pythondir)/lsm
|
|
||||||
-lsm__clib_la_CFLAGS = $(PYTHON_CFLAGS) -I$(top_srcdir)/c_binding/include
|
|
||||||
+lsm__clib_la_CFLAGS = $(PYTHON_CFLAGS) -I$(top_srcdir)/c_binding/include \
|
|
||||||
+ -Wno-cast-function-type
|
|
||||||
lsm__clib_la_SOURCES = lsm/_clib.c
|
|
||||||
lsm__clib_la_LDFLAGS = $(PYTHON_LIBS) \
|
|
||||||
-module -avoid-version -export-symbols-regex \
|
|
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:e6e6ebfb0dbd4a747cd87952c1a9eb1865866eda681cecf8729e523094a057b7
|
|
||||||
size 1044284
|
|
3
libstoragemgmt-1.7.0.tar.gz
Normal file
3
libstoragemgmt-1.7.0.tar.gz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:141cba307a164f7419395a6ea376647d072affba523422730bb30fb153f07a28
|
||||||
|
size 1208266
|
@ -1,3 +1,21 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Oct 25 02:40:17 UTC 2018 - nwang@suse.com
|
||||||
|
|
||||||
|
- Update to new upstream release 1.7.0
|
||||||
|
* Replace yajl with nlohmann/json for JSON handling.
|
||||||
|
* Fix the file path of lsmd.conf manpage.
|
||||||
|
* HPSA plugin: Support ssacli version 3.25+.
|
||||||
|
* scan-scsi-target: Fix compiling on gcc 8.2.
|
||||||
|
* Fix lsmcli on python 3.7.
|
||||||
|
* Handle 'Warning:' message in hpsa plugin
|
||||||
|
* SmartArray plugin: Remove the pyudev codes.
|
||||||
|
* lsmd: Fix crash when plugin named as _lsmplugin.
|
||||||
|
* Fix GCC 8 compiling warnings.
|
||||||
|
* MegaRAID plugin: Fix cache information query.
|
||||||
|
* Fix regression on SMI-S plugin.
|
||||||
|
- Remove patch compat-gcc8.patch: in upstream
|
||||||
|
- Polish the spec file by spec-cleaner
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu May 3 13:12:28 UTC 2018 - dimstar@opensuse.org
|
Thu May 3 13:12:28 UTC 2018 - dimstar@opensuse.org
|
||||||
|
|
||||||
|
@ -18,41 +18,25 @@
|
|||||||
|
|
||||||
%define libname %{name}1
|
%define libname %{name}1
|
||||||
%bcond_with test
|
%bcond_with test
|
||||||
|
|
||||||
%if 0%{?suse_version} >= 1500 || %{with python3}
|
%if 0%{?suse_version} >= 1500 || %{with python3}
|
||||||
%define python3 1
|
%define python3 1
|
||||||
%define python_sitelib %{python3_sitelib}
|
%define python_sitelib %{python3_sitelib}
|
||||||
%else
|
%else
|
||||||
%define python3 0
|
%define python3 0
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
Name: libstoragemgmt
|
Name: libstoragemgmt
|
||||||
Version: 1.6.0
|
Version: 1.7.0
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: Storage array management library
|
Summary: Storage array management library
|
||||||
License: LGPL-2.1+ and GPL-2.0+
|
License: LGPL-2.1+ and GPL-2.0+
|
||||||
Group: System/Libraries
|
Group: System/Libraries
|
||||||
Url: https://github.com/libstorage/libstoragemgmt
|
Url: https://github.com/libstorage/libstoragemgmt
|
||||||
Source0: https://github.com/libstorage/libstoragemgmt/releases/download/%{version}/%{name}-%{version}.tar.gz
|
Source0: https://github.com/libstorage/libstoragemgmt/releases/download/%{version}/%{name}-%{version}.tar.gz
|
||||||
Patch0: compat-gcc8.patch
|
|
||||||
BuildRequires: libtool
|
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: gcc-c++
|
BuildRequires: gcc-c++
|
||||||
BuildRequires: libconfig-devel
|
BuildRequires: libconfig-devel
|
||||||
|
BuildRequires: libtool
|
||||||
BuildRequires: pkgconfig
|
BuildRequires: pkgconfig
|
||||||
%if 0%{python3}
|
|
||||||
BuildRequires: python3-devel
|
|
||||||
BuildRequires: python3-pyudev
|
|
||||||
BuildRequires: python3-pywbem
|
|
||||||
BuildRequires: python3-six
|
|
||||||
Requires: python3-six
|
|
||||||
%else
|
|
||||||
BuildRequires: python-devel
|
|
||||||
BuildRequires: python-pyudev
|
|
||||||
BuildRequires: python-pywbem
|
|
||||||
BuildRequires: python-six
|
|
||||||
Requires: python-six
|
|
||||||
%endif
|
|
||||||
BuildRequires: pkgconfig(glib-2.0)
|
BuildRequires: pkgconfig(glib-2.0)
|
||||||
BuildRequires: pkgconfig(libudev)
|
BuildRequires: pkgconfig(libudev)
|
||||||
BuildRequires: pkgconfig(libxml-2.0)
|
BuildRequires: pkgconfig(libxml-2.0)
|
||||||
@ -60,14 +44,23 @@ BuildRequires: pkgconfig(openssl)
|
|||||||
BuildRequires: pkgconfig(sqlite3)
|
BuildRequires: pkgconfig(sqlite3)
|
||||||
BuildRequires: pkgconfig(systemd)
|
BuildRequires: pkgconfig(systemd)
|
||||||
BuildRequires: pkgconfig(udev)
|
BuildRequires: pkgconfig(udev)
|
||||||
|
%systemd_requires
|
||||||
|
%if 0%{python3}
|
||||||
|
BuildRequires: python3-devel
|
||||||
|
BuildRequires: python3-pywbem
|
||||||
|
BuildRequires: python3-six
|
||||||
|
Requires: python3-six
|
||||||
|
%else
|
||||||
|
BuildRequires: python-devel
|
||||||
|
BuildRequires: python-pywbem
|
||||||
|
BuildRequires: python-six
|
||||||
|
Requires: python-six
|
||||||
|
%endif
|
||||||
%if 0%{python3}
|
%if 0%{python3}
|
||||||
Requires: python3-%{name}
|
Requires: python3-%{name}
|
||||||
Requires: python3-%{name}-clibs
|
|
||||||
%else
|
%else
|
||||||
Requires: python2-%{name}
|
Requires: python2-%{name}
|
||||||
Requires: python2-%{name}-clibs
|
|
||||||
%endif
|
%endif
|
||||||
%systemd_requires
|
|
||||||
%if %{with test}
|
%if %{with test}
|
||||||
BuildRequires: chrpath
|
BuildRequires: chrpath
|
||||||
BuildRequires: libtool
|
BuildRequires: libtool
|
||||||
@ -76,12 +69,6 @@ BuildRequires: procps
|
|||||||
BuildRequires: valgrind
|
BuildRequires: valgrind
|
||||||
BuildRequires: pkgconfig(check)
|
BuildRequires: pkgconfig(check)
|
||||||
%endif
|
%endif
|
||||||
%if 0%{?suse_version} <= 1320
|
|
||||||
# For SLE12 and openSUSE 13.2
|
|
||||||
BuildRequires: libyajl-devel
|
|
||||||
%else
|
|
||||||
BuildRequires: pkgconfig(yajl)
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
The libStorageMgmt library will provide a vendor agnostic open source storage
|
The libStorageMgmt library will provide a vendor agnostic open source storage
|
||||||
@ -115,16 +102,12 @@ developing applications that use %{name}.
|
|||||||
%else
|
%else
|
||||||
%package -n python2-%{name}
|
%package -n python2-%{name}
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
%{?python_provide:%python_provide python3-%{name}}
|
||||||
Summary: Python client libraries and plug-in support for %{name}
|
Summary: Python client libraries and plug-in support for %{name}
|
||||||
Group: System/Libraries
|
Group: System/Libraries
|
||||||
Requires: %{name} = %{version}
|
Requires: %{name} = %{version}
|
||||||
%if 0%{python3}
|
|
||||||
Requires: python3-%{name}-clibs
|
|
||||||
%else
|
|
||||||
Requires: python2-%{name}-clibs
|
|
||||||
%endif
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
%if 0%{python3}
|
%if 0%{python3}
|
||||||
%description -n python3-%{name}
|
%description -n python3-%{name}
|
||||||
%else
|
%else
|
||||||
@ -138,10 +121,11 @@ well as python framework support and open source plug-ins written in python.
|
|||||||
%else
|
%else
|
||||||
%package -n python2-%{name}-clibs
|
%package -n python2-%{name}-clibs
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
%{?python_provide:%python_provide python3-%{name}-clibs}
|
||||||
Summary: Python C extension for %{name}
|
Summary: Python C extension for %{name}
|
||||||
Group: System/Libraries
|
Group: System/Libraries
|
||||||
Requires: %{name} = %{version}
|
Requires: %{name} = %{version}-%{release}
|
||||||
|
|
||||||
%if 0%{python3}
|
%if 0%{python3}
|
||||||
%description -n python3-%{name}-clibs
|
%description -n python3-%{name}-clibs
|
||||||
%else
|
%else
|
||||||
@ -152,14 +136,15 @@ The python-%{name}-clibs package contains python C extentions for %{name}.
|
|||||||
%package smis-plugin
|
%package smis-plugin
|
||||||
Summary: Files for SMI-S generic array support for %{name}
|
Summary: Files for SMI-S generic array support for %{name}
|
||||||
Group: System/Libraries
|
Group: System/Libraries
|
||||||
|
Requires: python3-%{name} = %{version}
|
||||||
|
Requires(post): python3-%{name} = %{version}
|
||||||
|
Requires(postun): python3-%{name} = %{version}
|
||||||
|
BuildArch: noarch
|
||||||
%if 0%{python3}
|
%if 0%{python3}
|
||||||
Requires: python3-pywbem
|
Requires: python3-pywbem
|
||||||
%else
|
%else
|
||||||
Requires: python-pywbem
|
Requires: python-pywbem
|
||||||
%endif
|
%endif
|
||||||
Requires(post): %{name} = %{version}
|
|
||||||
Requires(postun): %{name} = %{version}
|
|
||||||
BuildArch: noarch
|
|
||||||
|
|
||||||
%description smis-plugin
|
%description smis-plugin
|
||||||
The %{name}-smis-plugin package contains plug-in for generic SMI-S
|
The %{name}-smis-plugin package contains plug-in for generic SMI-S
|
||||||
@ -168,8 +153,9 @@ array support.
|
|||||||
%package netapp-plugin
|
%package netapp-plugin
|
||||||
Summary: Files for NetApp array support for %{name}
|
Summary: Files for NetApp array support for %{name}
|
||||||
Group: System/Libraries
|
Group: System/Libraries
|
||||||
Requires(post): %{name} = %{version}
|
Requires: python3-%{name} = %{version}
|
||||||
Requires(postun): %{name} = %{version}
|
Requires(post): python3-%{name} = %{version}
|
||||||
|
Requires(postun): python3-%{name} = %{version}
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
%description netapp-plugin
|
%description netapp-plugin
|
||||||
@ -179,8 +165,9 @@ support.
|
|||||||
%package targetd-plugin
|
%package targetd-plugin
|
||||||
Summary: Files for targetd array support for %{name}
|
Summary: Files for targetd array support for %{name}
|
||||||
Group: System/Libraries
|
Group: System/Libraries
|
||||||
Requires(post): %{name} = %{version}
|
Requires: python3-%{name} = %{version}
|
||||||
Requires(postun): %{name} = %{version}
|
Requires(post): python3-%{name} = %{version}
|
||||||
|
Requires(postun): python3-%{name} = %{version}
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
%description targetd-plugin
|
%description targetd-plugin
|
||||||
@ -190,8 +177,9 @@ array support.
|
|||||||
%package nstor-plugin
|
%package nstor-plugin
|
||||||
Summary: Files for NexentaStor array support for %{name}
|
Summary: Files for NexentaStor array support for %{name}
|
||||||
Group: System/Libraries
|
Group: System/Libraries
|
||||||
Requires(post): %{name} = %{version}
|
Requires: python3-%{name} = %{version}
|
||||||
Requires(postun): %{name} = %{version}
|
Requires(post): python3-%{name} = %{version}
|
||||||
|
Requires(postun): python3-%{name} = %{version}
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
%description nstor-plugin
|
%description nstor-plugin
|
||||||
@ -209,8 +197,9 @@ uevents generated by the kernel.
|
|||||||
%package megaraid-plugin
|
%package megaraid-plugin
|
||||||
Summary: Files for LSI MegaRAID support for %{name}
|
Summary: Files for LSI MegaRAID support for %{name}
|
||||||
Group: System/Libraries
|
Group: System/Libraries
|
||||||
Requires(post): %{name} = %{version}
|
Requires: python3-%{name} = %{version}
|
||||||
Requires(postun): %{name} = %{version}
|
Requires(post): python3-%{name} = %{version}
|
||||||
|
Requires(postun): python3-%{name} = %{version}
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
%description megaraid-plugin
|
%description megaraid-plugin
|
||||||
@ -220,8 +209,9 @@ storage management via storcli.
|
|||||||
%package hpsa-plugin
|
%package hpsa-plugin
|
||||||
Summary: Files for HP SmartArray support for %{name}
|
Summary: Files for HP SmartArray support for %{name}
|
||||||
Group: System/Libraries
|
Group: System/Libraries
|
||||||
Requires(post): %{name} = %{version}
|
Requires: python3-%{name} = %{version}
|
||||||
Requires(postun): %{name} = %{version}
|
Requires(post): python3-%{name} = %{version}
|
||||||
|
Requires(postun): python3-%{name} = %{version}
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
%description hpsa-plugin
|
%description hpsa-plugin
|
||||||
@ -231,18 +221,30 @@ management via hpssacli.
|
|||||||
%package nfs-plugin
|
%package nfs-plugin
|
||||||
Summary: Files for nfs support for %{name}
|
Summary: Files for nfs support for %{name}
|
||||||
Group: System/Libraries
|
Group: System/Libraries
|
||||||
Requires(post): %{name} = %{version}
|
Requires: %{name}-nfs-plugin-clibs = %{version}
|
||||||
Requires(postun): %{name} = %{version}
|
Requires: python3-%{name} = %{version}
|
||||||
|
Requires(post): python3-%{name} = %{version}
|
||||||
|
Requires(postun): python3-%{name} = %{version}
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
%description nfs-plugin
|
%description nfs-plugin
|
||||||
The %{name}-nfs-plugin package contains the plugin for nfs based storage.
|
The %{name}-nfs-plugin package contains the plugin for nfs based storage.
|
||||||
|
|
||||||
|
%package nfs-plugin-clibs
|
||||||
|
Summary: Python C extension module for %{name} NFS plugin
|
||||||
|
Group: System/Libraries
|
||||||
|
Requires: %{name} = %{version}
|
||||||
|
|
||||||
|
%description nfs-plugin-clibs
|
||||||
|
The %{name}-nfs-plugin-clibs package contains python C extension for %{name}
|
||||||
|
NFS plugin.
|
||||||
|
|
||||||
%package local-plugin
|
%package local-plugin
|
||||||
Summary: Files for HP local pseudo support for %{name}
|
Summary: Files for HP local pseudo support for %{name}
|
||||||
Group: System/Libraries
|
Group: System/Libraries
|
||||||
Requires(post): %{name} = %{version}
|
Requires: python3-%{name} = %{version}
|
||||||
Requires(postun): %{name} = %{version}
|
Requires(post): python3-%{name} = %{version}
|
||||||
|
Requires(postun): python3-%{name} = %{version}
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
%description local-plugin
|
%description local-plugin
|
||||||
@ -252,8 +254,9 @@ storage.
|
|||||||
%package arcconf-plugin
|
%package arcconf-plugin
|
||||||
Summary: Files for Microsemi storage support for %{name}
|
Summary: Files for Microsemi storage support for %{name}
|
||||||
Group: System/Libraries
|
Group: System/Libraries
|
||||||
Requires(post): %{name} = %{version}
|
Requires: python3-%{name} = %{version}
|
||||||
Requires(postun): %{name} = %{version}
|
Requires(post): python3-%{name} = %{version}
|
||||||
|
Requires(postun): python3-%{name} = %{version}
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
%description arcconf-plugin
|
%description arcconf-plugin
|
||||||
@ -262,19 +265,51 @@ storage.
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q
|
%setup -q
|
||||||
%patch0 -p1
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
# Needed for patch0
|
# Needed for patch0
|
||||||
autoreconf -fiv
|
autoreconf -fiv
|
||||||
%configure \
|
%configure \
|
||||||
--disable-static \
|
--disable-static \
|
||||||
|
--with-bash-completion-dir=%{_datadir}/bash-completion/completions/ \
|
||||||
%if 0%{python3}
|
%if 0%{python3}
|
||||||
--with-python3 \
|
--with-python3 \
|
||||||
%endif
|
%endif
|
||||||
%if ! %{with test}
|
%if ! %{with test}
|
||||||
--without-test
|
--without-test
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
#Fix rpmlint Error: env-script-interpreter
|
||||||
|
#Should change it after configure
|
||||||
|
pyfiles=(plugin/megaraid/megaraid_lsmplugin \
|
||||||
|
plugin/hpsa/hpsa_lsmplugin \
|
||||||
|
plugin/targetd/targetd_lsmplugin \
|
||||||
|
plugin/sim/sim_lsmplugin \
|
||||||
|
plugin/local/local_lsmplugin \
|
||||||
|
plugin/nstor/nstor_lsmplugin \
|
||||||
|
plugin/arcconf/arcconf_lsmplugin \
|
||||||
|
plugin/smispy/smispy_lsmplugin \
|
||||||
|
plugin/ontap/ontap_lsmplugin \
|
||||||
|
plugin/nfs/nfs_lsmplugin \
|
||||||
|
tools/lsmcli/lsmcli \
|
||||||
|
test/cmdtest.py \
|
||||||
|
test/plugin_test.py \
|
||||||
|
tools/sanity_check/local_sanity_check.py \
|
||||||
|
)
|
||||||
|
|
||||||
|
head -vn 1 ${pyfiles[@]}
|
||||||
|
sed -i '/^#!\/usr\/bin/s|env python|python|' ${pyfiles[@]}
|
||||||
|
head -vn 1 ${pyfiles[@]}
|
||||||
|
|
||||||
|
#Fix rpmlint Warning: non-executable-script
|
||||||
|
pyfiles=(tools/use_cases/find_unused_lun.py \
|
||||||
|
tools/sanity_check/local_sanity_check.py \
|
||||||
|
)
|
||||||
|
|
||||||
|
head -vn 1 ${pyfiles[@]}
|
||||||
|
sed -i '/^#!/d' ${pyfiles[@]}
|
||||||
|
head -vn 1 ${pyfiles[@]}
|
||||||
|
|
||||||
make %{?_smp_mflags} V=1
|
make %{?_smp_mflags} V=1
|
||||||
|
|
||||||
%install
|
%install
|
||||||
@ -287,11 +322,6 @@ install -Dpm 0644 packaging/daemon/libstoragemgmt.service \
|
|||||||
%{buildroot}/%{_unitdir}/libstoragemgmt.service
|
%{buildroot}/%{_unitdir}/libstoragemgmt.service
|
||||||
ln -sv %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}
|
ln -sv %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}
|
||||||
|
|
||||||
#tempfiles.d configuration for /var/run
|
|
||||||
mkdir -p %{buildroot}/%{_tmpfilesdir}
|
|
||||||
install -m 0644 packaging/daemon/lsm-tmpfiles.conf \
|
|
||||||
%{buildroot}/%{_tmpfilesdir}/%{name}.conf
|
|
||||||
|
|
||||||
#Files for udev handling
|
#Files for udev handling
|
||||||
install -d %{buildroot}/%{_udevrulesdir}
|
install -d %{buildroot}/%{_udevrulesdir}
|
||||||
install -m 644 tools/udev/90-scsi-ua.rules \
|
install -m 644 tools/udev/90-scsi-ua.rules \
|
||||||
@ -464,7 +494,7 @@ fi
|
|||||||
%{_unitdir}/libstoragemgmt.service
|
%{_unitdir}/libstoragemgmt.service
|
||||||
%{_tmpfilesdir}/%{name}.conf
|
%{_tmpfilesdir}/%{name}.conf
|
||||||
%dir %{_sysconfdir}/lsm
|
%dir %{_sysconfdir}/lsm
|
||||||
%config %{_sysconfdir}/bash_completion.d/lsmcli
|
%{_datadir}/bash-completion/completions/lsmcli
|
||||||
%config(noreplace) %{_sysconfdir}/lsm/lsmd.conf
|
%config(noreplace) %{_sysconfdir}/lsm/lsmd.conf
|
||||||
%dir %{_sysconfdir}/lsm/pluginconf.d
|
%dir %{_sysconfdir}/lsm/pluginconf.d
|
||||||
%{_sbindir}/rclibstoragemgmt
|
%{_sbindir}/rclibstoragemgmt
|
||||||
@ -494,6 +524,7 @@ fi
|
|||||||
%{python_sitelib}/lsm/external
|
%{python_sitelib}/lsm/external
|
||||||
%{python_sitelib}/lsm/_*.py*
|
%{python_sitelib}/lsm/_*.py*
|
||||||
%{python_sitelib}/lsm/version.*
|
%{python_sitelib}/lsm/version.*
|
||||||
|
|
||||||
%if 0%{python3}
|
%if 0%{python3}
|
||||||
%dir %{python_sitelib}/lsm/__pycache__
|
%dir %{python_sitelib}/lsm/__pycache__
|
||||||
%{python_sitelib}/lsm/__pycache__/*
|
%{python_sitelib}/lsm/__pycache__/*
|
||||||
@ -504,12 +535,18 @@ fi
|
|||||||
%dir %{python_sitelib}/lsm/lsmcli/__pycache__
|
%dir %{python_sitelib}/lsm/lsmcli/__pycache__
|
||||||
%{python_sitelib}/lsm/lsmcli/__pycache__/*
|
%{python_sitelib}/lsm/lsmcli/__pycache__/*
|
||||||
%endif
|
%endif
|
||||||
|
%{python_sitelib}/lsm/lsmcli/__init__.*
|
||||||
|
%{python_sitelib}/lsm/lsmcli/data_display.*
|
||||||
|
%{python_sitelib}/lsm/lsmcli/cmdline.*
|
||||||
%dir %{python_sitelib}/lsm/plugin
|
%dir %{python_sitelib}/lsm/plugin
|
||||||
%{python_sitelib}/lsm/plugin/__init__.*
|
%{python_sitelib}/lsm/plugin/__init__.*
|
||||||
%dir %{python_sitelib}/lsm/plugin/sim
|
%dir %{python_sitelib}/lsm/plugin/sim
|
||||||
%{python_sitelib}/lsm/plugin/sim/*.py*
|
%{python_sitelib}/lsm/plugin/sim/*.py*
|
||||||
%{python_sitelib}/lsm/lsmcli
|
%dir %{python_sitelib}/lsm/lsmcli
|
||||||
%{_bindir}/sim_lsmplugin
|
%{_bindir}/sim_lsmplugin
|
||||||
|
%dir %{_libexecdir}/lsm.d
|
||||||
|
%{_libexecdir}/lsm.d/find_unused_lun.py*
|
||||||
|
%{_libexecdir}/lsm.d/local_sanity_check.py*
|
||||||
%config(noreplace) %{_sysconfdir}/lsm/pluginconf.d/sim.conf
|
%config(noreplace) %{_sysconfdir}/lsm/pluginconf.d/sim.conf
|
||||||
%{_mandir}/man1/sim_lsmplugin.1%{ext_man}
|
%{_mandir}/man1/sim_lsmplugin.1%{ext_man}
|
||||||
|
|
||||||
@ -586,6 +623,9 @@ fi
|
|||||||
%config(noreplace) %{_sysconfdir}/lsm/pluginconf.d/nfs.conf
|
%config(noreplace) %{_sysconfdir}/lsm/pluginconf.d/nfs.conf
|
||||||
%{_mandir}/man1/nfs_lsmplugin.1%{ext_man}
|
%{_mandir}/man1/nfs_lsmplugin.1%{ext_man}
|
||||||
|
|
||||||
|
%files nfs-plugin-clibs
|
||||||
|
%{python_sitelib}/lsm/plugin/nfs/nfs_clib.*
|
||||||
|
|
||||||
%files local-plugin
|
%files local-plugin
|
||||||
%dir %{python_sitelib}/lsm/plugin/local
|
%dir %{python_sitelib}/lsm/plugin/local
|
||||||
%if 0%{python3}
|
%if 0%{python3}
|
||||||
@ -614,6 +654,5 @@ fi
|
|||||||
%files -n python2-%{name}-clibs
|
%files -n python2-%{name}-clibs
|
||||||
%endif
|
%endif
|
||||||
%{python_sitelib}/lsm/_clib.*
|
%{python_sitelib}/lsm/_clib.*
|
||||||
%{python_sitelib}/lsm/plugin/nfs/nfs_clib.*
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
Loading…
Reference in New Issue
Block a user