# Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### # change 'tests => 1' to 'tests => last_test_to_print'; use Test; BEGIN { plan tests => 1 }; use RPM::Specfile; ok(1); # If we made it this far, we're ok. my $spec = new RPM::Specfile; $spec->macros('%define a_macro by any other name is still a_macro.'); $spec->name('blippy-foo'); $spec->version('1.00'); $spec->release('1'); $spec->license("GPL"); $spec->group("Applications/CPAN"); $spec->push_source("blippy-foo-1.00.tar.gz"); $spec->push_source("extra-blippy.conf"); $spec->push_patch("super-blippy.patch"); $spec->push_patch("another.patch"); $spec->push_require(["foo", 1.2]); $spec->push_require("foo2 >= 1.2"); $spec->push_buildrequire(["xfoo", 1.2]); $spec->push_buildrequire("xfoo2 >= 1.2"); $spec->push_prefix('/usr/local/mypkg'); $spec->description(< E $spec->prep(<build(<install(< $clm_name-$clm_version-filelist if [ \"\$(cat $clm_name-$clm_version-filelist)X\" = \"X\" ] ; then echo \"ERROR: EMPTY FILE LIST\" exit -1 fi E $spec->pre('echo "Running %%pre!"'); $spec->post('echo "Running %%post!"'); $spec->preun('echo "Running %%preun!"'); $spec->postun('echo "Running %%postun!"'); $spec->file_param("-f blippy-filelist"); $spec->push_changelog(<generate_specfile; ######################### # Insert your test code below, the Test module is use()ed here so read # its man page ( perldoc Test ) for help writing this test script.