Help creating a deb package with custom wav and png files

Asked by xcxcx112

Hello,

I have a source package and would like to create a deb package.

The problem is:
I have 2 files *wav and *.png inside the "debian" folder that i would like to use, when i run dpkg-buildpackage to compile, it fails because these files are binary.
Is there a way or program to convert these files to the text/hex based, so that i can successful compile?

Of course, i can move these files into the source folder outside the debian folder, then do compile. It works, but i don't want to touch anything on the original source.
Thanks

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
xcxcx112
Solved:
Last query:
Last reply:
Revision history for this message
Cesare Tirabassi (norsetto) said :
#1

Have you consulted the (outdated and basic I know) ubuntu packaging guide?
See here:

http://doc.ubuntu.com/ubuntu/packagingguide/C/index.html

You don't actually build the binaries yourself, the build is done after a MOTU (sponsor) upload your source package.
In your "rules" files you have to take care about the correct placement of the .wav and .png during package installation (with an install, cp or whatever command you want to use).

Revision history for this message
xcxcx112 (xcxcx112) said :
#2

thank you for you help
yes, i know the basic packaging guide and have built packages for myself.
actually i build packages not for public, but for private and friends. Furthermore, i would like to know the method to include binary files like wav and png without to touch on the source. It is just for my information to learn and extend my knowledge, not that i send files to the sponsor yet and leave him build them for me.
actually, the "rules" files are not the big problem for me, but the method to compiling binary contained packages as i said.
I guess, the png can be converted to the text-based xpm using imagesmagic, but what is with the wav?

Revision history for this message
Cesare Tirabassi (norsetto) said :
#3

So, the problem is that the diff cannot be made on binary files?
Would dpkg-buildpackage -B or dpkg-deb --build work?

I have the impression you are not using the right tool for the job, but feel free to drop a line in irc channel #ubuntu-motu, the good chaps there might have a solution for you.

Revision history for this message
xcxcx112 (xcxcx112) said :
#4

as i said above, the problem is that debian building policy does not allow to add directly binary files in the debian building folder. To be able to compille, these files have to be pre-converted first to the text or hex based files like all those files dpatch, rules, changelog etc... To explain better my issues , you can test it by yourself:

1. please download any package of your choice to test: .dsc, .diff.gz, .orig.tar.gz in:
http://packages.ubuntu.com
2. run dpkg-source -x <package>-<version>.dsc
3a. Now you can run dpkg-buildpackage -rfakeroot to rebuild the package => successfull, no problem (muss)
3b. but, put an binary file (png or wav) into the debian folder and also run dpkg-buildpackage -rfakeroot for another test => please, let me know your result here, and how you got it to compile?

Revision history for this message
Cesare Tirabassi (norsetto) said :
#5

Let me repeat.
It is not a question of policy or build or compilation. The problem is simply that you cannot make a *.dsc file as you cannot make a diff of a binary file.
Have you thought about using uuencode or better yet MIME to convert your binary files to ASCII for inclusion in your debian directory?

Revision history for this message
xcxcx112 (xcxcx112) said :
#6

> Have you thought about using uuencode or better yet MIME to convert your binary files to ASCII for inclusion in your debian directory?
this was exactly the point of my question why ask here for the method or program to convert binary to text/ASCII or hex. Hope i will not be repeating it again ;) If you know it please let me know, thanks.

Revision history for this message
xcxcx112 (xcxcx112) said :
#7

As you point to the method using unencode or MIME, how can i do it or with which program?

Revision history for this message
Cesare Tirabassi (norsetto) said :
#8

You can find quite a lot of utilities in the Ubuntu repositories. For instance, you can search using the Synaptic Package Manager (Menu->System->Administration->Synaptic Package Manager) for the string "uuencode" or "MIME".
For uuencode I found a nice utility package: sharutil (sudo apt-get install sharutil) which look suitable for your purpose.

Good luck.

Revision history for this message
Best xcxcx112 (xcxcx112) said :
#9

I will try your suggestions later. Thank you for your help!
And good look you too, Thanks