pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/p5-pkgsrc-Dewey Initial import of p5-pkgsrc-D...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/98ecc8e703a5
branches:  trunk
changeset: 503067:98ecc8e703a5
user:      wiz <wiz%pkgsrc.org@localhost>
date:      Sun Nov 13 19:53:19 2005 +0000

description:
Initial import of p5-pkgsrc-Dewey:

This Perl module provides functions to compare pkgsrc Dewey numbers.

diffstat:

 pkgtools/p5-pkgsrc-Dewey/DESCR             |   1 +
 pkgtools/p5-pkgsrc-Dewey/Makefile          |  33 +++++++++++
 pkgtools/p5-pkgsrc-Dewey/PLIST             |   1 +
 pkgtools/p5-pkgsrc-Dewey/files/Changes     |   4 +
 pkgtools/p5-pkgsrc-Dewey/files/Dewey.pm    |  85 ++++++++++++++++++++++++++++++
 pkgtools/p5-pkgsrc-Dewey/files/Dewey.xs    |  31 ++++++++++
 pkgtools/p5-pkgsrc-Dewey/files/MANIFEST    |   8 ++
 pkgtools/p5-pkgsrc-Dewey/files/Makefile.PL |   8 ++
 pkgtools/p5-pkgsrc-Dewey/files/README      |  26 +++++++++
 pkgtools/p5-pkgsrc-Dewey/files/t/Dewey.t   |  19 ++++++
 pkgtools/p5-pkgsrc-Dewey/files/typemap     |   1 +
 11 files changed, 217 insertions(+), 0 deletions(-)

diffs (261 lines):

diff -r fbc55af79082 -r 98ecc8e703a5 pkgtools/p5-pkgsrc-Dewey/DESCR
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/pkgtools/p5-pkgsrc-Dewey/DESCR    Sun Nov 13 19:53:19 2005 +0000
@@ -0,0 +1,1 @@
+This Perl module provides functions to compare pkgsrc Dewey numbers.
diff -r fbc55af79082 -r 98ecc8e703a5 pkgtools/p5-pkgsrc-Dewey/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/pkgtools/p5-pkgsrc-Dewey/Makefile Sun Nov 13 19:53:19 2005 +0000
@@ -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@localhost
+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 -r fbc55af79082 -r 98ecc8e703a5 pkgtools/p5-pkgsrc-Dewey/PLIST
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/pkgtools/p5-pkgsrc-Dewey/PLIST    Sun Nov 13 19:53:19 2005 +0000
@@ -0,0 +1,1 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2005/11/13 19:53:19 wiz Exp $
diff -r fbc55af79082 -r 98ecc8e703a5 pkgtools/p5-pkgsrc-Dewey/files/Changes
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/pkgtools/p5-pkgsrc-Dewey/files/Changes    Sun Nov 13 19:53:19 2005 +0000
@@ -0,0 +1,4 @@
+Revision history for Perl extension pkgsrc::Dewey.
+
+1.0  Mon Oct 17 15:46:19 2005
+       - first version
diff -r fbc55af79082 -r 98ecc8e703a5 pkgtools/p5-pkgsrc-Dewey/files/Dewey.pm
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/pkgtools/p5-pkgsrc-Dewey/files/Dewey.pm   Sun Nov 13 19:53:19 2005 +0000
@@ -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@localhost<gt>
+and
+Thomas Klausner E<lt>wiz%NetBSD.orgE@localhost<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 -r fbc55af79082 -r 98ecc8e703a5 pkgtools/p5-pkgsrc-Dewey/files/Dewey.xs
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/pkgtools/p5-pkgsrc-Dewey/files/Dewey.xs   Sun Nov 13 19:53:19 2005 +0000
@@ -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 -r fbc55af79082 -r 98ecc8e703a5 pkgtools/p5-pkgsrc-Dewey/files/MANIFEST
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/pkgtools/p5-pkgsrc-Dewey/files/MANIFEST   Sun Nov 13 19:53:19 2005 +0000
@@ -0,0 +1,8 @@
+Changes
+Dewey.pm
+Dewey.xs
+MANIFEST
+Makefile.PL
+README
+t/Dewey.t
+typemap
diff -r fbc55af79082 -r 98ecc8e703a5 pkgtools/p5-pkgsrc-Dewey/files/Makefile.PL
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/pkgtools/p5-pkgsrc-Dewey/files/Makefile.PL        Sun Nov 13 19:53:19 2005 +0000
@@ -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 -r fbc55af79082 -r 98ecc8e703a5 pkgtools/p5-pkgsrc-Dewey/files/README
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/pkgtools/p5-pkgsrc-Dewey/files/README     Sun Nov 13 19:53:19 2005 +0000
@@ -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 -r fbc55af79082 -r 98ecc8e703a5 pkgtools/p5-pkgsrc-Dewey/files/t/Dewey.t
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/pkgtools/p5-pkgsrc-Dewey/files/t/Dewey.t  Sun Nov 13 19:53:19 2005 +0000
@@ -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 -r fbc55af79082 -r 98ecc8e703a5 pkgtools/p5-pkgsrc-Dewey/files/typemap
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/pkgtools/p5-pkgsrc-Dewey/files/typemap    Sun Nov 13 19:53:19 2005 +0000
@@ -0,0 +1,1 @@
+const char *    T_PV



Home | Main Index | Thread Index | Old Index