debug

This is a recipe for conversion of current mvn-rpmbuild spec file into xmvn style spec file.

In this recipe we'll show how to convert Maven projects using following keywords:

Original spec file content

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
%global short_name plexus-components

Name:           %{short_name}-pom
Version:        1.2
Release:        2%{?dist}
Summary:        Plexus Components POM
BuildArch:      noarch
Group:          Development/Libraries
License:        ASL 2.0
URL:            http://plexus.codehaus.org/%{short_name}
Source0:        http://repo.maven.apache.org/maven2/org/codehaus/plexus/%{short_name}/%{version}/%{short_name}-%{version}.pom

BuildRequires:  jpackage-utils
BuildRequires:  maven

Requires:       jpackage-utils

%description
This package provides Plexus Components parent POM used by different
Plexus packages.

%prep
cp -p %{SOURCE0} pom.xml

%build
mvn-rpmbuild -X verify # see enabling debugging output in notable differences

%install
install -d -m 755 %{buildroot}%{_mavenpomdir}
install -p -m 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
%add_maven_depmap JPP-%{name}.pom

%files
%{_mavenpomdir}/JPP-%{name}.pom
%{_mavendepmapfragdir}/%{name}

%changelog
* Mon Nov 12 2012 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.2-2
- Install LICENSE file

* Wed Oct 31 2012 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.2-1
- Initial packaging

New xmvn spec file

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
%global short_name plexus-components

Name:           %{short_name}-pom
Version:        1.2
Release:        3%{?dist}
Summary:        Plexus Components POM
BuildArch:      noarch
Group:          Development/Libraries
License:        ASL 2.0
URL:            http://plexus.codehaus.org/%{short_name}
Source0:        http://repo.maven.apache.org/maven2/org/codehaus/plexus/%{short_name}/%{version}/%{short_name}-%{version}.pom

BuildRequires:  jpackage-utils
BuildRequires:  maven-local

Requires:       jpackage-utils

%description
This package provides Plexus Components parent POM used by different
Plexus packages.

%prep
cp -p %{SOURCE0} pom.xml

%build
%mvn_build -X # see enabling debugging output in notable differences

%install
%mvn_install

%files -f .mfiles

%changelog
* Tue Jan 29 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.2-3
- Build with xmvn

* Mon Nov 12 2012 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.2-2
- Install LICENSE file

* Wed Oct 31 2012 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.2-1
- Initial packaging

Comparison of manual and automatic requires

Manual requires

plexus-components-pom requires:

Automatic requires

plexus-components-pom requires:

Notable spec file differences