Showing posts with label Perl. Show all posts
Showing posts with label Perl. Show all posts

Jun 18, 2009

Perl DBus Library

If you want camels in your D-Bus, use perl-Net-DBus by Daniel Berrange. I have just fixed the original packaging done by Illuusio. Enjoy.

Jul 7, 2008

Cultural Exchange 3: First .deb

Started to build YaST. Managed to compile yast2-core. Now going to make it repeatable by properly packaging the dependencies. The first one is blocxx. Bleeding edge stuff is in the Build Service: home:mvidner:debian. The post How to make debian standard debs from scratch was much helpful.

Tried to print and failed miserably. The setup tool would not work with a remote CUPS printer, kept asking for my password. Switching AppArmor from enforcement to complain mode did not help, nor did disabling it.

The development package for openssl is libssl-dev (openSUSE: libopenssl-devel). http://packages.debian.org/ helps with that.

Perl packages, named perl-Foo-Bar on openSUSE, are usually named libfoo-bar-perl on Debian.

Packaging system started to complain that packages cannot be verified.

(Cultural Exchange is my long term project of working with Ubuntu instead of openSUSE. TODO: make a permanent index page.)

Jun 28, 2007

YaST User Interface Library Useable From Perl

It has been possible for some time now to write YaST modules in Perl. But to call the UI code you had to use YCP. For the Hack Week I decided to finish Stano's earlier work on the subject and make the UI callable from Perl or any of the soon to be available languages. This is a first step on the way to completely liberate the YaST UI from YCP.

Want to try it out? It works alongside your stock YaST on openSUSE 10.2. Install the binary tarball to /home/martin (really there, the binaries have the path hardwired!)

wget http://www.suse.de/~mvidner/hackweek/yast-ui-from-perl.tar.bz2
sudo sh -c "mkdir /home/martin && bzcat yast-ui-from-perl.tar.bz2 | tar x -C /home/martin"

Here's an example perl script. Note the links to the UI reference.


#! /usr/bin/perl -w
use YaST::YCP qw(:DATA);
YaST::YCP::Import "UI";
YaST::YCP::init_ui ($ARGV[0] || "qt");

my $c = Term("VBox",
Term("Label", "Now we can call YaST UI from other languages!"),
Term("PushButton", "&So What?")
);

UI->OpenDialog($c);
UI->UserInput();
UI->CloseDialog();
Let's try with the stock YaST
sh$ perl /home/martin/pfx/bin/helloui.pm
Nothing happens. If you are interested in the error messages, they are in ~/.y2log

Now let's use the new and improved environment and retry

sh$ /home/martin/pfx/bin/pfxsh
STARTING A NEW SHELL
sh$ perl /home/martin/pfx/bin/helloui.pm

sh$ perl /home/martin/pfx/bin/helloui.pm ncurses


Remember, this is just a preview. It is not packaged properly and has bugs. The source is at svn.opensuse.org.