%global major   2
%global minor   54
%global update  1

Name:            cim-schema
Version:         %{major}.%{minor}.%{update}
Release:         1
Summary:         Common Information Model Schema
License:         DMTF
URL:             http://www.dmtf.org/
Source0:         http://www.dmtf.org/standards/cim/cim_schema_v%{major}%{minor}%{update}/cim_schema_%{version}Experimental-MOFs.zip
Source1:         http://www.dmtf.org/standards/cim/cim_schema_v%{major}%{minor}%{update}/cim_schema_%{version}Experimental-Doc.zip
Source2:         LICENSE
BuildArch:       noarch

%description
The CIM Schema provides the actual model descriptions. Management schemas are the
building-blocks for management platforms and management applications, such as device
configuration, performance management, and change management. CIM structures the managed
environment as a collection of interrelated systems, each composed of discrete elements.
Supplying a set of classes with properties and associations that provide a well-understood
conceptual framework, CIM organizes information about the managed environment. The CIM Schema
is structured into these distinct layers: core model, common model, extension schemas.

%package_help

%prep
%setup -q -T -a 1 -c -n %{name}-docs
%setup -q -T -a 0 -c -n %{name}-%{version}

%build

%install
for i in `find . -name "*.mof"`; do
  sed -i -e 's/\r//g' $i
done

install -d %{buildroot}/%{_datadir}/mof/cimv%{version}
chmod -R go-wx .
chmod -R a+rX .
mv * %{buildroot}/%{_datadir}/mof/cimv%{version}/

ln -s cimv%{version} %{buildroot}/%{_datadir}/mof/cim-current
ln -s cim_schema_%{version}.mof %{buildroot}/%{_datadir}/mof/cim-current/CIM_Schema.mof

install -d %{buildroot}/usr/bin
mkdir -p %{buildroot}/%{_docdir}/%{name}
cp -a %{SOURCE2} %{buildroot}/%{_docdir}/%{name}

%files
%defattr(-,root,root)
%license %{_docdir}/%{name}/LICENSE
%dir %{_datarootdir}/mof
%dir %{_datarootdir}/mof/cimv%{version}
%{_datarootdir}/mof/cimv%{version}/*
%{_datarootdir}/mof/cim-current

%files help
%doc ../%{name}-docs/*

%changelog
* Thu Sep 28 2023 liweigang <weigangli99@yeah.net> - 2.54.1-1
- update to CIM Schema 2.54.1, including experimental classes

* Mon Sep 14 2020 Ge Wang <wangge20@huawei.com> - 2.43.0-9
- Transmit version macro to solve auto find source problem

* Mon Nov 25 2019 openEuler Buildteam <buildteam@openeuler.org> - 2.43.0-8
- Package init
