Showing posts with label perl. Show all posts
Showing posts with label perl. Show all posts

Monday, September 19, 2011

New cpanspec coming soon

I haven't released a new version of cpanspec in quite a while, but I have been working on it off and on with the help of several other people.  The big feature that I added was dependency extraction from tests, but I wasn't happy with the results of it.  Luckily, other people made it better, plus knocked a bunch of stuff off my TODO list.

The current list of changes looks like this:


  • Extract dependencies from tests.
  • Add script detection (patch from Jeff Fearn).
  • Lots and lots of patches from Dennis Kaarsemaker and Gavin Carr:
    • Drop cpanget and add the functionality to cpanspec.
    • Check the search path for rpm, rpmbuild, etc.
    • Add CC0 licence.
    • Change %{optimize} to %{optflags}.
    • Make tarball directory version component optional.
    • Add an option to print the generated specfile to stdout
    • Allow building rpms for slightly older perl versions
    • Check all build requirements against CPAN
    • Stop losing dependency version information for Module::Build, ExtUtils::MakeMaker, etc.
    • Strip any version comparison operator from the 'perl' build requirement
    • Add entries from configure_requres in META.yml as build dependencies
    • Detect scripts better
    • Don't let Module::AutoInstall run interactively
    • Add a simple blacklisting mechanism

In my light testing, this version has been working beautifully, but I'd really like to hear some more positive feedback before I push this out into Fedora, so if you package Perl modules, give it a try and let me know what you think.

Thursday, October 21, 2010

Regular Expressions

Slides from my talk at last night's St. Louis Perl Mongers meeting:

Tuesday, September 28, 2010

String::Random

I mentioned my one module on CPAN (String::Random) to a friend yesterday, and got the response "You wrote that?"  Honestly, I was shocked that he'd heard of it.  (There are so many modules on CPAN that I doubt most Perl programmers have heard of 99% of them.)

I decided to Google for the module a bit to see if there were many mentions (fully expecting to find some "I looked at the code, and my eyes are still bleeding" comments), and I was pleasantly surprised to find this rather old tutorial on using the module: http://www.perlmonks.org/?node_id=88021

I also found a Ruby port on GitHub: http://github.com/repeatedly/ruby-string-random

So far, I haven't found anyone ripping into it, but I'm sure it's out there...

Thursday, April 30, 2009

ldapsync

Very slowly catching up...

A few years ago, I wrote a script that I called ldapsync that compares and synchronizes two LDAP servers. The options are designed to mirror the ones used by OpenLDAP's tools.
Usage:
ldapsync [options]

Options:
--simpleauth -x Use simple authentication (default)
--binddn -D Secify the Distinguished Name to bind to LDAP
--secret -w Specify the password
--secretfile -y Specify a file to read for a password
--ldapuri -H Specify the URI of the LDAP server
--searchbase -b Specify search base
--filter -F Search filter
--scope -s Search scope (base, one, or sub)
--tls -Z[Z] Try StartTLS (use twice to require TLS)
--dryrun -n Show what changes would be made
--help -h Help message
--verbose -v Be more verbose
--debug -d Turn on debugging
So to compare server1 with server2, you might use a command like this:
    ldapsync -n -x -b dc=example,dc=com \
-H ldap://server1 \
-H ldap://server2
Reality is probably a lot more complicated than that, but you get the idea...

Anyway, the script is useful as-is, but it is probably not complete. Maybe it will be useful to someone else...

Saturday, June 21, 2008

Success!

$ rpm -q rakudo parrot
rakudo-0.6.3-1.fc9.x86_64
parrot-0.6.3-1.fc9.x86_64
$ perl6 -e '"Hello".say;'
Hello
$ perl6 -v
This is Rakudo Perl 6, revision 0 built on parrot 0.6.3
for x86_64-linux-thread-multi.

Copyright 2006-2008, The Perl Foundation.

YAPC::NA 2008 round-up

On the first day of YAPC, I gave a talk titled Perl on Fedora.



(Google Docs lost a little formatting in translation, but I've cleaned that up, and I think the results look substantially better than what I actually presented.)

It was the first talk I've given at a conference. I thought it went reasonably well, but I've made a mental note to prepare much further in advance next time, and to learn how to make a presentation that doesn't look lame. (I think I may have a tiny bit of PowerPoint envy.)

On the second day, David Wheeler took some time to talk with me about the Bricolage package I've been working on. It turns out it might actually work as-is, at least for PostgreSQL. I have some work to do to make it work for other databases.

On the third day, I finally got some time to work on my Parrot package. I got it to build with the latest version of Parrot, then broke it to add sub-packages for all the various languages I could figure out how to build. Hopefully Real Soon Now I'll have a rakudo (Perl 6) package, plus packages for a bunch of other random languages like bf.

Monday, May 26, 2008

Packaging Bricolage

I've been very occasionally working the last several years on packaging Bricolage, a CMS written in Perl (and implemented using Mason). Unfortunately, until very recently, Bricolage would only work on Apache 1 (and mod_perl 1). That has (finally) changed with the recent release of Bricolage 1.11.0.

Recently, I've been putting in a lot of time just trying to build a package, and I finally have something that will build and install (source rpm). I don't pretend even for a moment that it will work, but at least it's a start. (It also doesn't make rpmlint at all happy, but I'll get to that...)

At this point, I could really use some help getting the package to work, testing it, etc., so it can be submitted for review.

Saturday, April 12, 2008

imapsync

I'm working on a job today where we might need to use imapsync. I didn't see it in Fedora (or in the package review queue), so I whipped up a package for it (unpacked). I doubt I'll have time to submit it soon, so if anyone wants to run with it, you have my blessing. (Cc me on the bugzilla request so I'm aware of it though, please.)

There are some UTF-8 warnings from rpmlint that need to be fixed. See the comments at the beginning of imapsync.spec.

Monday, March 10, 2008

YAPC::NA 2008 abstract

This talk will cover the current state of Perl development in Fedora (and, by extension, RHEL, CentOS, etc.). Topics will include the following:

  • Status of Perl on Fedora
    • Perl SIG

    • Number of Perl modules available in Fedora and EPEL

    • What we have and what we're missing

    • Licensing

  • Using Perl packages
    • Using virtual rpm dependencies

    • yum, repoquery, etc.

  • Packaging Perl modules
    • Generating packages using cpanspec

    • Building packages with rpmbuild

    • Using mock

    • Checking for problems with rpmlint

    • Submitting packages for inclusion in Fedora

Thursday, January 10, 2008

Goodbye Perl6::Bible. Hello Perl6::Doc.

Ralf and I seem to have discovered independently at nearly the same time that the Perl6::Bible "module" is finally being replaced with Perl6::Doc. I have a perl-Perl6-Doc package sort of ready, but I am not sure what to do about a few things.
  1. Do we bother to obsolete the perl-Perl6-Bible package? I wouldn't be surprised if I was the only person who bothered installing it.
  2. If we obsolete the perl-Perl6-Bible package, should we symlink the p6doc script to p6bible on the off chance that anyone was using the p6bible script?
  3. What do we do about the name conflict with the p6doc script included with Pugs?

Tuesday, December 11, 2007

cpanspec 1.74

I released cpanspec 1.74 this morning. There's some information about it on the Fedora wiki, but the short version is that cpanspec generates spec files (or, optionally, rpms) for Perl packages on CPAN. As an example, you could build a source rpm for String::Random like this:
$ cpanspec -v -s String::Random
Updating /home/steve/.cpan/sources/modules/02packages.details.txt.gz...
Fetching /home/steve/.cpan/sources/modules/02packages.details.txt.gz from http://www.cpan.org/modules/02packages.details.txt.gz...
Fetching String-Random-0.22.tar.gz from http://www.cpan.org/authors/id/S/ST/STEVE/String-Random-0.22.tar.gz...
Trying to fetch description from String-Random-0.22/lib/String/Random.pm...
Writing perl-String-Random.spec...
Building source rpm from perl-String-Random.spec
Wrote: /home/steve/src/fedora/rpms/cpanspec/devel/tmp/perl-String-Random-0.22-1.fc7.src.rpm
Unlike most other automated (or semi-automated) solutions for building spec files for Perl modules, cpanspec actually gets the Summary, License, URL, description, and dependencies (if available) from the CPAN metadata and other sources. In many cases, packages generated with cpanspec are completely done and ready to use (or submit for package review).

Obviously there are a few things cpanspec doesn't handle well. See BUGS and TODO. Patches always welcome. :-)

Thursday, August 2, 2007

More Perl 6 modules

I know it isn't what I'm supposed to be working on, but I happened to be looking through the list of Perl 6-on-Perl 5 modules on CPAN. I ran the list through cpanspec --follow and came up with another 51 packages.

As I have time, I'll go through the pile, clean them up, and start submitting them for review.

Saturday, July 28, 2007

Week in review

Yikes. I seem to have spaced off making any updates this week. Oops.

Earlier this week I updated my pugs package to a svn checkout. It builds fine now, but I still have a ton of rpmlint warnings to address.

In Fedora news, all but one of the packages I submitted last week has been reviewed and approved. I also spent some time working on building my packages for EPEL. That's going to get a lot easier once the Module::Build package's dependencies get worked out.

There's been a lot more progress on the new store. We have permits now, and all the electrical and plumbing in the floor is done. We should have a floor on Tuesday, so either Wednesday or Thursday they should be building walls.

This past Thursday was Emma's 6th birthday. I took her to see the Cardinals/Cubs game. That turned out to be a lot of fun... The Cardinals won 11 to 1, with home runs from Rolen and Pujols and a grand slam from Chris Duncan. Emma seemed to especially enjoy all the fireworks. :-)

Thursday, July 19, 2007

Parrot build failure

Building parrot on x86_64 without any of the tweaks my spec file does still fails "make test", but it doesn't fail as many tests...
Failed Test Stat Wstat Total Fail Failed List of Failed
-------------------------------------------------------------------------------
t/compilers/pge/06-grammar.t 0 11 16 26 162.50% 4-16
6 tests and 581 subtests skipped.
Failed 1/295 test scripts, 99.66% okay. 13/7356 subtests failed, 99.82% okay.

Wednesday, July 18, 2007

Perl 6 microgrant

Apparently I forgot to mention here that I applied for, and was accepted for, one of the Perl 6 Microgrants. I'll be working as much as possible (which, given what's going on with the store, might not be as much as I'd like) on finishing the various Perl 6-related packages for Fedora. I'll be giving regular status updates here, and I've gone back and tagged a couple of old updates appropriately.

By "finish", I mean resolving a few issues (like fixing pugs so it knows about vendor_perl and allows for a arch/noarch split), cleaning up the packages to match the Fedora packaging guidelines and fix anything rpmlint complains about, and actually get the packages accepted in Fedora. Ideally Fedora 8 will support everything Perl 6-related out of the box.

On that note, I tried updating my parrot package tonight at the St. Louis Perl Mongers meeting. The build fails, at least on x86_64.
Failed Test Stat Wstat Total Fail Failed List of Failed
-------------------------------------------------------------------------------
t/compilers/pge/06-grammar.t 0 11 16 26 162.50% 4-16
t/examples/shootout.t 1 256 20 1 5.00% 16
6 tests and 587 subtests skipped.
Failed 2/295 test scripts, 99.32% okay. 14/7356 subtests failed, 99.81% okay.

Monday, July 16, 2007

Pugs hates me

My new notebook is finally running somewhat stably (more on that later), so I took it and got out of the store for a while today to work on my pugs and parrot packages. I lost a bit of time because I didn't have all the necessary development packages installed, and it's a lot slower to install a bunch of packages over the Internet than over a gigabit LAN. Still, eventually I got everything installed on the laptop, and I tried to build pugs. The build failed. To make a long story short, I eventually tried building on my desktop, which built pugs fine a few months ago. It failed there too.

So apparently something in Fedora 7 (likely a newer version of ghc, if I had to guess) breaks pugs. Whee.

I think I may just jump to a svn checkout next to see if that builds.

Package flood

It isn't what I was supposed to be working on today, but I just went through my queue of packages that needed to be submitted for review and did that for most of them. The majority of these are dependencies for Bricolage.
  • 248393 perl-Text-WordDiff - Track changes between documents
  • 248394 perl-Text-LevenshteinXS - XS implementation of the Levenshtein edit distance
  • 248396 perl-Text-Diff-HTML - XHTML format for Text::Diff::Unified
  • 248400 perl-Test-File-Contents - Test routines for examining the contents of files
  • 248403 perl-Test-Class - Easily create test classes in an xUnit/JUnit style
  • 248407 perl-Term-ReadPassword - Asking the user for a password
  • 248410 perl-Params-CallbackRequest - Functional and object-oriented callback architecture
  • 248414 perl-Net-SFTP - Secure File Transfer Protocol client
  • 248425 perl-File-Sync - Perl access to fsync() and sync() function calls
  • 248427 perl-Authen-PAM - Authen::PAM Perl module
  • 248431 perl-Net-FTPServer - Secure, extensible and configurable Perl FTP server
  • 248434 perl-HTTP-DAV - WebDAV client library for Perl5
  • 248451 perl-MasonX-Interp-WithCallbacks - Mason callback support via Params::CallbackRequest
  • 248457 perl-Devel-Profiler - Perl profiler compatible with dprofpp
All this gets me down from 25 packages waiting to only 11, and I may never submit a few of those for various reasons.

Monday, July 9, 2007

Weekend update

I've been working off and on for a month getting my new laptop set up. It's an Asus Z92T that is equipped with a Turion64 X2 TL-64 (2.2GHz dual core), 2GB DDR2/667 RAM, a 160GB IDE hard drive, and a Intel Pro Wireless 2915. It's an odd laptop, since it isn't an old model, but it comes with IDE and Cardbus instead of SATA and ExpressCard. Still, it's reasonably Linux-friendly, and with the evil proprietary NVIDIA drivers installed, it plays Quake 4 at 1280x800 at a completely respectable frame rate.

The laptop runs Fedora 7 fine, except it occasionally seems to lock up. After messing with it a bit, I think I figured out that the network flakes out, and X (possibly as a result of the network going away, but probably not) stops responding. Alt-SysRq-K gets me back to a console though. Now that I've figured all that out, maybe I'll be able to debug what's happening. Then again, I seem to have a ton of updates to install, so maybe everything will just work after that...

On a related note, I was running my linkdups script (functionally the same as the hardlink program that comes with Fedora, but I wrote my script a long time ago, so it's what I use), and I noticed it was chewing through files a little slower than I thought it should on the new laptop. After some debugging, I noticed the script was running /bin/pwd a lot. Obviously that didn't come from my code, so I traced it down to File::Spec::Unix::_cwd(), which seems to get called for every file opened by IO::File (and by extension FileHandle, which is what I was actually using). File::Spec::Unix::_cwd() looks like this:
sub _cwd {
require Cwd;
Cwd::cwd();
}
Cwd::cwd() then runs /bin/pwd for some reason I really don't understand. In any case, changing that to Cwd::getcwd() made a huge improvement in the speed of my linkdups script. The original code would md5sum around 600 files per second. With _cwd() redefined, it was checking almost 3000 files/sec.

I reported this as a bug upstream and with Fedora.

While working with an image of a customer's hard drive, I finally figured out how to handle partitions in a disk image:
losetup /dev/loop0 file
kpartx -a /dev/loop0
After that, the partitions will show up as /dev/mapper/loop0pn. When you are done:
kpartx -d /dev/loop0
losetup -d /dev/loop0
Just make sure the device-mapper-multipath package is installed if you want to try this out.

On the Fedora front, I updated perl-Pugs-Compiler-Rule, amavisd-new, tuxpaint, tuxpaint-stamps, and perl-Test-Base in rawhide over the weekend.

There was probably more, but that's all I can think of at the moment...

Saturday, June 30, 2007

Perl 6 update

I've been working for around a year now on packaging everything Perl 6-related for Fedora. For a while now, everyone has been able to install perl-Perl6-Bible to get the available Perl 6 documentation. I also have been working on packages for Parrot and Pugs. Those packages aren't quite done, but I've submitted them for review so everyone knows I'm working on them.

Friday, June 29, 2007

cpanspec 1.71

I just released cpanspec 1.71. The new version handles bzip2-compressed tar archives, filters out a few more obviously bogus files from %doc, and adds some options to cpanget. From the changelog:
* Add option processing to cpanget.  It now accepts the following options:

-h Print usage message
-n Don't download, only print URLs
-q Work quietly

The other day I had a reason (and honestly I don't remember what it was :-) to get the URL for something on CPAN, and, since the code was there in cpanget anyway... Now you can do this:
$ cpanget -q -n String::Random
String::Random: http://www.cpan.org/authors/id/S/ST/STEVE/String-Random-0.22.tar.gz

For the next version, I want to do the right thing with the new split perl package in F7 and later. I posted a note to fedora-perl-devel-list to get some opinions on how best to handle that.