Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 21 Nov 2017, 04:24
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
How to make PET packages of NPM, PERL and Python packages?
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [7 Posts]  
Author Message
sc0ttman


Joined: 16 Sep 2009
Posts: 2548
Location: UK

PostPosted: Sun 15 Oct 2017, 14:52    Post subject:  How to make PET packages of NPM, PERL and Python packages?
Subject description: ..would make life easier packaging these things up for others..
 

I have tried using installwatch, new2dir and various other scripts,
as well as parsing various log files, but to no avail.

Haven't tried inotify yet, not sure it's what I need..

I googled around, but can't find what I'm looking for:
A func or script that can package up a CPAN, NPM or PIP module as a .tar.gz..

Basically I would love to be able to do:

Code:
new2dir cpan install <module-name>
new2dir pip install <module-name>
new2dir npm install <module-name>


or

Code:
pip2pet pip install <package-name>

Code:
cpan2pet cpan install <module-name>

Code:
npm2pet npm install <package-name>


.. and others..

Code:
gem2pet gem install <package-name>

...etc...

Can anyone point me in the right direction please?

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
musher0


Joined: 04 Jan 2009
Posts: 11167
Location: Gatineau (Qc), Canada

PostPosted: Sun 15 Oct 2017, 20:57    Post subject:  

Hello sc0ttman.

If I may:

I don't know about the other formats, but the CPAN for perl scripts has to
be one of the best automated installation procedures in the Linux world.

CPAN even has a wonderful update sub-routine that will update
automatically your perl installation on your Puppy when you fetch a new
perl module. (I wish that PPM or even apt-get would be as efficient and
worry free...)

IMO, you do not need to create pet packages for those modules. Simply
explain in length, as best you can, to the user how to install the needed
perl modules, and that should be enough. Perl's CPAN will do the rest.

My 2¢. IHTH.

_________________
musher0
~~~~~~~~~~
"Logical entities must not be multiplied beyond necessity." | |
« Il ne faut pas multiplier les entités logiques sans nécessité. » (Ockham)
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2548
Location: UK

PostPosted: Mon 16 Oct 2017, 17:49    Post subject:  

Quote:
IMO, you do not need to create pet packages for those modules. Simply
explain in length, as best you can, to the user how to install the needed
perl modules, and that should be enough. Perl's CPAN will do the rest.

Not really what I'm asking for but thanks.

Does anyone know how does Woof-CE (or other distro/pkg building stuff) create
native (pet/deb/rpm/txz/etc) packages of the extra CPAN, PIP etc?

dir2pet, new2dir and others fail for me..

Anyone know what can wrap cpan and pip odules up into PET packages?

src2pkg, maybe?
.. would like a lightweight solution if poss..

I'm know I could fill a pinstall.sh script with cpan cmds and make a 'meta' PET
package, but I'm looking for a way to pkg up cpan and pip stuff into PETs,
so that I can add them to a remastered SFS and have them installed at boot....

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
amigo

Joined: 02 Apr 2007
Posts: 2613

PostPosted: Tue 17 Oct 2017, 14:43    Post subject:  

search for 'cpan2tgz' to get a handle on what needs to be done -there is/was also a cpan2rpm out there.

Here's my reference build with src2pkg:

Code:
#!/bin/bash
## src2pkg script for:    perl
## src2pkg Copyright 2005-2010 Gilbert Ashley <amigo@ibilio.org>
#

SOURCE_NAME='perl-5.14.0.tar.xz'
NAME='perl'
VERSION='5.14.0'
# ARCH='${ARCH}'
# BUILD='1'
BUILD=3 # Pass 1 of toolchain rebuild
BUILD=4 # release build
# PRE_FIX='usr'

# Any extra options go here
DOCLIST='AUTHORS README Copying'
ALLOW_EMPTY_FILES="YES"
AUTO_PATCH=NO

# PATCHLIST=''
# STD_FLAGS=''

# Get the functions and configs
. /usr/libexec/src2pkg/FUNCTIONS ;

# do_all_processes can substitute these 16 steps:

pre_process
find_source
make_dirs
unpack_source
fix_source_perms

# configure_source

EXTRA_FLAGS=''
STD_FLAGS="$(echo $OPTIM_FLAGS $MACHINE $TUNE_FLAGS |white_out)"
LIB_PATH="/usr/local/lib${LIBDIRSUFFIX} /usr/lib${LIBDIRSUFFIX} /lib${LIBDIRSUFFIX}"

cd $SRC_DIR;

if [[ "$ARCH" = "x86_64" ]] ; then
  # adapted from "Cross Linux From Scratch"
  # Configure must be told to also use lib64:
  patch -p1 < $CWD/perl.configure.multilib.patch
  # "perl -V" should report that libc is in /lib64
  sed -i -e '/libc/s#/lib/#/lib64/#' hints/linux.sh
  # make perl use lib64:
  echo 'installstyle="lib64/perl5"' >>hints/linux.sh
fi

if [[ "$QUIET" = "YES" ]] ; then
 echo -n $BLUE"Running Configure script - "$NORMAL
 #./Configure $CONFIG_OPTIONS &> /dev/null
  ./Configure -de \
  -Dprefix=/usr \
  -Dcccdlflags='-fPIC' \
  -Dinstallprefix=/usr \
  -Dlibpth="${LIB_PATH}" \
  -Doptimize="${STD_FLAGS}" \
  -Dusethreads -Duseithreads \
  -Dpager='/usr/bin/less -isr' \
  -Dinc_version_list='5.10.0' \
  -Darchname=${ARCH}-linux &> /dev/null
else
 echo $BLUE"Running Configure script - "$NORMAL
 #./Configure $CONFIG_OPTIONS
 ./Configure -de \
  -Dprefix=/usr \
  -Dcccdlflags='-fPIC' \
  -Dinstallprefix=/usr \
  -Dlibpth="${LIB_PATH}" \
  -Doptimize="${STD_FLAGS}" \
  -Dusethreads -Duseithreads \
  -Dpager='/usr/bin/less -isr' \
  -Dinc_version_list='5.10.0' \
  -Darchname=${ARCH}-linux
fi
if [[ $? -eq 0 ]] ; then
 echo $GREEN"Done"$NORMAL
else
 echo $RED"FAILED configuration!"$NORMAL
 exit
fi

# Kludge for gcc-4.2.4's needlessly changed output:
cat makefile | grep -v '\<command-line\>' > makefile.tmp
mv makefile.tmp makefile
cat x2p/makefile | grep -v '\<command-line\>' > makefile.tmp
mv makefile.tmp x2p/makefile

compile_source
fake_install

( cd $PKG_DIR/usr/bin ; ln -sf perl${VERSION} perl )

fix_pkg_perms
strip_bins
create_docs
compress_man_pages
make_description
make_doinst
make_package
post_process

# src2pkg - Copyright 2005-2007  Gilbert Ashley <amigo@ibiblio.org>
## See the documentation for more help and examples. Below are some of
# the most common Extras and Options for easy cut-and-paste use.
# EXTRA_CONFIGS='' PRE_FIX='' DOCLIST=''
# MAKE_COMMAND='' INSTALL_LINE=''
# SHELL_INSTALL='YES' CORRECT_PERMS='NO'


You could also look at this:
http://distro.ibiblio.org/amigolinux/download/Devel/perl-lite-5.8.8/
BTW, don't be fooled that microperl would be smaller than miniperl/perllite microperl is larger and can't load modules.

Here's one more example for perl-html-parser using src2pkg:
Code:
#!/bin/bash
## src2pkg script for:    perl-html-parser
## Auto-generated by src2pkg-2.6
## src2pkg - Copyright 2005-2011 Gilbert Ashley <amigo@ibilio.org>

SOURCE_NAME='HTML-Parser-3.68.tar.gz'
ALT_NAME='perl-html-parser'
VERSION='3.68'   # Use ALT_VERSION to override guessed value
# ARCH=''
# BUILD='1'
# PRE_FIX='usr'
# Any extra options go here:
# EXTRA_CONFIGS=""
INSTALL_FAIL=JAIL
ADD_REQS=perl,perl-html-tagset

# Optional function replaces configure_source, compile_source, fake_install
# To use, uncomment and write/paste CODE between the {} brackets.
# build() { CODE }

# Get the functions and configs
. /usr/libexec/src2pkg/FUNCTIONS ;

# Execute the named packaging steps:
pre_process
find_source
make_dirs
unpack_source
fix_source_perms
configure_source #
compile_source   # If used, the 'build' function replaces these 3
fake_install     #
fix_pkg_perms
strip_bins
create_docs
compress_man_pages
make_description
make_doinst
make_package
post_process


As you can see, no special options are needed if you have the sources -except that you need:
INSTALL_FAIL=JAIL
for nearly all perl modules. What this means is that src2pkg cannot use the 'JAIL' option during fake_install.

Here's a pip2tgz also:
https://slackbuilds.org/repository/14.2/development/pip2tgz/
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2548
Location: UK

PostPosted: Thu 19 Oct 2017, 08:56    Post subject:  

Brilliant, thanks very much Smile
_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
battleshooter


Joined: 14 May 2008
Posts: 1352
Location: Australia

PostPosted: Thu 19 Oct 2017, 10:52    Post subject:  

For those weird ones you can't use DESTDIR on, I use Porg (Paco's successor)
_________________
LMMS 1.0.2, Ardour 3.5.389, Kdenlive 0.9.8
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2548
Location: UK

PostPosted: Thu 19 Oct 2017, 12:52    Post subject:  

Thanks for the info, I never used either of those...

Will have a download .. If I can't find a shell only (dep free) solution, it looks like it would fit perfect..

I'm essentially trying to write some cpan2dir and pip2dir funcs for Pkg which
will reliably download modules, compile them if needed and use something
like INSTALLDIR to put the file generated into a dir... ready to be packaged up..

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [7 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0440s ][ Queries: 12 (0.0043s) ][ GZIP on ]