I'm trying to make a rpm package for Mandriva of this nice software on behalf of the MIB (see http://mib.pianetalinux.org\); however I got bite from 2 issues, preventing the build & packaging process to have success.
Both are related to the qmake and make control files, I guess...
The process of preparing a rpm works by preparing a fake "root" directory in a place writable from the user (non root) actually building the package and by instructing the install to use that directory as starting point for the installation path: so, eg, if the fake root is "/home/$user/rpm/BUILDROOT", the main executable will go to "/home/$user/rpm/BUILDROOT/usr/bin", and so on...
However, as the log below shows that:
1) your makefile does not accept / respect the DESTDIR directive to specify where actually install his stuff: Mandriva's build system invokes the install as
"make DESTDIR=/home/xxxxxx/rpm/BUILDROOT/mediadownloader-1.5.1_2-69.1mib2010.2.x86_64 install", but the actual install process still try to put the files in "/usr/bin" and "/usr/share/application"... and fails, because both are not writable from the user actually doing the build;
2) even without the first problem, the "make install" command seems to "forget" about some other files, while they are present in the debian package: all the files in the css and ffmpeg-presets were totally ignored and this will likely lead to a non-working rpm package.
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
Log of a failed build & packaging under mandriva 2010.2 x64_64
To resolve the first issue use
%{__make} INSTALL_ROOT=%{buildroot} install
And DESTDIR would be better.
Thank you for the interest :)
I dont know much about packaging in debian and zero about RPMs :)
For (1) can you try to edit mediadownloader.pro file. At line 123 you will find:
# deployment
unix {
...
}
I would try at first to comment out (or delete) that or modify the directories accordling to mandrivia standards.
Making the debian package I tell to package builder to copy "css" and "ffmpeg-presets" directories to "/etc/mediadownloader". For this I think that (1) is not necessary at last for debian packaging.
I think in .spec file for building rpm, you can put somewhere lines like:
mkdir /etc/mediadownloader
mkdir /etc/mediadownloader/css
mkdir /etc/mediadownloader/ffmpeg-presets
cp ./ffmpeg-presets/* /etc/mediadownloader/ffmpeg-presets
an so on
Please let me know. If you want to contact me in "real time", you can find me on #qt or #meego channels at Freenode irc or maibe just with google chat: lil.deimos at gmail . com
While writing I didnt seen lazy-kent replayed first :)
the irc nick is deimos ;)
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
thank you for your replies...
Re 1)
yes, passing the INSTALL_ROOT option does th trick...
but see below...
Re 2)
Yes, I could even edit the mediadownloader.pro file...
however this will only cover the main point of trouble: ie, that, as is, your installation process (= mediadownloader.pro and the generated makefile) likely cannot work with *any* rpm-based distro (they all work in a similar way AFAIK...) because
* it does not honor the standard "DESTDIR" option to define the path where the files will go, and almost all build scripts for rpm use that option... there is a workaround (thanks lazy-kent!) but it defeat completely the use of a build script (you have to add manually all the relevant build and install options and exclude / replace the right ones);
* it does not install in the "right" (*) place the other needed files (see point 2): modifying the provided .pro file will require a patch out-of-your-tree and the burden to maintain it...
(*) BTW, the "right place" for that type of files, according the Mandriva / Fedora policies, would be "/usr/share/data/mediawonloader"... because in mainwindow.cpp you hard-code the paths you are actually using ("/etc/css" and so on...), then we have another trouble: the need to patch also the actual code to point the relevant paths to the "correct" (for Mandriva and Fedora, obviously...) place.
All considered, perhaps, it's more convenient (and useful for your project IMHO) to address these problems at the source level, by adding the ability to configure dynamically at build time all the things outlined above: this way, you will not only make more easy the life for other packagers for rpm-based distros, but also gain a more wider potential userbase...
Anyway, whatever you will do, if you are interested, I can send you the .spec file I'm working on...
I agree with right place should be "/usr/share/data/mediawonloader".
My spec for openSUSE is there:
https://build.opensuse.org/package/view_file?file=mediadownloader.spec&package=mediadownloader&project=home%3ALazy_Kent&srcmd5=08dc575e4e5e4f22a9b102f639672371
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
Spec file adapted for Mandriva
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
Patch to allow install the css and the ffmpeg preset file in a more standard place
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
> I agree with right place should be "/usr/share/data/mediawonloader".
Well I made a little patch to change mainwindow.cpp accordingly...
I uploaded it with also the spec file I used to actually make the rpm for Mandriva.
Thank you for the spec file for OpenSUSE:
it shows much more dependencies than one can find on the site and on the docs included in the sources, and also that I was forgetting about the icon thing :-) ...
but also it explains well my point:
in your (and in my) spec file you need 11 lines of machinery to place everything in its right place only because the source-provided control files are too simply-coded...
and this is the real reason for my bug report: all are things one can easily work-around, but it's more convenient to have them fixed at the upstream source level, IMHO.
Anyway, thank you for your aid:
now the packages for Mandriva are ready: in the next few days will be online at the MIB repository...
I really would like to make maintainers life easier. How can this problem could be achievied in source code ? I can put a defined variable in the .pro file to set the directory to store css and ffmpeg preset, or a variable could be passed to qmake at compile time. I didnt know about this problem in other linux distros. I accept any suggestions. I can also join http://mib.pianetalinux.org if you want ( I am italian too :)
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
> How can this problem could be achievied in source code ?
> I can put a defined variable in the .pro file to set the directory to store css and ffmpeg preset,
> or a variable could be passed to qmake at compile time.
Well, I don't know so much about qmake options (I'm rather a monkey-packager, you know...),
but I guess you would prefer to use the latter;
qmake should already recognize the DESTDIR variable (see http://doc.qt.nokia.com/latest/qmake-project-files.html\),
so all you need is to find a way to use it in the relevant section of your .pro file (perhaps with a default value of ""...):
ie (according the above doc page...) something as
target.path = $$DESTDIR/usr/bin
icon.files = mediadownloader.png
icon.path = $$DESTDIR//usr/share/pixmaps/
dfile.files = mediadownloader.desktop
dfile.path = $$DESTDIR/usr/share/applications
and so on...
Where at it, I would also:
* add in the relevant section of your .pro file the provision for install also the needed icon file: so the packager will only have to resize it in the other required sizes...
(BTW, the other icon files in the icon dir are needed? If so, they also need to be placed somewhere. Or are they embedded in the main executable?)
* move the css and ffmpeg-presets dirs in a more standard place and change mainwindow.cpp accordingly... this could be another good candidate for a variable to be passed to qmake: this way you could also retain the actual value (/etc) while allowing for a different choice (/usr/share in my case): however I don't know how to actually pass the value variable to the mainwindow.cpp file...
> I can also join http://mib.pianetalinux.org if you want ( I am italian too :)
Se ti va, sei il benvenuto... se poi sei in grado di darci una mano, lo sei il doppio... :-)
Mi ci trovi con il nick di GvM e, fra un giorno o due,
ci dovresti trovare anche l'annuncio del pacchetto nuovo fiammante di mediadownloader per Mandriva 2010.2...
Cheers.
Last edit: Anonymous 2017-08-11
> icon.path = $$DESTDIR//usr/share/pixmaps/
According to freedesktop.org standard icons should be installed in %{_datadir}/icons/hicolor.
http://standards.freedesktop.org/icon-theme-spec/latest/ar01s07.html
Yes, you're right...
wrong cut-and-paste from another source :-)