diff --git a/otopi-1.9.4.tar.gz b/otopi-1.9.4.tar.gz new file mode 100644 index 0000000..a26dbed Binary files /dev/null and b/otopi-1.9.4.tar.gz differ diff --git a/otopi.spec b/otopi.spec new file mode 100644 index 0000000..b7b7545 --- /dev/null +++ b/otopi.spec @@ -0,0 +1,238 @@ +# +# otopi -- plugable installer +# + +%global package_version 1.9.4 +%global package_maven_version 1.9.4 + +%global _use_maven 1 +%global _use_repolib 0 +%global maven2brewrepodir %{_javadir}/repository.jboss.com/maven2-brew/dummy +%global _configure ../configure + +%global src_java_dir src/java + +Summary: oVirt Task Oriented Pluggable Installer/Implementation (%{name}) +Name: otopi +Version: 1.9.4 +Release: 1 +License: LGPLv2+ +URL: http://www.ovirt.org +Source0: http://resources.ovirt.org/pub/src/%{name}/%{name}-%{package_version}.tar.gz +Group: Development/Libraries + +BuildArch: noarch + +BuildRequires: apache-commons-logging +BuildRequires: java-devel +BuildRequires: junit +BuildRequires: gettext >= 0.18.2 +BuildRequires: javapackages-tools + +BuildRequires: python%{python3_pkgversion}-devel + + +%if %{_use_maven} +BuildRequires: maven-compiler-plugin +BuildRequires: maven-enforcer-plugin +BuildRequires: maven-install-plugin +BuildRequires: maven-jar-plugin +BuildRequires: maven-source-plugin +BuildRequires: maven-surefire-provider-junit +BuildRequires: maven-local +%endif + +%description +Standalone plugin based installation framework to be used to setup +system components. The plugin nature provides simplicity to +add new installation functionality without the complexity of the state +and transaction management. + + +%package -n python%{python3_pkgversion}-%{name} +Summary: %{summary} +%{?python_provide:%python_provide python%{python3_pkgversion}-%{name}} +Requires: python%{python3_pkgversion} >= 3.6.0 +Requires: python%{python3_pkgversion}-dateutil +Requires: %{name}-common = %{version}-%{release} + +# If we build for python3, but not for python2, let the python3 version +# provide 'otopi'. + +%description -n python%{python3_pkgversion}-%{name} +%{summary}. + +Python %{python3_pkgversion} version. + +%package -n python%{python3_pkgversion}-otopi-devtools +Summary: %{name} development tools +Requires: python%{python3_pkgversion}-%{name} = %{version}-%{release} + +%description -n python%{python3_pkgversion}-otopi-devtools +Development tools for %{name}. + +Python %{python3_pkgversion} version. + + +%package common +Summary: Commong files for %{name} + +%description common +%{summary} + +%package java +Summary: %{name} java support +Requires: %{name} = %{version}-%{release} +Requires: java-headless +Requires: apache-commons-logging + +%description java +java libraries. + +%if %{_use_maven} +%package javadoc +Summary: Javadocs for %{name} +Group: Documentation + +%description javadoc +This package contains the API documentation for %{name}. +%endif + +%package debug-plugins +Summary: %{name} debug plugins +Requires: %{name} = %{version}-%{release} + +%description debug-plugins +Debug plugins for %{name}. + +%if 0%{?_use_repolib:1} +%package repolib +Summary: %{name} maven repo +%description repolib +%{name} maven repo +%endif + +%prep +%setup -q -n %{name}-%{package_version} +%pom_remove_plugin :maven-javadoc-plugin src/java/pom.xml.in +%pom_remove_plugin :nexus-staging-maven-plugin src/java/pom.xml.in +mkdir py3 + +%build +%if %{_use_maven} +%global conf --disable-java-sdk-compile +%else +%global conf COMMONS_LOGGING_JAR=$(build-classpath commons-logging) JUNIT_JAR=$((build-classpath junit4 || build-classpath junit) | sed '/^$/d') +%endif + + +pushd py3 +# Build python but don't touch java +%configure PYTHON="%{__python3}" \ + --docdir="%{_docdir}/%{name}-%{version}" \ + --disable-python-syntax-check \ + --disable-java-sdk-compile \ + --with-local-version="%{name}-%{version}-%{release}" \ + %{?conf} +make %{?_smp_mflags} +popd + + + +# This takes care of codegen for java and building java +# We don't really care about which version of python is used to generate +# java code since the generated code is not depending on interpreter version. +./configure \ + --docdir="%{_docdir}/%{name}-%{version}" \ + --disable-python-syntax-check \ + --enable-java-sdk \ + --with-local-version="%{name}-%{version}-%{release}" \ + %{?conf} +make %{?_smp_mflags} + + +%if %{_use_maven} +pushd %{src_java_dir} +%mvn_build +popd +%endif + + +%install + +make -C py3 %{?_smp_mflags} install DESTDIR="%{buildroot}" + + +# Point to otopi2 binaries by default + +%if %{_use_maven} +pushd %{src_java_dir} +%mvn_install +popd +%else +install -d "%{buildroot}%{_javadir}/%{name}" +install -m 644 target/%{name}-%{package_maven_version}.jar "%{buildroot}%{_javadir}/%{name}" +ln -s %{name}-%{package_maven_version}.jar "%{buildroot}%{_javadir}/%{name}/%{name}.jar" +cat > %{src_java_dir}/.mfiles << __EOF__ +%{_javadir}/%{name}/ +__EOF__ +%endif + +%if %{_use_repolib} +install -d "%{buildroot}%{maven2brewrepodir}" +cp "%{buildroot}%{_javadir}/%{name}/%{name}.jar" "%{buildroot}%{maven2brewrepodir}/%{name}-%{package_maven_version}.jar" +cp %{src_java_dir}/pom.xml "%{buildroot}%{maven2brewrepodir}/%{name}-%{package_maven_version}.pom" +%endif + +install -d -m 755 "%{buildroot}%{_sysconfdir}/%{name}.conf.d" +%find_lang %{name} + + +%files -n python%{python3_pkgversion}-%{name} +%doc AUTHORS +%license COPYING +%license LICENSE +%doc README +%doc README.API +%doc README.config-query +%doc README.debug-plugins +%doc README.dialog +%doc README.environment +%exclude %{python3_sitelib}/%{name}/codegen/ +%{python3_sitelib}/%{name}/ + + +%files common -f %{name}.lang +%dir %{_datadir}/%{name} +%dir %{_datadir}/%{name}/plugins +%dir %{_sysconfdir}/%{name}.conf.d +%{_sbindir}/%{name} +%{_bindir}/%{name}-config-query +%{_datadir}/%{name}/scripts/ +%{_datadir}/%{name}/plugins/%{name}/ +%{_datadir}/%{name}/%{name}-bundle +%{_datadir}/%{name}/%{name}-functions +%exclude %{_datadir}/%{name}/plugins/%{name}/debug/ + +%files java -f %{src_java_dir}/.mfiles + +%if %{_use_maven} +%files javadoc -f %{src_java_dir}/.mfiles-javadoc +%endif + + +%files -n python%{python3_pkgversion}-otopi-devtools +%{python3_sitelib}/%{name}/codegen/ + + +%files debug-plugins +%{_datadir}/%{name}/plugins/%{name}/debug/ + +%if %{_use_repolib} +%files repolib +%{maven2brewrepodir}/ +%endif + +%changelog +* Mon Jul 05 2021 lijunwei - 1.9.4-1 +- Init package