[DRE-maint] Bug#1029498: gem2deb should simplify the copy and symlink of assets

Pirate Praveen praveen at onenetbeyond.org
Mon Jan 23 11:52:22 GMT 2023


Package: gem2deb
Severity: wishlist

Currently for many ruby packages (rails engines) that ships a 
javascript asset, we have to manually copy the asset before build and 
replace it with a symlink after install. It'd be nice if gem2deb can 
automate these manual steps with a mapping file. This will create a 
much cleaner rules file and avoid repetition.

How about debian/ruby-foo.assets, which will have relative paths for 
source and destination, an example below

jquery-atwho/jquery.atwho.js 
lib/assets/javascripts/jquery.atwho/jquery.atwho.js

Source can be relative to /usr/share/javascript/ or absolute path and 
destination can be relative to package directory.

Currently in rules I have,

execute_before_dh_auto_build:
 cp /usr/share/javascript/jquery-atwho/jquery.atwho.js 
$(CURDIR)/lib/assets/javascripts/jquery.atwho/jquery.atwho.js
 cp /usr/share/javascript/caret.js/jquery.caret.js 
$(CURDIR)/lib/assets/javascripts/jquery.atwho/jquery.caret.js

execute_after_dh_install:
 debian/symlink-js

and
 cat debian/symlink-js
#!/bin/sh
version=$(dpkg-parsechangelog -S version |cut -d'+' -f1)
ln -sf /usr/share/javascript/jquery-atwho/jquery.atwho.js 
debian/ruby-jquery-atwho-rails/usr/share/rubygems-integration/all/gems/jquery-atwho-rails-${version}/lib/assets/javascripts/jquery.atwho/jquery.atwho.js
ln -sf /usr/share/javascript/caret.js/jquery.caret.js 
debian/ruby-jquery-atwho-rails/usr/share/rubygems-integration/all/gems/jquery-atwho-rails-${version}/lib/assets/javascripts/jquery.atwho/jquery.caret.js



More information about the Pkg-ruby-extras-maintainers mailing list