[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Debigem: .gem -> debian source automatically



Hi Clint,

Clint Byrum escreveu isso aí:
> 
> Hello everyone,
> 
> First let me say I apologize if this work overlaps with previously
> done work. I don't mean to compete with anything else done previously
> at all.
> 
> I had an itch, and I scratched it, and its been fun trying to make
> it go since then.
> 
> I created a tool which I call "DebiGem" that tries to make debian
> source packages out of .gem files directly.
> 
> It can also work from a .gemspec file in a tarball/vcs dir as well.
> 
> The process is pretty simple.. step one is to donwload the .gem
> file
> 
> Then:
> 
> dh-make-gem file.gem
> 
> Which produces a .orig.tar.gz, and an unpacked .gem file with the
> debian directory populated appropriately.

I tried it here on a Debian unstable machine and the package build
failed:

  terceiro@morere:~/src/debigem/test (home)$ dh-make-gem /tmp/fast_gettext-0.5.10.gem 
  Extracting gem file /tmp/fast_gettext-0.5.10.gem
  tar -zcf libfast-gettext-ruby_0.5.10.orig.tar.gz --exclude=libfast-gettext-ruby-0.5.10/debian libfast-gettext-ruby-0.5.10
  changing working dir to libfast-gettext-ruby-0.5.10
  DEBUG: /tmp/fast_gettext-0.5.10.gem.gemspec
  WARNING:  no description specified
  WARNING:  no rubyforge_project specified
    Successfully built Debian source package from gemspec
    Name: fast_gettext
    Version: 0.5.10
    PackageName: libfast_gettext-ruby
  terceiro@morere:~/src/debigem/test (home)$ ls -l
  total 88
  drwxr-xr-x 7 terceiro terceiro  4096 Set 26 18:05 libfast-gettext-ruby-0.5.10
  -rw-r--r-- 1 terceiro terceiro 78984 Set 26 18:05 libfast-gettext-ruby_0.5.10.orig.tar.gz
  terceiro@morere:~/src/debigem/test (home)$ cd libfast-gettext-ruby-0.5.10/
  terceiro@morere:~/src/debigem/test/libfast-gettext-ruby-0.5.10 (home)$ ls -l
  total 48
  drwxr-xr-x 5 terceiro terceiro 4096 Set 26 18:05 benchmark
  -rw-r--r-- 1 terceiro terceiro  439 Set 26 18:05 CHANGELOG
  drwxr-xr-x 2 terceiro terceiro 4096 Set 26 18:05 debian
  drwxr-xr-x 3 terceiro terceiro 4096 Set 26 18:05 examples
  -rw-r--r-- 1 terceiro terceiro 4907 Set 26 18:05 fast_gettext.gemspec
  drwxr-xr-x 3 terceiro terceiro 4096 Set 26 18:05 lib
  -rw-r--r-- 1 terceiro terceiro  910 Set 26 18:05 Rakefile
  -rw-r--r-- 1 terceiro terceiro 7828 Set 26 18:05 README.markdown
  drwxr-xr-x 6 terceiro terceiro 4096 Set 26 18:05 spec
  -rw-r--r-- 1 terceiro terceiro    7 Set 26 18:05 VERSION
  terceiro@morere:~/src/debigem/test/libfast-gettext-ruby-0.5.10 (home)$ 
  terceiro@morere:~/src/debigem/test/libfast-gettext-ruby-0.5.10 (home)$ ls -l
  total 48
  drwxr-xr-x 5 terceiro terceiro 4096 Set 26 18:05 benchmark
  -rw-r--r-- 1 terceiro terceiro  439 Set 26 18:05 CHANGELOG
  drwxr-xr-x 2 terceiro terceiro 4096 Set 26 18:05 debian
  drwxr-xr-x 3 terceiro terceiro 4096 Set 26 18:05 examples
  -rw-r--r-- 1 terceiro terceiro 4907 Set 26 18:05 fast_gettext.gemspec
  drwxr-xr-x 3 terceiro terceiro 4096 Set 26 18:05 lib
  -rw-r--r-- 1 terceiro terceiro  910 Set 26 18:05 Rakefile
  -rw-r--r-- 1 terceiro terceiro 7828 Set 26 18:05 README.markdown
  drwxr-xr-x 6 terceiro terceiro 4096 Set 26 18:05 spec
  -rw-r--r-- 1 terceiro terceiro    7 Set 26 18:05 VERSION
  terceiro@morere:~/src/debigem/test/libfast-gettext-ruby-0.5.10 (home)$ debuild
   dpkg-buildpackage -rfakeroot -D -us -uc
  dpkg-buildpackage: export CFLAGS from dpkg-buildflags (origin: vendor): -g -O2
  dpkg-buildpackage: export CPPFLAGS from dpkg-buildflags (origin: vendor): 
  dpkg-buildpackage: export CXXFLAGS from dpkg-buildflags (origin: vendor): -g -O2
  dpkg-buildpackage: export FFLAGS from dpkg-buildflags (origin: vendor): -g -O2
  dpkg-buildpackage: export LDFLAGS from dpkg-buildflags (origin: vendor): 
  dpkg-buildpackage: source package libfast-gettext-ruby
  dpkg-buildpackage: source version 0.5.10-1
  dpkg-buildpackage: source changed by Antonio Terceiro <terceiro@softwarelivre.org>
   dpkg-source --before-build libfast-gettext-ruby-0.5.10
  dpkg-buildpackage: host architecture i386
   fakeroot debian/rules clean
  dh clean 
     dh_testdir
     dh_auto_clean
     debian/rules override_dh_clean
  make[1]: Entrando no diretório `/home/terceiro/src/debigem/test/libfast-gettext-ruby-0.5.10'
  dh_rubygems clean
  dh_clean
  make[1]: Saindo do diretório `/home/terceiro/src/debigem/test/libfast-gettext-ruby-0.5.10'
   dpkg-source -b libfast-gettext-ruby-0.5.10
  dpkg-source: warning: no source format specified in debian/source/format, see dpkg-source(1)
  dpkg-source: info: using source format `1.0'
  dpkg-source: info: building libfast-gettext-ruby using existing libfast-gettext-ruby_0.5.10.orig.tar.gz
  dpkg-source: info: building libfast-gettext-ruby in libfast-gettext-ruby_0.5.10-1.diff.gz
  dpkg-source: info: building libfast-gettext-ruby in libfast-gettext-ruby_0.5.10-1.dsc
   debian/rules build
  dh build 
     dh_testdir
     dh_auto_configure
     debian/rules override_dh_auto_build
  make[1]: Entrando no diretório `/home/terceiro/src/debigem/test/libfast-gettext-ruby-0.5.10'
  dh_rubygems build
  ERROR:  While executing gem ... (NameError)
      uninitialized constant Gem::Specification::YAML
  /usr/bin/dh_rubygems:113:in `build_gemspec': gem build failed for debian/libfast-gettext-ruby.gemspec (RuntimeError)
    from /usr/bin/dh_rubygems:254
    from /usr/bin/dh_rubygems:92:in `for_each_package'
    from /usr/bin/dh_rubygems:84:in `each'
    from /usr/bin/dh_rubygems:84:in `for_each_package'
    from /usr/bin/dh_rubygems:83:in `each_pair'
    from /usr/bin/dh_rubygems:83:in `for_each_package'
    from /usr/bin/dh_rubygems:254
  make[1]: ** [override_dh_auto_build] Erro 1
  make[1]: Saindo do diretório `/home/terceiro/src/debigem/test/libfast-gettext-ruby-0.5.10'
  make: ** [build] Erro 2
  dpkg-buildpackage: error: debian/rules build gave error exit status 2
  debuild: fatal error at line 1327:
  dpkg-buildpackage -rfakeroot -D -us -uc failed

That's weird, because I didn't find any reference to "YAML" in debigem's source
code.

> It tries to "do the right thing" by creating a 1.8 and a 1.9.1
> package. So far I've been pretty unsuccessful at getting the 1.9.1
> packages to build though, and I suspect it is because of the changes
> in rubygems. So usually I just remove the 1.9.1 stanza from the
> control file.
> 
> For most pure ruby gems, the next step is just simply to cd into
> the dir and run 'debuild' which produces .debs for  libGEMNAME-ruby1.8
> and libGEMNAME-ruby which depends on the former. Dependencies are
> extracted from the gemspec file at build time.
> 
> Updating to new versions is still a little tedious, but not unclear.
> One can simply re-run the process to generate a new orig.tar.gz,
> and then use 'uupdate' from there. Unfortunately, the
> debian/libGEMNAME-ruby.gemspec file that is used during the build
> needs to be manually updated at that time, so you will also need
> to copy that in from the new version's debian directory as well.
> I'm not sure the best way to remind people of that.
> 
> I'm hoping I can get some feedback on it to see what you guys think.
> I just cut the 0.2.0 release today.
> 
> Currently I'm distributing it only as a debian native package,
> though I think long term it would work as a gem itself.

That's great work you did.

I'm not sure, though, whether it's a good thing or bad thing to have
rubygems as a build dependency for all Ruby packages on Debian ...

-- 
Antonio Terceiro <terceiro@softwarelivre.org>
http://softwarelivre.org/terceiro


Attachment: signature.asc
Description: Digital signature


Reply to: