Update to current packaging guidelines

This commit is contained in:
Mikolaj Izdebski 2017-02-23 15:43:25 +01:00
parent 4229894859
commit 3c0c49d2ef

View File

@ -1,38 +1,30 @@
%if 0%{?fedora} > 19 || 0%{?rhel} > 6
%global headless -headless
%endif
Name: xml-commons-resolver Name: xml-commons-resolver
Version: 1.2
Release: 21%{?dist}
Epoch: 0 Epoch: 0
Version: 1.2
Release: 22%{?dist}
Summary: Resolver subproject of xml-commons Summary: Resolver subproject of xml-commons
License: ASL 2.0 License: ASL 2.0
URL: http://xerces.apache.org/xml-commons/components/resolver/ URL: http://xerces.apache.org/xml-commons/components/resolver/
BuildArch: noarch
Source0: http://www.apache.org/dist/xerces/xml-commons/%{name}-%{version}.tar.gz Source0: http://www.apache.org/dist/xerces/xml-commons/%{name}-%{version}.tar.gz
Source5: %{name}-pom.xml Source5: %{name}-pom.xml
Source6: %{name}-resolver.1 Source6: %{name}-resolver.1
Source7: %{name}-xparse.1 Source7: %{name}-xparse.1
Source8: %{name}-xread.1 Source8: %{name}-xread.1
Patch0: %{name}-1.2-crosslink.patch Patch0: %{name}-1.2-crosslink.patch
Patch1: %{name}-1.2-osgi.patch Patch1: %{name}-1.2-osgi.patch
Requires: java%{?headless} >= 1:1.6.0 BuildRequires: javapackages-local
Requires: jpackage-utils
BuildRequires: java-devel >= 1:1.6.0
BuildRequires: ant BuildRequires: ant
BuildRequires: jpackage-utils BuildRequires: apache-parent
Group: Development/Libraries
BuildArch: noarch
%description %description
Resolver subproject of xml-commons. Resolver subproject of xml-commons.
%package javadoc %package javadoc
Summary: Javadoc for %{name} Summary: Javadoc for %{name}
Group: Documentation
BuildRequires: java-javadoc
Requires: java-javadoc
%description javadoc %description javadoc
Javadoc for %{name}. Javadoc for %{name}.
@ -47,18 +39,14 @@ find . -name "*.jar" -exec rm -f {} \;
rm -rf docs rm -rf docs
sed -i 's/\r//' KEYS LICENSE.resolver.txt NOTICE-resolver.txt sed -i 's/\r//' KEYS LICENSE.resolver.txt NOTICE-resolver.txt
%mvn_file : xml-commons-resolver xml-resolver
%build %build
%ant -f resolver.xml jar javadocs %ant -f resolver.xml jar javadocs
%mvn_artifact %{SOURCE5} build/resolver.jar
%install %install
# Jars %mvn_install -J build/apidocs/resolver
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}
install -p -m 644 build/resolver.jar $RPM_BUILD_ROOT%{_javadir}/%{name}.jar
ln -s %{name}.jar $RPM_BUILD_ROOT%{_javadir}/xml-resolver.jar
# Javadocs
mkdir -p $RPM_BUILD_ROOT%{_javadocdir}/%{name}
cp -pr build/apidocs/resolver/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}
# Scripts # Scripts
mkdir -p $RPM_BUILD_ROOT%{_bindir} mkdir -p $RPM_BUILD_ROOT%{_bindir}
@ -72,23 +60,18 @@ install -p -m 644 %{SOURCE6} ${RPM_BUILD_ROOT}%{_mandir}/man1/xml-resolver.1
install -p -m 644 %{SOURCE7} ${RPM_BUILD_ROOT}%{_mandir}/man1/xml-xparse.1 install -p -m 644 %{SOURCE7} ${RPM_BUILD_ROOT}%{_mandir}/man1/xml-xparse.1
install -p -m 644 %{SOURCE8} ${RPM_BUILD_ROOT}%{_mandir}/man1/xml-xread.1 install -p -m 644 %{SOURCE8} ${RPM_BUILD_ROOT}%{_mandir}/man1/xml-xread.1
# Pom
install -d -m 755 %{buildroot}%{_mavenpomdir}
install -p -m 644 %{SOURCE5} %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
%add_maven_depmap JPP-%{name}.pom %{name}.jar
%files -f .mfiles %files -f .mfiles
%doc KEYS LICENSE.resolver.txt NOTICE-resolver.txt %doc KEYS LICENSE.resolver.txt NOTICE-resolver.txt
%{_mavenpomdir}/*
%{_javadir}/*
%{_mandir}/man1/* %{_mandir}/man1/*
%{_bindir}/xml-* %{_bindir}/xml-*
%files javadoc %files javadoc -f .mfiles-javadoc
%{_javadocdir}/%{name}
%doc LICENSE.resolver.txt NOTICE-resolver.txt %doc LICENSE.resolver.txt NOTICE-resolver.txt
%changelog %changelog
* Thu Feb 23 2017 Mikolaj Izdebski <mizdebsk@redhat.com> - 0:1.2-22
- Update to current packaging guidelines
* Thu Feb 16 2017 Mikolaj Izdebski <mizdebsk@redhat.com> - 0:1.2-21 * Thu Feb 16 2017 Mikolaj Izdebski <mizdebsk@redhat.com> - 0:1.2-21
- Fix rpm conditional - Fix rpm conditional