From d05444187cde892a36ba7f1345fa6f782f7cadd0 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Tue, 14 May 2013 02:23:28 +0200 Subject: [PATCH] Add Perl module. --- perl-itkacl-2.0/Makefile.PL | 8 +++++++ perl-itkacl-2.0/debian/changelog | 5 +++++ perl-itkacl-2.0/debian/compat | 1 + perl-itkacl-2.0/debian/control | 13 ++++++++++++ perl-itkacl-2.0/debian/copyright | 36 ++++++++++++++++++++++++++++++++ perl-itkacl-2.0/debian/rules | 34 ++++++++++++++++++++++++++++++ perl-itkacl-2.0/itkacl.i | 20 ++++++++++++++++++ 7 files changed, 117 insertions(+) create mode 100644 perl-itkacl-2.0/Makefile.PL create mode 100644 perl-itkacl-2.0/debian/changelog create mode 100644 perl-itkacl-2.0/debian/compat create mode 100644 perl-itkacl-2.0/debian/control create mode 100644 perl-itkacl-2.0/debian/copyright create mode 100755 perl-itkacl-2.0/debian/rules create mode 100644 perl-itkacl-2.0/itkacl.i diff --git a/perl-itkacl-2.0/Makefile.PL b/perl-itkacl-2.0/Makefile.PL new file mode 100644 index 0000000..684530b --- /dev/null +++ b/perl-itkacl-2.0/Makefile.PL @@ -0,0 +1,8 @@ +use ExtUtils::MakeMaker; + +WriteMakefile( + NAME => 'itkacl', + VERSION => '2.0', + LIBS => '-litkacl', + OBJECT => 'itkacl_wrap.o', +); diff --git a/perl-itkacl-2.0/debian/changelog b/perl-itkacl-2.0/debian/changelog new file mode 100644 index 0000000..0b335fd --- /dev/null +++ b/perl-itkacl-2.0/debian/changelog @@ -0,0 +1,5 @@ +libitkacl-perl (2.0) unstable; urgency=low + + * Initial release. + + -- Steinar H. Gunderson Tue, 14 May 2013 01:26:44 +0200 diff --git a/perl-itkacl-2.0/debian/compat b/perl-itkacl-2.0/debian/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/perl-itkacl-2.0/debian/compat @@ -0,0 +1 @@ +7 diff --git a/perl-itkacl-2.0/debian/control b/perl-itkacl-2.0/debian/control new file mode 100644 index 0000000..c0a5f29 --- /dev/null +++ b/perl-itkacl-2.0/debian/control @@ -0,0 +1,13 @@ +Source: libitkacl-perl +Section: perl +Priority: optional +Build-Depends: debhelper (>= 7), perl, libitkacl-dev +Maintainer: Steinar H. Gunderson +Standards-Version: 3.9.1 +Homepage: http://search.cpan.org/dist/itkacl/ + +Package: libitkacl-perl +Architecture: any +Depends: ${misc:Depends}, ${perl:Depends}, ${shlibs:Depends} +Description: Perl modules for ITKACL + Perl module to interface to ITKACL. diff --git a/perl-itkacl-2.0/debian/copyright b/perl-itkacl-2.0/debian/copyright new file mode 100644 index 0000000..2cefaea --- /dev/null +++ b/perl-itkacl-2.0/debian/copyright @@ -0,0 +1,36 @@ +Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135 +Maintainer: (information incomplete) +Source: http://search.cpan.org/dist/itkacl/ +Name: itkacl +DISCLAIMER: This copyright info was automatically extracted + from the perl module. It may not be accurate, so you better + check the module sources in order to ensure the module for its + inclusion in Debian or for general legal information. Please, + if licensing information is incorrectly generated, file a bug + on dh-make-perl. + NOTE: Don't forget to remove this disclaimer once you are happy + with this file. + +Files: * +Copyright: (information incomplete) +License: + +Files: debian/* +Copyright: 2013, Steinar H. Gunderson +License: Artistic or GPL-1+ + +License: Artistic + This program is free software; you can redistribute it and/or modify + it under the terms of the Artistic License, which comes with Perl. + . + On Debian GNU/Linux systems, the complete text of the Artistic License + can be found in `/usr/share/common-licenses/Artistic'. + +License: GPL-1+ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 1, or (at your option) + any later version. + . + On Debian GNU/Linux systems, the complete text of version 1 of the + General Public License can be found in `/usr/share/common-licenses/GPL-1'. diff --git a/perl-itkacl-2.0/debian/rules b/perl-itkacl-2.0/debian/rules new file mode 100755 index 0000000..3b2aefe --- /dev/null +++ b/perl-itkacl-2.0/debian/rules @@ -0,0 +1,34 @@ +#!/usr/bin/make -f + +build: + dh_testdir + swig -perl5 itkacl.i + perl Makefile.PL INSTALLDIRS=vendor + $(MAKE) OPTIMIZE="-O2 -g -Wall" + +clean: + dh_testdir + dh_clean + [ ! -f Makefile ] || $(MAKE) distclean + $(RM) itkacl.pm itkacl_wrap.c + +binary-indep: + +binary-arch: + dh_testroot + dh_prep + dh_installdirs + $(MAKE) install DESTDIR=$(CURDIR)/debian/libitkacl-perl + dh_install + dh_perl + dh_compress + dh_fixperms + dh_strip + dh_makeshlibs + dh_shlibdeps + dh_installdeb + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-arch diff --git a/perl-itkacl-2.0/itkacl.i b/perl-itkacl-2.0/itkacl.i new file mode 100644 index 0000000..f58703c --- /dev/null +++ b/perl-itkacl-2.0/itkacl.i @@ -0,0 +1,20 @@ +/* SWIG interface for libitkacl */ +%module itkacl + +/* Convert errors to Perl exceptions and keep the interface clean. */ +%inline %{ + extern int itkacl_check(char *realm, char *user, char *errmsg, size_t errmsgsize); + int check(char *realm, char *user) + { + char errmsg[1024]; + int ret = itkacl_check(realm, user, errmsg, 1024); + + /* printf("check '%s' vs. '%s' gave %d\n", user, realm, ret); */ + if (ret == -1) + die(errmsg); + else + return (ret == 0); + } + +%} + -- 2.39.2