Python Packaging at Kochi Python follow up
Follow up activities for the packaging workshop
Setup aliases and environment variables for packaging: https://wiki.debian.org/Diaspora/Packaging/gem2deb#Setup_your_environment
Steps for packaging Node.js modules: https://wiki.debian.org/Javascript/Nodejs/Npm2Deb
Some node modules available for packaging are listed below. Please reply with your selection.
is-fullwidth-code-point - @suhail
lcid - @renjiththankachan
Balasankar CTue 11 Oct 2016 2:49AM
If you can read Ruby code, please go through the source code of gem2deb also. From my experience, it automates more stuff than npm2deb.
It would be good to know the workflow gem2deb is following too.
Renjith ThankachanWed 12 Oct 2016 4:39AM
@kvsreeram need a standard setup.py file i think :)
[deactivated account]Wed 12 Oct 2016 6:44AM
@sadiq Could you please update dependencies for browserify as well?
Mohammed SadiqWed 12 Oct 2016 7:50AM
Ranjith did not get his wiki account activated. So, I have updated the dependency creation script[0] and the template page[1]. Anyone interested may now help update the dependency wiki pages.
How to run:
1. download the script[0]
2. Install tree and npm: sudo apt install tree npm
3. run ./js_task_create.py module -o out-page
replace 'module' with the 'module' you wish. Eg: grunt
4. The file generated is saved to out-page (you can give any name for output file). Copy the complete file content. Edit the wiki page of the module, and replace the complete text.
Please note that the previous Template was dumb and listed the build dependencies under dependencies. I have fixed the template page. Please update the wiki pages.
Thanks
[0] https://wiki.debian.org/Javascript/Nodejs/Tasks?action=AttachFile&do=view&target=js_task_create.py
[1] https://wiki.debian.org/Javascript/Nodejs/Tasks/Template
Shanavas MWed 12 Oct 2016 8:36AM
Is debian stretch or sid mandatory ?
Is jessie too old to get started ?
Pirate PraveenWed 12 Oct 2016 10:08AM
@shanavasm some tools (like npm2deb, dh-make, licensecheck) will be missing some features, but it is enough to get the concept. If you are willing to search and find workarounds for those issues go ahead. But I suggest you create an lxc container or virtual machine of sid inside jessie for packaging.
Pirate PraveenWed 12 Oct 2016 10:10AM
@suhail since we are not able to reproduce the bug you were working on, we can drop it for now. Can you try packaging string-width?
Pirate PraveenWed 12 Oct 2016 10:15AM
@renjiththankachan can you try packaging lcid?
Renjith ThankachanThu 13 Oct 2016 8:40AM
lxc done the job !
Shanavas MThu 13 Oct 2016 2:02PM
Have created a task page for lcid [1]. Debian package details of invert-kv (dependency of lcid) node-invert-kv (1.0.0-1) is missing from the generated output.
Is is need to be added manually or am I miss something ?
Pirate PraveenFri 14 Oct 2016 8:26AM
@shanavasm you need a task page only if the dependency list is big. Are you running the script from sid?
We can create the dependency tree locally with npm2deb like npm2deb depends -b -r lcid. If there is more than 10 unpackaged dependencies then only we need to create a task page.
Pirate PraveenFri 14 Oct 2016 8:32AM
@shanavasm can you try is-arrayish?
Pirate PraveenFri 14 Oct 2016 8:34AM
@kvsreeram I think it would be better to package one lib before you try pypi2deb so you get a better idea of what you want to achive. Can you try packaging path-exists?
K V Sreeram Fri 14 Oct 2016 8:37AM
Will do from next week on praveenji
Shanavas MSat 15 Oct 2016 7:06AM
@praveenarimbrathod It seems there is a bug in js_task_create.py script. It gets the debian package details from the output of apt-cache madison <package> | grep Source (line no:46). But the Sources entry is included in the output only if there is a deb-src entry in sources.list. So the command should be apt-cache madison <package> | grep Packages. WDYT ?
Balasankar CSat 15 Oct 2016 7:10AM
@shanavasm Haven't gone through code, but will rmadison solve the issue?
Shanavas MSat 15 Oct 2016 7:46AM
@balasankarchelamat rmadison lists details of package for all dists like stable, testing etc... . That makes parsing more complex.
Balasankar CSat 15 Oct 2016 8:00AM
@shanavasm So, you need info about a single distribution. You can use -s flag.
Am on mobile data, so can't look at the code now. What's it you are trying to achieve using the result? To check which version is available on sid?
Shanavas MSat 15 Oct 2016 10:43AM
@balasankarchelamat Yeah, it checks the corresponding debian package for node module.
apt-cache madison <package> | grep Packages fixes the issue. Just want to make sure it doesn't break anything else, so that the script in wiki can be updated.
Shanavas MSat 15 Oct 2016 6:39PM
Have updated js_task_create.py too.
@praveen, I will try is-arrayish
Pirate PraveenSun 16 Oct 2016 6:16AM
@shanavasm use like 'rmadison -s sid node-jison'. You can test it with other packages which don't have utf-8 in description like jison. Submit the patch directly on https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=836182 and may be send a pull request to upstream github repo.
Shanavas MSun 16 Oct 2016 8:05AM
@praveenarimbrathod I have generated package and source files for is-arrayish as described in [1]. Files are at gitlab [2]. What next ?.
Shall I send an ITP ?
[1] https://wiki.debian.org/Javascript/Nodejs/Npm2Deb
[2] https://gitlab.com/shanavasm/debian-packaging/tree/master/is-arrayish
Pirate PraveenSun 16 Oct 2016 10:36AM
@shanavasm You should use gbp import-dsc command to import the package as a git repo. See https://wiki.debian.org/Diaspora/Packaging/gitlab#gbp_import-dsc
Unlike gem2deb, you'll have to download orig.tar.gz, run uupdate, and dpkg-source -b . to get the dsc file.
Go ahead with the ITP.
Pirate PraveenMon 17 Oct 2016 8:15AM
@sadiq I had to run these command in vim to clean the outfile.
1,$g/^node.*$/d
1,$g/^und.*$/d
1,$g/^colo.*$/d
1,$s/)$/) || || ||/
Can you check for packages in NEW and which has ITP bugs? npm2deb search does these already so you can refer its code.
Shanavas MThu 20 Oct 2016 7:20AM
@praveenarimbrathod I have created ITPs for is-arrayish [1] and strip-bom[2]. Repos are at https://gitlab.com/shanavasm/node-is-arrayish and https://gitlab.com/shanavasm/node-strip-bom
[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=841158
[2] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=841391
Shanavas MSun 23 Oct 2016 8:51AM
@praveenarimbrathod Thanks, Done :)
Pirate PraveenTue 25 Oct 2016 11:48AM
@shanavasm Congratulations! Both packages are uploaded to debian! Now it will be reviewed by ftp masters before it is added to debian. They may ask you to change something, usually if you missed any copyright notices.
Also your request to join pkg-javascript on alioth is accepted. So next time, push your packages to alioth. See https://wiki.debian.org/Alioth/SSH for using ssh with alioth.
To create a new git repo you can follow these steps:
ssh git.debian.org
cd /git/pkg-javascript
./setup-repository node-is-arrayish 'Packaging for node-is-arrayish'
You can try is-equal-shallow next. You can take any leaf module from https://wiki.debian.org/Javascript/Nodejs/Tasks/grunt but just let me know before you start working so we don't duplicate work.
Shanavas MTue 25 Oct 2016 2:45PM
@praveenarimbrathod Thanks :):) !!.
I'll try is-equal-shallow next
Shanavas MWed 26 Oct 2016 2:15PM
@praveenarimbrathod
npm2deb create is-equal-shallow throws the following error
Warnings occured:
[error] is-primitive: dependency node-is-primitive not in debian
How to handle dependencies not added to debian ?
SuhailWed 26 Oct 2016 2:42PM
@praveenarimbrathod - same doubt as mentioned above
$ npm2deb create string-width
Warnings occured:
[error] is-fullwidth-code-point: dependency node-is-fullwidth-code-point not in debian
[error] strip-ansi: dependency node-strip-ansi not in debian
$ npm2deb depends -b -r string-width
Dependencies:
NPM
string-width (2.0.0)
├─ is-fullwidth-code-point (2.0.0)
└─ strip-ansi (3.0.0)
└─ ansi-regex (2.0.0)
Pirate PraveenThu 27 Oct 2016 5:02PM
Congratulations @suhail . Your package node-defaults is uploaded to debian.
Pirate PraveenSun 25 Dec 2016 1:33PM
@sadiq @shanavasm @suhail @balasankarchelamat @bhe shall we do another packaging session in Kochi?
K V Sreeram ·Tue 11 Oct 2016 1:11AM
Hi praveen ji,I am currently looking into the source code of npm2deb
https://github.com/LeoIannacone/npm2deb
to try and modify it to the pi to deb format as we had discussed that day.