Cross package maker. DEB/RPM generation or conversion. Derived from jordansissel/fpm.

⌈⌋ branch:  cross package maker


Check-in [40571c6988]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
SHA1:40571c698898f29a9e66b8055d06c015d311bee3
Date: 2012-02-24 07:43:42
User: jls
Comment:- move older minitest tests away until they can be refactored to the new api
Tags And Properties
  • sym-trunk inherited from [2b439be7d6]
Context
2012-02-24
07:51
[b39613b0c9] - ignore more stuff - purge old test script (user: jls, tags: trunk)
07:43
[40571c6988] - move older minitest tests away until they can be refactored to the new api (user: jls, tags: trunk)
2012-02-23
07:59
[1e5dbadf47] - start major refactoring. Design first, this time. With tests. (user: jls, tags: trunk)
Changes

Deleted test/fpm/fpm_target_deb.rb.

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
require 'rubygems'
require 'minitest/autorun'
require 'fpm/target/deb'
require 'fpm/source/dir'
require 'erb'

describe FPM::Target::Deb do
  it 'renders the control file template correctly' do
    # Use the 'dir' source as it is the simplest to test in isolation
    root = File.join(File.dirname(__FILE__), 'test_data')
    # paths = root = File.join(File.dirname(__FILE__), 'test_data')
    # FIXME: Should be a fully-specifed path, but needs
    # some fixes in the path handling to remove the root components.
    paths = './test_data/dir/'
    source = FPM::Source::Dir.new(paths, root)
    deb = FPM::Target::Deb.new(source)

    # Fix some properties of the package to get consistent output
    deb.scripts = {}
    deb.architecture = 'all'
    deb.maintainer = '<testdude@example.com>'

    # Render the template and compare it to our canned output
    control_output = deb.render_spec
    test_file = File.join(File.dirname(__FILE__), 'test_data', 'test_deb.control')
    file_output = File.read(test_file)
    control_output.must_equal file_output
  end
end
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


























































Deleted test/fpm/fpm_target_rpm.rb.

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
require 'rubygems'
require 'minitest/autorun'
require 'fpm/target/rpm'
require 'fpm/source/dir'
require 'erb'

describe FPM::Target::Rpm do
  it 'renders the spec file template correctly' do
    # Use the 'dir' source as it is the simplest to test in isolation
    root = File.join(File.dirname(__FILE__), 'test_data')
    # paths = root = File.join(File.dirname(__FILE__), 'test_data')
    # FIXME: Should be a fully-specifed path, but needs
    # some fixes in the path handling to remove the root components.
    paths = './test_data/dir/'
    source = FPM::Source::Dir.new(paths, root)
    rpm = FPM::Target::Rpm.new(source)

    # Fix some properties of the package to get consistent output
    rpm.scripts = {}
    rpm.architecture = 'all'

    # Render the template and compare it to our canned output
    spec_output = rpm.render_spec
    test_file = File.join(File.dirname(__FILE__), 'test_data', 'test_rpm.spec')
    file_output = File.read(test_file)
    spec_output.must_equal file_output
  end
end
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
























































Deleted test/fpm/test_data/dir/foo.

Deleted test/fpm/test_data/test_deb.control.

1
2
3
4
5
6
7
8
9
Package: test-data
Version: 1.0
Architecture: all
Maintainer: <testdude@example.com>
Standards-Version: 3.9.1
Section: default
Priority: extra
Homepage: http://nourlgiven.example.com/no/url/given
Description: no description given
<
<
<
<
<
<
<
<
<


















Deleted test/fpm/test_data/test_rpm.spec.

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
%define __jar_repack 0

Name: test_data
Version: 1.0
Release: 1
Summary: no description given
BuildArch: noarch
AutoReqProv: no

Group: default
License: unknown
URL: http://nourlgiven.example.com/no/url/given
Source0:  %{_sourcedir}/data.tar.gz
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)

%description
no description given

%prep
# noop

%build
# noop

%install
# some rpm implementations delete the build dir and then recreate it by
# default, for some reason. Whatever, let's work around it.
cd $RPM_BUILD_ROOT
tar -zxf %SOURCE0

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)

/test_data/dir/

%changelog
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<














































































Added test/old/fpm_target_deb.rb.



























































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
require 'rubygems'
require 'minitest/autorun'
require 'fpm/target/deb'
require 'fpm/source/dir'
require 'erb'

describe FPM::Target::Deb do
  it 'renders the control file template correctly' do
    # Use the 'dir' source as it is the simplest to test in isolation
    root = File.join(File.dirname(__FILE__), 'test_data')
    # paths = root = File.join(File.dirname(__FILE__), 'test_data')
    # FIXME: Should be a fully-specifed path, but needs
    # some fixes in the path handling to remove the root components.
    paths = './test_data/dir/'
    source = FPM::Source::Dir.new(paths, root)
    deb = FPM::Target::Deb.new(source)

    # Fix some properties of the package to get consistent output
    deb.scripts = {}
    deb.architecture = 'all'
    deb.maintainer = '<testdude@example.com>'

    # Render the template and compare it to our canned output
    control_output = deb.render_spec
    test_file = File.join(File.dirname(__FILE__), 'test_data', 'test_deb.control')
    file_output = File.read(test_file)
    control_output.must_equal file_output
  end
end

Added test/old/fpm_target_rpm.rb.

























































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
require 'rubygems'
require 'minitest/autorun'
require 'fpm/target/rpm'
require 'fpm/source/dir'
require 'erb'

describe FPM::Target::Rpm do
  it 'renders the spec file template correctly' do
    # Use the 'dir' source as it is the simplest to test in isolation
    root = File.join(File.dirname(__FILE__), 'test_data')
    # paths = root = File.join(File.dirname(__FILE__), 'test_data')
    # FIXME: Should be a fully-specifed path, but needs
    # some fixes in the path handling to remove the root components.
    paths = './test_data/dir/'
    source = FPM::Source::Dir.new(paths, root)
    rpm = FPM::Target::Rpm.new(source)

    # Fix some properties of the package to get consistent output
    rpm.scripts = {}
    rpm.architecture = 'all'

    # Render the template and compare it to our canned output
    spec_output = rpm.render_spec
    test_file = File.join(File.dirname(__FILE__), 'test_data', 'test_rpm.spec')
    file_output = File.read(test_file)
    spec_output.must_equal file_output
  end
end

Added test/old/test_data/dir/foo.

Added test/old/test_data/test_deb.control.



















>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
Package: test-data
Version: 1.0
Architecture: all
Maintainer: <testdude@example.com>
Standards-Version: 3.9.1
Section: default
Priority: extra
Homepage: http://nourlgiven.example.com/no/url/given
Description: no description given

Added test/old/test_data/test_rpm.spec.















































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
%define __jar_repack 0

Name: test_data
Version: 1.0
Release: 1
Summary: no description given
BuildArch: noarch
AutoReqProv: no

Group: default
License: unknown
URL: http://nourlgiven.example.com/no/url/given
Source0:  %{_sourcedir}/data.tar.gz
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)

%description
no description given

%prep
# noop

%build
# noop

%install
# some rpm implementations delete the build dir and then recreate it by
# default, for some reason. Whatever, let's work around it.
cd $RPM_BUILD_ROOT
tar -zxf %SOURCE0

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)

/test_data/dir/

%changelog