Clone
3
cpanspec usage
Tina Müller edited this page 2025-10-02 16:55:39 +02:00

How to use cpanspec for generating spec files in https://src.opensuse.org/perl

Requirements

Updating modules

See "Version normalization" below, though

Suppose perl-Module-Name gets updated from 1.0 to 1.1.

Clone the according git repository perl/perl-Module-Name and download the new tarball from https://metacpan.org

Get the latest CPAN indexed modules:

curl -o http://www.cpan.org/modules/02packages.details.txt.gz ~/02packages.details.txt.gz

Generate spec and changes:

cpanspec -f --pkgdetails ~/02packages.details.txt.gz -v Module-Name-v1.1.tar.gz --old-file Module-Name-v1.0.tar.gz

Regenerating spec without changes generation:

cpanspec -f --pkgdetails ~/02packages.details.txt.gz -v Module-Name-v1.1.tar.gz --skip-changes

Version normalization

See also https://github.com/openSUSE/cpanspec/issues/47

We are currently normalizing all versions for perl modules. In the transition phase the new cpanspec code is not yet released. To use the new code, use it from the git PR https://github.com/openSUSE/cpanspec/pull/48

Then the commandline just gets a new option --dlp (standing for devel:languages:perl at SUSE) which will generate normalized versions and also add the README.md file used in gitea:

cpanspec -f --pkgdetails ~/02packages.details.txt.gz -v --dlp Module-Name-v1.1.tar.gz --old-file Module-Name-v1.0.tar.gz