diff options
author | wiz <wiz@pkgsrc.org> | 2005-11-13 19:53:19 +0000 |
---|---|---|
committer | wiz <wiz@pkgsrc.org> | 2005-11-13 19:53:19 +0000 |
commit | 28064e4ceeb92e8273dec72e6c46a36c3bf5d66d (patch) | |
tree | 638d7431ea7ac3377888031fc2b089c502d2efbf /pkgtools/p5-pkgsrc-Dewey | |
parent | c6865dc16120091ff1b3787130ef762331733a54 (diff) | |
download | pkgsrc-28064e4ceeb92e8273dec72e6c46a36c3bf5d66d.tar.gz |
Initial import of p5-pkgsrc-Dewey:
This Perl module provides functions to compare pkgsrc Dewey numbers.
Diffstat (limited to 'pkgtools/p5-pkgsrc-Dewey')
-rw-r--r-- | pkgtools/p5-pkgsrc-Dewey/DESCR | 1 | ||||
-rw-r--r-- | pkgtools/p5-pkgsrc-Dewey/Makefile | 33 | ||||
-rw-r--r-- | pkgtools/p5-pkgsrc-Dewey/PLIST | 1 | ||||
-rw-r--r-- | pkgtools/p5-pkgsrc-Dewey/files/Changes | 4 | ||||
-rw-r--r-- | pkgtools/p5-pkgsrc-Dewey/files/Dewey.pm | 85 | ||||
-rw-r--r-- | pkgtools/p5-pkgsrc-Dewey/files/Dewey.xs | 31 | ||||
-rw-r--r-- | pkgtools/p5-pkgsrc-Dewey/files/MANIFEST | 8 | ||||
-rw-r--r-- | pkgtools/p5-pkgsrc-Dewey/files/Makefile.PL | 8 | ||||
-rw-r--r-- | pkgtools/p5-pkgsrc-Dewey/files/README | 26 | ||||
-rw-r--r-- | pkgtools/p5-pkgsrc-Dewey/files/t/Dewey.t | 19 | ||||
-rw-r--r-- | pkgtools/p5-pkgsrc-Dewey/files/typemap | 1 |
11 files changed, 217 insertions, 0 deletions
diff --git a/pkgtools/p5-pkgsrc-Dewey/DESCR b/pkgtools/p5-pkgsrc-Dewey/DESCR new file mode 100644 index 00000000000..a31643654e9 --- /dev/null +++ b/pkgtools/p5-pkgsrc-Dewey/DESCR @@ -0,0 +1 @@ +This Perl module provides functions to compare pkgsrc Dewey numbers. diff --git a/pkgtools/p5-pkgsrc-Dewey/Makefile b/pkgtools/p5-pkgsrc-Dewey/Makefile new file mode 100644 index 00000000000..75cec453c85 --- /dev/null +++ b/pkgtools/p5-pkgsrc-Dewey/Makefile @@ -0,0 +1,33 @@ +# $NetBSD: Makefile,v 1.1.1.1 2005/11/13 19:53:19 wiz Exp $ +# + +DISTNAME= p5-pkgsrc-Dewey-1.0 +CATEGORIES= pkgtools perl5 +MASTER_SITES= # empty +DISTFILES= # empty + +MAINTAINER= wiz@NetBSD.org +HOMEPAGE= http://www.netbsd.org/Documentation/pkgsrc/ +COMMENT= Perl module to compare pkgsrc Dewey numbers + +CPPFLAGS+= -DHAVE_CTYPE_H -DHAVE_STDLIB_H + +NO_CHECKSUM= yes + +PKG_INSTALLATION_TYPES= overwrite pkgviews + +PERL5_PACKLIST= auto/pkgsrc/Dewey/.packlist + +PKG_INSTALL_FILESDIR= ../../pkgtools/pkg_install/files +PKG_INSTALL_FILES= lib/dewey.c lib/dewey.h lib/defs.h + +do-extract: + ${MKDIR} ${WRKSRC} + ${CP} -r ${FILESDIR}/* ${WRKSRC} + for f in ${PKG_INSTALL_FILES}; do \ + ${CP} ${PKG_INSTALL_FILESDIR}/$$f ${WRKSRC}; \ + done + ${TOUCH} ${WRKSRC}/nbcompat.h + +.include "../../lang/perl5/module.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/pkgtools/p5-pkgsrc-Dewey/PLIST b/pkgtools/p5-pkgsrc-Dewey/PLIST new file mode 100644 index 00000000000..e2c37ac9137 --- /dev/null +++ b/pkgtools/p5-pkgsrc-Dewey/PLIST @@ -0,0 +1 @@ +@comment $NetBSD: PLIST,v 1.1.1.1 2005/11/13 19:53:19 wiz Exp $ diff --git a/pkgtools/p5-pkgsrc-Dewey/files/Changes b/pkgtools/p5-pkgsrc-Dewey/files/Changes new file mode 100644 index 00000000000..78eb0f53f38 --- /dev/null +++ b/pkgtools/p5-pkgsrc-Dewey/files/Changes @@ -0,0 +1,4 @@ +Revision history for Perl extension pkgsrc::Dewey. + +1.0 Mon Oct 17 15:46:19 2005 + - first version diff --git a/pkgtools/p5-pkgsrc-Dewey/files/Dewey.pm b/pkgtools/p5-pkgsrc-Dewey/files/Dewey.pm new file mode 100644 index 00000000000..5f86161a9a6 --- /dev/null +++ b/pkgtools/p5-pkgsrc-Dewey/files/Dewey.pm @@ -0,0 +1,85 @@ +package pkgsrc::Dewey; + +use strict; +use warnings; + +require Exporter; +use AutoLoader; + +our @ISA = qw(Exporter); + +our @EXPORT = qw(dewey_cmp dewey_match); + +our $VERSION = '1.0'; + +require XSLoader; +XSLoader::load('pkgsrc::Dewey', $VERSION); + +# Preloaded methods go here. + +# Autoload methods go after =cut, and are processed by the autosplit program. + +1; +__END__ +# Below is stub documentation for your module. You'd better edit it! + +=head1 NAME + +pkgsrc::Dewey - Perl extension for comparing pkgsrc Dewey version numbers + +=head1 SYNOPSIS + + use pkgsrc::Dewey; + dewey_cmp(lhs, op, rhs); + dewey_match(pattern, package); + +=head1 DESCRIPTION + +C<pkgsrc::Dewey> is a Perl extension for comparing pkgsrc Dewey version +numbers. +It provides two functions: +C<dewey_cmp()> and C<dewey_match()>. + +C<dewey_cmp(pattern, package)> +compares the C<pattern> against the C<package>, and returns 1 if the +C<package> matches the C<pattern> and 0 if not. Both the C<pattern> +and the C<package> should contain a package name. + +C<dewey_match(lhs, op, rhs)> +compares two pkgsrc Dewey version numbers. Both C<lhs> and +C<rhs> should be version numbers (not containing any package names). +If the operator C<op> is invalid, C<dewey_match> returns -1. +Otherwise it returns 1 if the comparison is true and 0 if not. + +=head2 EXPORT + +C<dewey_cmp()>, +C<dewey_match()> + +=head1 SEE ALSO + +Homepage for the Perl module: +L<http://www.netbsd.org/packages/pkgtools/p5-pkgsrc-Dewey/README.html> + +General information about pkgsrc: +L<http://www.pkgsrc.org/> + +The pkgsrc guide: +L<http://www.netbsd.org/Documentation/pkgsrc/> + +=head1 AUTHORS + +Dieter Baron E<lt>dillo@NetBSD.orgE<gt> +and +Thomas Klausner E<lt>wiz@NetBSD.orgE<gt> + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2005 by Dieter Baron and Thomas Klausner + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.7 or, +at your option, any later version of Perl 5 you may have available. + + +=cut diff --git a/pkgtools/p5-pkgsrc-Dewey/files/Dewey.xs b/pkgtools/p5-pkgsrc-Dewey/files/Dewey.xs new file mode 100644 index 00000000000..9c696ab5794 --- /dev/null +++ b/pkgtools/p5-pkgsrc-Dewey/files/Dewey.xs @@ -0,0 +1,31 @@ +#include "EXTERN.h" +#include "perl.h" +#include "XSUB.h" + +#include <dewey.h> + +MODULE = pkgsrc::Dewey PACKAGE = pkgsrc::Dewey + +int +dewey_match(pattern, package) + const char * pattern + const char * package + PROTOTYPE: $;$ + OUTPUT: + RETVAL + +int +dewey_cmp(lhs, op, rhs) + const char * lhs + const char * op + const char * rhs + PROTOTYPE: $;$;$ + INIT: + int opi; + CODE: + if (dewey_mktest(&opi, op) < 0) + RETVAL = -1; + else + RETVAL = dewey_cmp(lhs, opi, rhs); + OUTPUT: + RETVAL diff --git a/pkgtools/p5-pkgsrc-Dewey/files/MANIFEST b/pkgtools/p5-pkgsrc-Dewey/files/MANIFEST new file mode 100644 index 00000000000..230ce6243cb --- /dev/null +++ b/pkgtools/p5-pkgsrc-Dewey/files/MANIFEST @@ -0,0 +1,8 @@ +Changes +Dewey.pm +Dewey.xs +MANIFEST +Makefile.PL +README +t/Dewey.t +typemap diff --git a/pkgtools/p5-pkgsrc-Dewey/files/Makefile.PL b/pkgtools/p5-pkgsrc-Dewey/files/Makefile.PL new file mode 100644 index 00000000000..9b1267d77b4 --- /dev/null +++ b/pkgtools/p5-pkgsrc-Dewey/files/Makefile.PL @@ -0,0 +1,8 @@ +use 5.008007; +use ExtUtils::MakeMaker; +WriteMakefile( + NAME => 'pkgsrc::Dewey', + VERSION_FROM => 'Dewey.pm', # finds $VERSION + INC => '-I.', + OBJECT => '$(O_FILES)', # link all the C files too +); diff --git a/pkgtools/p5-pkgsrc-Dewey/files/README b/pkgtools/p5-pkgsrc-Dewey/files/README new file mode 100644 index 00000000000..52c41415c03 --- /dev/null +++ b/pkgtools/p5-pkgsrc-Dewey/files/README @@ -0,0 +1,26 @@ +pkgsrc::Dewey version 1.0 +========================= + +This Perl module provides functions to compare pkgsrc Dewey +numbers. + +INSTALLATION + +To install this module type the following: + + perl Makefile.PL + make + make test + make install + +DEPENDENCIES + +This module has no dependencies. + +COPYRIGHT AND LICENCE + +Copyright (C) 2005 by Dieter Baron and Thomas Klausner. + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.8.7 or, +at your option, any later version of Perl 5 you may have available. diff --git a/pkgtools/p5-pkgsrc-Dewey/files/t/Dewey.t b/pkgtools/p5-pkgsrc-Dewey/files/t/Dewey.t new file mode 100644 index 00000000000..467165eb914 --- /dev/null +++ b/pkgtools/p5-pkgsrc-Dewey/files/t/Dewey.t @@ -0,0 +1,19 @@ +# Before `make install' is performed this script should be runnable with +# `make test'. After `make install' it should work as `perl Dewey.t' + +######################### + +# change 'tests => 1' to 'tests => last_test_to_print'; + +use Test::More tests => 5; +BEGIN { use_ok('pkgsrc::Dewey') }; + +######################### + +# Insert your test code below, the Test::More module is use()ed here so read +# its man page ( perldoc Test::More ) for help writing this test script. + +ok(dewey_cmp("1.0", "<", "2.0") > 0, 'dewey_cmp result incorrect'); +ok(dewey_cmp("1.0", "a", "2.0") == -1, 'incorrect operator'); +ok(dewey_match("foo<1.0", "foo-1.0beta1"), 'beta'); +is(dewey_match("foo<1.0alpha1", "foo-1.0beta1"), 0, 'alpha'); diff --git a/pkgtools/p5-pkgsrc-Dewey/files/typemap b/pkgtools/p5-pkgsrc-Dewey/files/typemap new file mode 100644 index 00000000000..0618f0d3109 --- /dev/null +++ b/pkgtools/p5-pkgsrc-Dewey/files/typemap @@ -0,0 +1 @@ +const char * T_PV |