diff --git a/README.en.md b/README.en.md index d661e18..5b85e7a 100644 --- a/README.en.md +++ b/README.en.md @@ -1,22 +1,7 @@ # ovirt-setup-lib #### Description -{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**} - -#### Software Architecture -Software architecture description - -#### Installation - -1. xxxx -2. xxxx -3. xxxx - -#### Instructions - -1. xxxx -2. xxxx -3. xxxx +Common code used by setup tools within oVirt project. #### Contribution @@ -24,13 +9,3 @@ Software architecture description 2. Create Feat_xxx branch 3. Commit your code 4. Create Pull Request - - -#### Gitee Feature - -1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md -2. Gitee blog [blog.gitee.com](https://blog.gitee.com) -3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) -4. The most valuable open source project [GVP](https://gitee.com/gvp) -5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) -6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/README.md b/README.md index 081c9f4..b5ddad1 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,7 @@ # ovirt-setup-lib #### 介绍 -{**以下是码云平台说明,您可以替换此简介** -码云是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台 -无论是个人、团队、或是企业,都能够用码云实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)} - -#### 软件架构 -软件架构说明 - - -#### 安装教程 - -1. xxxx -2. xxxx -3. xxxx - -#### 使用说明 - -1. xxxx -2. xxxx -3. xxxx +oVirt项目中setup工具使用的公共库。 #### 参与贡献 @@ -27,13 +9,3 @@ 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request - - -#### 码云特技 - -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. 码云官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解码云上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目 -5. 码云官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. 码云封面人物是一档用来展示码云会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/ovirt-setup-lib-1.2.0.tar.gz b/ovirt-setup-lib-1.2.0.tar.gz new file mode 100644 index 0000000..a8e89af Binary files /dev/null and b/ovirt-setup-lib-1.2.0.tar.gz differ diff --git a/ovirt-setup-lib.spec b/ovirt-setup-lib.spec new file mode 100644 index 0000000..46a77b8 --- /dev/null +++ b/ovirt-setup-lib.spec @@ -0,0 +1,148 @@ +# Copyright (C) 2018-2019 Red Hat, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}} + +%global package_version 1.2.0 +%global srcname ovirt-setup-lib + +%if 0%{?fedora} || 0%{?rhel} >= 8 +%global with_python3 1 +%else +%global with_python3 0 +%endif + +%if 0%{?rhel} >= 8 +%global with_python2 0 +%else +%global with_python2 1 +%endif + +Summary: oVirt setup common library +Name: %{srcname} +Version: 1.2.0 +Release: 1%{?release_suffix}%{?dist} +Source0: http://resources.ovirt.org/pub/ovirt-master-snapshot/src/%{srcname}/%{srcname}-%{package_version}.tar.gz +License: ASL 2.0 +Group: Development/Libraries +BuildArch: noarch +Url: http://www.ovirt.org + +BuildRequires: gettext +%if 0%{?with_python2} +BuildRequires: python2-devel +Requires: python2-%{srcname} +%endif + +%if 0%{?with_python3} +BuildRequires: python3-devel +%if 0%{!?with_python2} +Requires: python3-%{srcname} +%endif +%endif + +%description +oVirt setup common library + +%if 0%{?with_python2} +%package -n python2-%{srcname} +Summary: oVirt setup common library +%{?python_provide:%python_provide python2-%{srcname}} +Provides: ovirt-setup-lib = %{version} +Obsoletes: ovirt-setup-lib < %{version} +Requires: python-setuptools +Requires: python-netaddr +Requires: python-six + +%description -n python2-%{srcname} +oVirt setup common library +%endif + +%if 0%{?with_python3} +%package -n python3-%{srcname} +Summary: oVirt setup common library +%{?python_provide:%python_provide python3-%{srcname}} +Requires: python3-setuptools +Requires: python3-netaddr +Requires: python3-six + +%description -n python3-%{srcname} +oVirt setup common library +%endif + +%prep +%setup -q -n %{srcname}-%{package_version} +%if 0%{?with_python3} + rm -rf %{py3dir} + cp -a . %{py3dir} + find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' +%endif # with_python3 +%if 0%{?with_python2} +find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|' +%endif # with_python2 + +%build +%if 0%{?with_python2} +%configure \ + PYTHON="%{__python2}" \ + --docdir="%{_pkgdocdir}" \ + --disable-python-syntax-check \ + %{?conf} +make %{?_smp_mflags} +%endif # with_python2 + +%if 0%{?with_python3} +pushd %{py3dir} +%configure \ + PYTHON="%{__python3}" \ + --docdir="%{_pkgdocdir}" \ + --disable-python-syntax-check \ + %{?conf} +make %{?_smp_mflags} +popd +%endif # with_python3 + +%install +%if 0%{?with_python2} +make %{?_smp_mflags} install DESTDIR="%{buildroot}" +%endif # with_python2 + +%if 0%{?with_python3} +pushd %{py3dir} +make %{?_smp_mflags} install DESTDIR="%{buildroot}" +popd +%endif # with_python3 +rm -f %{buildroot}%{_pkgdocdir}/README.md + +%clean +rm -rf %{buildroot} + +%if 0%{?with_python2} +%files -n python2-%{srcname} +%{python2_sitelib}/ovirt_setup_lib/ +%doc README.md +%license COPYING +%endif + +%if 0%{?with_python3} +%files -n python3-%{srcname} +%{python3_sitelib}/ovirt_setup_lib/ +%doc README.md +%license COPYING +%endif + +%changelog +* Thu Mar 5 2020 di.wang - 1.2.0-1 +- Package Initialization