Blog.YHT.Web.ID

Icon

Bosan adalah awal dari penciptaan perubahan.

Membangun Modul Perl dengan cpan2tgz

Setelah berpindah haluan dari pemrograman web berbasis php, saya menekuni perl. Saya ingin mencoba meningkatkan lagi kemampuan saya dalam pemrograman berbasis sistem, membuat semua yang saya butuhkan berjalan secara otomatis. Sebelumnya saya belajar php untuk mempelajari web dinamis namun akhir-akhir ini saya jenuh dan ingin refreshing dengan mengubah pola pemrograman. Saya sendiri lebih dahulu belajar pemrograman dengan perl daripada dengan php.

Pemrograman berbasis perl memiliki satu keunggulan yang belum dimiliki oleh pemrograman lain, yaitu modul yang lengkap, CPAN. Ya, paling tidak dari segi jumlah modul lebih unggul dari yang lain. Dan pada tulisan ini saya ingin berbagi mudahnya belajar perl dengan aplikasi yang tersedia bagi distro favorit saya, Slackware. Nama aplikasi ini ada cpan2tgz yang dibuat oleh Jason Woodward, yang juga membuat slapt-get.

Kita tidak perlu susah-susah membuat paket sendiri karena paket ini sudah berada di slackbuilds.org, sehingga yang kita perlukan hanya menggunakan aplikasi sbopkg. Mari kita langsung menuju console/terminal.

yht@sl131:~$ su
Password:
root@sl131:/home/yht# sbopkg -g cpan2tgz
Searching for cpan2tgz
Found the following matches for cpan2tgz:
development/cpan2tgz
All done.
root@sl131:/home/yht# sbopkg -i cpan2tgz
Checking GPG signatures. Please be patient…
Checking GPG for cpan2tgz.tar.gz … OK
###########################################
New queue process started on:
Fri Sep 17 21:07:26 WIT 2010
###########################################
+++++++++++++++++++++++++++++++++++++++++++
PACKAGE BUILDING/INSTALLATION PRE-CHECK LOG
Using the SBo repository for Slackware 13.1
Queue Process: Build and install
cpan2tgz:
Checking GPG for cpan2tgz.tar.gz … OK
Processing cpan2tgz 0.6.5-1
Using original .info file
Using original SlackBuild file
No build options selected.
+++++++++++++++++++++++++++++++++++++++++++
Pre-check complete.
Do you wish to proceed based on the search results above? Packages not
found will be skipped during the process.
Press (Y)es to proceed or (N)o to quit.
y
Building cpan2tgz
cpan2tgz:
Checking MD5SUM:
MD5SUM check for cpan2tgz-0.6.5.tar.gz … OK
Building package for cpan2tgz…
cpan2tgz-0.6.5/
cpan2tgz-0.6.5/Changelog
cpan2tgz-0.6.5/MANIFEST
cpan2tgz-0.6.5/COPYING
cpan2tgz-0.6.5/FAQ
cpan2tgz-0.6.5/buildslackpkg.sh
cpan2tgz-0.6.5/Makefile.PL
cpan2tgz-0.6.5/cpan2tgz
cpan2tgz-0.6.5/README
cpan2tgz-0.6.5/MANIFEST.SKIP
Checking if your kit is complete…
Looks good
Writing Makefile for cpan2tgz
cp cpan2tgz blib/script/cpan2tgz
/usr/bin/perl5.10.1 -MExtUtils::MY -e ‘MY->fixin(shift)’ — blib/script/cpan2tgz
Manifying blib/man1/cpan2tgz.1
Manifying blib/man1/cpan2tgz.1
Installing /tmp/SBo/package-cpan2tgz/usr/man/man1/cpan2tgz.1
Installing /tmp/SBo/package-cpan2tgz/usr/bin/cpan2tgz
Appending installation info to /tmp/SBo/package-cpan2tgz/usr/lib/perl5/5.10.1/i486-linux-thread-multi/perllocal.pod
Slackware package maker, version 3.14159.
Searching for symbolic links:
No symbolic links were found, so we won’t make an installation script.
You can make your own later in ./install/doinst.sh and rebuild the
package if you like.
This next step is optional – you can set the directories in your package
to some sane permissions. If any of the directories in your package have
special permissions, then DO NOT reset them here!
Would you like to reset all directory permissions to 755 (drwxr-xr-x) and
directory ownerships to root.root ([y]es, [n]o)? n
Creating Slackware package: /tmp/sbopkg/sbopkg-sbooutputdir/cpan2tgz-0.6.5-noarch-1_SBo.tgz
./
install/
install/slack-desc
usr/
usr/bin/
usr/bin/cpan2tgz
usr/doc/
usr/doc/cpan2tgz-0.6.5/
usr/doc/cpan2tgz-0.6.5/README
usr/doc/cpan2tgz-0.6.5/cpan2tgz.SlackBuild
usr/doc/cpan2tgz-0.6.5/COPYING
usr/doc/cpan2tgz-0.6.5/Changelog
usr/man/
usr/man/man1/
usr/man/man1/cpan2tgz.1.gz
Slackware package /tmp/sbopkg/sbopkg-sbooutputdir/cpan2tgz-0.6.5-noarch-1_SBo.tgz created.
Done building package for cpan2tgz.
Built package: cpan2tgz-0.6.5-noarch-1_SBo.tgz
+==============================================================================
| Installing new package /tmp/sbopkg/sbopkg-sbooutputdir/cpan2tgz-0.6.5-noarch-1_SBo.tgz
+==============================================================================
Verifying package cpan2tgz-0.6.5-noarch-1_SBo.tgz.
Installing package cpan2tgz-0.6.5-noarch-1_SBo.tgz:
PACKAGE DESCRIPTION:
# cpan2tgz (create Slackware packages from CPAN Perl modules)
#
# cpan2tgz is a utility used to create Slackware packages from
# CPAN perl modules.
#
# cpan2tgz was written by Jason Woodward <woodwardj at jaos dot org>
#
# http://software.jaos.org/
#
Package cpan2tgz-0.6.5-noarch-1_SBo.tgz installed.
Done upgrading/installing package.
+++++++++++++++++++++++++++++++++++++++++++
PACKAGE BUILDING/INSTALLATION SUMMARY LOG
Using the SBo repository for Slackware 13.1
Queue Process: Build and install
cpan2tgz:
MD5SUM check for cpan2tgz-0.6.5.tar.gz … OK
Building package cpan2tgz-0.6.5-noarch-1_SBo.tgz … OK
Installing package cpan2tgz-0.6.5-noarch-1_SBo.tgz … OK
+++++++++++++++++++++++++++++++++++++++++++
###########################################
Queue process complete!
###########################################
All done.
root@sl131:/home/yht# ls /var/log/packages/ | grep cpan2tgz
cpan2tgz-0.6.5-noarch-1_SBo
root@sl131:/home/yht# cpan2tgz
Jason Woodward <woodwardj at jaos dot org>
Usage: /usr/bin/cpan2tgz [option(s)] [modules(s)]
–no-recursive do NOT build required modules
–ignoreinstalled rebuild required modules that are already installed
–no-install do NOT install the generated package(s)
–pkgdir location to place the generated package(s)
–nobanner Leave out the cpan2tgz banner in the description
–upgrade-all Create packages (and install) for all outdated modules
–build-tag Specifies the package build tag
–build-number Specifies the package build number
root@sl131:/home/yht#

Dengan ini instalasi selesai. Dan kita akan lanjut untuk mencoba melakukan instalasi modul Term::Pulse.

root@sl131:/home/yht# cpan2tgz Term::Pulse
CPAN: Storable loaded ok (v2.20)
Going to read ‘/home/yht/.cpan/Metadata’
Database was generated on Wed, 01 Sep 2010 06:42:59 GMT
CPAN: LWP::UserAgent loaded ok (v5.835)
CPAN: Time::HiRes loaded ok (v1.9719)
Warning: no success downloading ‘/home/yht/.cpan/sources/authors/01mailrc.txt.gz.tmp6310’. Giving up on it. at /usr/lib/perl5/5.10.1/CPAN/Index.pm line 225
Fetching with LWP:
http://www.perl.org/CPAN/authors/01mailrc.txt.gz
Going to read ‘/home/yht/.cpan/sources/authors/01mailrc.txt.gz’
CPAN: Compress::Zlib loaded ok (v2.02)
………………………………………………………………….DONE
Fetching with LWP:
http://www.perl.org/CPAN/modules/02packages.details.txt.gz
Going to read ‘/home/yht/.cpan/sources/modules/02packages.details.txt.gz’
Database was generated on Fri, 17 Sep 2010 13:38:40 GMT
………………………………………………………………….DONE
Fetching with LWP:
http://www.perl.org/CPAN/modules/03modlist.data.gz
Going to read ‘/home/yht/.cpan/sources/modules/03modlist.data.gz’
………………………………………………………………….DONE
Going to write /home/yht/.cpan/Metadata
CPAN: Data::Dumper loaded ok (v2.124)
‘YAML’ not installed, falling back to Data::Dumper and Storable to read prefs ‘/home/yht/.cpan/prefs’
Fetching with LWP:
http://www.perl.org/CPAN/authors/id/A/AL/ALEC/Term-Pulse-0.03.tar.gz
CPAN: Digest::SHA loaded ok (v5.47)
Fetching with LWP:
http://www.perl.org/CPAN/authors/id/A/AL/ALEC/CHECKSUMS
Checksum for /home/yht/.cpan/sources/authors/id/A/AL/ALEC/Term-Pulse-0.03.tar.gz ok
CPAN: Archive::Tar loaded ok (v1.52)
Term-Pulse-0.03/
Term-Pulse-0.03/inc/
Term-Pulse-0.03/inc/Module/
Term-Pulse-0.03/inc/Module/Install.pm
Term-Pulse-0.03/inc/Module/AutoInstall.pm
Term-Pulse-0.03/inc/Module/Install/
Term-Pulse-0.03/inc/Module/Install/WriteAll.pm
Term-Pulse-0.03/inc/Module/Install/Fetch.pm
Term-Pulse-0.03/inc/Module/Install/Can.pm
Term-Pulse-0.03/inc/Module/Install/Metadata.pm
Term-Pulse-0.03/inc/Module/Install/Base.pm
Term-Pulse-0.03/inc/Module/Install/AutoInstall.pm
Term-Pulse-0.03/inc/Module/Install/Include.pm
Term-Pulse-0.03/inc/Module/Install/Win32.pm
Term-Pulse-0.03/inc/Module/Install/Makefile.pm
Term-Pulse-0.03/t/
Term-Pulse-0.03/t/boilerplate.t
Term-Pulse-0.03/t/pod-coverage.t
Term-Pulse-0.03/t/00-load.t
Term-Pulse-0.03/t/pod.t
Term-Pulse-0.03/META.yml
Term-Pulse-0.03/Changes
Term-Pulse-0.03/MANIFEST
Term-Pulse-0.03/README
Term-Pulse-0.03/lib/
Term-Pulse-0.03/lib/Term/
Term-Pulse-0.03/lib/Term/Pulse.pm
Term-Pulse-0.03/Makefile.PL
Term-Pulse-0.03/examples/
Term-Pulse-0.03/examples/test.pl
CPAN: File::Temp loaded ok (v0.22)
Processing Term::Pulse…
Running make for A/AL/ALEC/Term-Pulse-0.03.tar.gz
CPAN.pm: Going to build A/AL/ALEC/Term-Pulse-0.03.tar.gz
Cannot determine perl version info from lib/Term/Pulse.pm
*** Module::AutoInstall version 1.03
*** Checking for Perl dependencies…
*** Since we’re running under CPAN, I’ll just let it take care
of the dependency’s installation later.
[Core Features]
– Test::More …loaded. (0.92)
*** Module::AutoInstall configuration finished.
Checking if your kit is complete…
Looks good
Writing Makefile for Term::Pulse
Could not read ‘/home/yht/.cpan/build/Term-Pulse-0.03-PJq6Z0/META.yml’. Falling back to other methods to determine prerequisites
cp lib/Term/Pulse.pm blib/lib/Term/Pulse.pm
Manifying blib/man3/Term::Pulse.3
ALEC/Term-Pulse-0.03.tar.gz
/usr/bin/make — OK
Warning (usually harmless): ‘YAML’ not installed, will not store persistent state
Manifying blib/man3/Term::Pulse.3
Installing /tmp/Term::Pulse/usr/lib/perl5/site_perl/5.10.1/Term/Pulse.pm
Installing /tmp/Term::Pulse/usr/share/man/man3/Term::Pulse.3
Appending installation info to /tmp//Term::Pulse/usr/lib/perl5/5.10.1/i486-linux-thread-multi/perllocal.pod
cp: omitting directory `./inc/Module/Install’
Slackware package maker, version 3.14159.
Searching for symbolic links:
No symbolic links were found, so we won’t make an installation script.
You can make your own later in ./install/doinst.sh and rebuild the
package if you like.
This next step is optional – you can set the directories in your package
to some sane permissions. If any of the directories in your package have
special permissions, then DO NOT reset them here!
Would you like to reset all directory permissions to 755 (drwxr-xr-x) and
directory ownerships to root.root ([y]es, [n]o)? n
Creating Slackware package: /usr/src/perl-term-pulse-0.03-noarch-1.tgz
./
install/
install/slack-required
install/slack-desc
install/doinst.sh
usr/
usr/doc/
usr/doc/perl-term-pulse-0.03/
usr/doc/perl-term-pulse-0.03/README
usr/doc/perl-term-pulse-0.03/Metadata.pm
usr/doc/perl-term-pulse-0.03/Base.pm
usr/doc/perl-term-pulse-0.03/Include.pm
usr/doc/perl-term-pulse-0.03/Fetch.pm
usr/doc/perl-term-pulse-0.03/Changes
usr/doc/perl-term-pulse-0.03/Can.pm
usr/doc/perl-term-pulse-0.03/Makefile.pm
usr/doc/perl-term-pulse-0.03/AutoInstall.pm
usr/doc/perl-term-pulse-0.03/Win32.pm
usr/doc/perl-term-pulse-0.03/Install.pm
usr/doc/perl-term-pulse-0.03/WriteAll.pm
usr/lib/
usr/lib/perl5/
usr/lib/perl5/site_perl/
usr/lib/perl5/site_perl/5.10.1/
usr/lib/perl5/site_perl/5.10.1/Term/
usr/lib/perl5/site_perl/5.10.1/Term/Pulse.pm
usr/lib/perl5/site_perl/5.10.1/i486-linux-thread-multi/
usr/lib/perl5/site_perl/5.10.1/i486-linux-thread-multi/auto/
usr/lib/perl5/site_perl/5.10.1/i486-linux-thread-multi/auto/Term/
usr/lib/perl5/site_perl/5.10.1/i486-linux-thread-multi/auto/Term/Pulse/
usr/lib/perl5/site_perl/5.10.1/i486-linux-thread-multi/auto/Term/Pulse/.packlist
usr/lib/perl5/5.10.1/
usr/lib/perl5/5.10.1/i486-linux-thread-multi/
usr/man/
usr/man/man3/
usr/man/man3/Term::Pulse.3.gz
WARNING: site_perl directory detected (this is fine for a local package build)
Slackware package /usr/src/perl-term-pulse-0.03-noarch-1.tgz created.
Verifying package perl-term-pulse-0.03-noarch-1.tgz.
Installing package perl-term-pulse-0.03-noarch-1.tgz:
PACKAGE DESCRIPTION:
# perl-term-pulse 0.03 (Perl module)
#
# Packaged by cpan2tgz
# cpan2tgz by Jason Woodward <woodwardj@jaos.org>
# http://software.jaos.org/
#
Executing install script for perl-term-pulse-0.03-noarch-1.tgz.
Package perl-term-pulse-0.03-noarch-1.tgz installed.
root@sl131:/home/yht#

Ya, hanya semudah itu. Selain itu paket yang berada di /usr/src/ bisa kita gunakan di mesin Slackware yang lain.

Semoga bermanfaat, selamat berkarya denga perl + CPAN…

Kategori: /usr/local/bin

Tag: , , ,

Leave a Reply