I have a Qt application that I want to deploy as a deb package. I have been reading so many sources, all slightly different - most of what I did follows this How To: preparing an application for submission to the Ubuntu Software Centre
I must create a folder structure in
/usr/share/My Company's Folder/ (The spaces and special characters in the path are an unfortunate requirement; the uppercase names also... the program was ported from windows).
/usr/share/My Company's Folder/MainProject/content
I created a package... and it seems to work, installs in the correct location, and surprisingly the program even works after that.
The Problem: I cannot use space in path names. I created an "install" file as shown in the link above. It does what it is supposed to - but I get a error if I am trying to place items in
/usr/share/My Company's Folder/ - I could only get it to work by using
/usr/share/MyCompanyFolder/ (no spaces or special characters".
~/working_directory mainproject-1.0 mainproject_1 content mainproject-1.0.tar.gz
mainproject-1.0 I ran
dh_make --copyright gpl -f ../mainproject-1.0.tar.gz
select s, press enter... Then I modified the files in the debian folder created.
Created an "install" file in debian folder as well:
mainproject_1/* /usr/share/My Company's Folder/MainProject
dpkg-buildpackage -rfakeroot -email@example.com
It works, creates installer, installer works...
But I cannot make a folder path with spaces, which is what I really need.
"/usr/share/My\ Company\'s\ Folder/" "/usr/share/My Company's Folder/" /usr/share/My\ Company\'s\ Folder/ /usr/share/My\040Company's\040Folder/ /usr/share/My?Company's?Folder/
After much searching I found this info
you can't install files with space with dh_install (= debian/*install files) you have to rename/install them explicitly in debian/rules with install, mv or cp e.g. with dh tiny rules: override_dh_install dh_install install -m 644 "fi le" "debian/tmp/usr/share/fi_le"
So I tried to add in the debian/rules file (showing line numbers)
12 %: 13 dh $@ 14 15 override_dh_install: 16 dh_install 17 install -m 644 "debian/mainproject/usr/share/MyCompanyFolder" "debian/mainproject/usr/share/My Company's Folder"
latest error - with this command:
make: Entering directory `/home/me/working_directory/mainproject-1.0' dh_install install -m 644 "My Company's Folder" "debian/mainproject/usr/share/MyCompanyFolder" install: cannot stat `My Company's Folder': No such file or directory make: *** [override_dh_install] Error 1 make: Leaving directory `/home/me/working_directory/mainproject-1.0' make: *** [binary] Error 2 dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2
12 %: 13 dh $@ 14 15 override_dh_install: 16 dh_install 17 mv -r "debian/mainproject/usr/share/MyCompanyFolder" "debian/mainproject/usr/share/My Company's Folder"
And as result the folder structure inside debian looks correct, but I got errors about invalid folders...
objdump: 'debian/mainproject/usr/share/My': No such file objdump: 'Company's': No such file .....
mkdir then cp should have the same result as mv but unfortunately they kept placing one folder inside the other... * is seen as an actual name...
It really seems like I am getting nowhere.
Update: the answer to my question is, use the mv command in a postinstall file.