Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #217 from mariux64/add-init-pythonpackage
scripts: Add script to init bee file for PyPi package
  • Loading branch information
pmenzel committed Jan 20, 2017
2 parents 1eb7de8 + c13f6d8 commit 3727b56
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions scripts/init-pythonpackage
@@ -0,0 +1,51 @@
#! /usr/bin/perl

sub USAGE {
<<"__EOF__";
usage: $0 package version
eg: $0 pyparsing 2.1.10
This only works for pypi ( https://pypi.python.org/pypi ) packages
__EOF__
}

@ARGV==2 or die USAGE;
my ($package,$version)=@ARGV;

$package=lc $package;

my $beefile="python-$package.be0";

my $c=substr($package,0,1);

-e $beefile and die "$beefile: exists\n";

open my $bee,'>',$beefile or die "$beefile: $!\n";
print $bee <<"__EOF__";
#!/bin/env beesh
# BEE_VERSION python-$package-$version-0
# https://pypi.python.org/pypi/$package
SRCURL[0]="https://files.pythonhosted.org/packages/source/$c/$package/$package-$version.tar.gz"
BEE_CONFIGURE=none
build_in_sourcedir
B=\${S}
mee_build() {
python setup.py build
}
mee_install() {
python setup.py install --root=\${D}
}
__EOF__
close $bee;
system 'chmod','+x',$beefile and exit 1;
warn "created $beefile\n";

0 comments on commit 3727b56

Please sign in to comment.