submitted by mobicurious 238 days ago (via khertan.net)
For this we will use the new pypackager 3.0. There isn’t currently no graphical interface (but the UI will be available in version 3.1).
This new version of PyPackager is a merge between PyPackager and Py2deb. It s provide the best of the two apps. The creation of debian package and a debian source package with the same parameters.
I will try to explain with a example : Packaging pychecker.
Create a working dir :
mkdir /home/user/MyDocs/pychecker/
Download the source of pychecker in it :
cd /home/user/MyDocs/pychecker/
wget http://sourceforge.net/project/showfiles.php?group_id=24686
Create a original folder :
mkdir original
cd original
Uncompress it :
tar -xvzf ../pychecker-0.8.18.tar.gz
Use dumb setup.py this will install our python libs to a directory instead of root :
python setup.py bdist_dumb
cd ..
Create a src directory :
mkdir src
cd src
tar -xzvf ../original/pychecker-0.8.18/dist/PyChecker-0.8.18.linux-armv7l.tar.gz
cd ..
In the main pychecker folder create the following script :
import pypackager
import os
p=pypackager.PyPackager("pychecker") #package name
p.display_name('PyChecker') #package display name in HAM
p.version = '0.8.18' #package version
p.buildversion == '1' #package build version
p.description="""PyChecker is a tool for finding bugs in python source code.
It finds problems that are typically caught by a compiler for less
dynamic languages, like C and C++. It is similar to lint.
Because of the dynamic nature of python, some warnings
may be incorrect; however, spurious warnings should be fairly infrequent.""" #package description
p.author='Neal Norwitz' #package author
p.maintainer='Khertan' #package maintainer
p.email='khertan@khertan.net' #package maintainer email
p.depends = "python2.5" #package dependancies
p.section="user/development" #package section
p.arch="armel" #package arch
p.urgency="low" #package urgency
p.distribution="fremantle" #package distribution
p.repository="extras-devel" #package repository
p.bugtracker = 'khertan@khertan.net' #bug tracker field (could be a link http://bugs.maemo.org)
p.postinstall="""#!/bin/sh
chmod +x /usr/bin/pychecker""" # A post install script to set +x flag
p.changelog ="""
* First Fremantle Release
""" # the changelog
dir_name='src' #src directory name
#Here we will loop in all files, directory in src to add it to pkg
for root, dirs, files in os.walk(dir_name):
real_dir = root[len(dir_name):]
fake_file = []
for f in files:
fake_file.append(root + os.sep + f + "|" + f)
if len(fake_file) > 0:
p[real_dir] = fake_file
#Generate a package src
print p.generate(build_binary=False,build_src=True)
#Generate a binary src
print p.generate(build_binary=True,build_src=False)
Execute it :
python /home/user/MyDocs/pychecker/make.py
You will got some debug line in the terminal …
And you will get 4 new files in /home/user/MyDocs/pychecker/
The first one is a debian package that you can test now on your device :
pychecker_0.8.18-1_armel.deb
The others are files required for extras assistant
(https://garage.maemo.org/extras-assistant/) to send source package to
the extras-builder :
pychecker_0.8.18-1.changes
pychecker_0.8.18-1.dsc
pychecker_0.8.18-1.tar.gz
Now you can upload your packages to extras-devel repository.
Warning : Currently PyPackager still in developpment, do not hesitate to report me any bugs or problems you got. PyPackager 3.0 is only available in extras-devel and will not be available in extras until there isn’t any graphical interface.
2010-01-12 22:17 UTC with score 3
1 Comments
Comments
|
Add your comment
Please Login or Signup to leave a comment
