Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating a .deb-package on a windows machine #505

Open
majo83 opened this issue Jul 30, 2013 · 4 comments
Open

Creating a .deb-package on a windows machine #505

majo83 opened this issue Jul 30, 2013 · 4 comments

Comments

@majo83
Copy link

majo83 commented Jul 30, 2013

Hey folks,

could be I'm the first to try this out, but building a .deb-package in a windows machine is not possible currently. Is windows supported anyhow? To create .deb-packages, the only underlying tool neccessary would be tar (and maybe gzip), but both could be easily from Msys or UnixUtils I guess.

After looking at the source however and tracing the error messages I think building a .deb unter windows could be achieved pretty easily. Let's assume this command issued from a powershell command (pretty easy: create a .deb-file from a dirtree):
PS> fpm -s dir -t deb -n "testpackage" -v 1.0 root/

I've identified two places in the source code where easy changes could be made. However, as I'm not a ruby developer (I develop in python), I'm somewhat unconfident to do it myself.

First change:
--- deb.rb starting at line number 96 ---

Get the recommended 'tar' command for this platform.

def tar_cmd
# Rely on gnu tar for solaris and OSX.
case %x{uname -s}.chomp
when "SunOS"
return "gtar"
when "Darwin"
return "gnutar"
else
return "tar"
end

end # def tar_cmd

I have a uname installed by UnixUtils, however when fpm executes the above instruction, I get:
PS some_path/ruby-2.0.0-p195-i386-mingw32/lib/ruby/gems/2.0.0/gems/fpm-0.4.37/lib/fpm/package/deb.rb:132:in ``': No such file or directory - uname -m (Errno::ENOENT)

Note: The missing .exe at the end of uname is not the issue, as my sh.exe (also from UnixUtils) should be smart enough to supply that.

Bypassing the above code (by suppling the -a flag, e.g. like this: fpm -s dir -t deb -a i386 -n "testpackage" -v 1.0 root/) I get an exception raised here

--- deb.rb starting at line number 29 ---
# Scan path to find the executable
# Do this to help the user get a better error message.
if !program.include?("/") and !program_in_path?(program)
raise ExecutableNotFound.new(program)

end

Commenting that sanity check out I get an error somewhere in the cildprocess gem of ruby (not your domain anymore, however I think it should be pretty easy to write code to excute independend of the underlying os). So it's just 2 or 3 basic changes to do.

What's your opinion about that?

Best regards,
majo

@r4um
Copy link
Contributor

r4um commented Aug 5, 2013

@majo83 can you try fpm in cygwin.

@jordansissel
Copy link
Owner

fixing the mknod crap should be pretty easy. However, more testing is required to understand what exactly doesn't work under Windows and what we'd need to change in fpm to make it work.

@r4um
Copy link
Contributor

r4um commented Mar 3, 2014

Treatment of file/directory paths comes to mind, on the windows the path separator is \ on unix /. We
should not be hard coding these.

@jordansissel
Copy link
Owner

Agreed. Further, commands like 'tar' and 'ar' don't exist on Windows. You might get them with cygwin, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants