]> git.sesse.net Git - itkacl/commitdiff
Add Perl module.
authorSteinar H. Gunderson <sesse@samfundet.no>
Tue, 14 May 2013 00:23:28 +0000 (02:23 +0200)
committerSteinar H. Gunderson <sesse@samfundet.no>
Tue, 14 May 2013 00:23:28 +0000 (02:23 +0200)
perl-itkacl-2.0/Makefile.PL [new file with mode: 0644]
perl-itkacl-2.0/debian/changelog [new file with mode: 0644]
perl-itkacl-2.0/debian/compat [new file with mode: 0644]
perl-itkacl-2.0/debian/control [new file with mode: 0644]
perl-itkacl-2.0/debian/copyright [new file with mode: 0644]
perl-itkacl-2.0/debian/rules [new file with mode: 0755]
perl-itkacl-2.0/itkacl.i [new file with mode: 0644]

diff --git a/perl-itkacl-2.0/Makefile.PL b/perl-itkacl-2.0/Makefile.PL
new file mode 100644 (file)
index 0000000..684530b
--- /dev/null
@@ -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 (file)
index 0000000..0b335fd
--- /dev/null
@@ -0,0 +1,5 @@
+libitkacl-perl (2.0) unstable; urgency=low
+
+  * Initial release.
+
+ -- Steinar H. Gunderson <sesse@samfundet.no>  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 (file)
index 0000000..7f8f011
--- /dev/null
@@ -0,0 +1 @@
+7
diff --git a/perl-itkacl-2.0/debian/control b/perl-itkacl-2.0/debian/control
new file mode 100644 (file)
index 0000000..c0a5f29
--- /dev/null
@@ -0,0 +1,13 @@
+Source: libitkacl-perl
+Section: perl
+Priority: optional
+Build-Depends: debhelper (>= 7), perl, libitkacl-dev
+Maintainer: Steinar H. Gunderson <sesse@samfundet.no>
+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 (file)
index 0000000..2cefaea
--- /dev/null
@@ -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 <sesse@samfundet.no>
+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 (executable)
index 0000000..3b2aefe
--- /dev/null
@@ -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 (file)
index 0000000..f58703c
--- /dev/null
@@ -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);
+       }
+       
+%}
+