Fix errors discovered building rpms for 2.062 version
text/plain
865
Comments
Comment #0 by pwil3058 — 2013-01-17T16:55:51Z
Trying to install dmd-2.061-0.fedora.x86_64.rpm on Fedora 18 fails with the following error message:
Transaction Check Error:
file / from install of dmd-2.061-0.x86_64 conflicts with file from package filesystem-3.1-2.fc18.x86_64
file /usr/bin from install of dmd-2.061-0.x86_64 conflicts with file from package filesystem-3.1-2.fc18.x86_64
file /usr/lib from install of dmd-2.061-0.x86_64 conflicts with file from package filesystem-3.1-2.fc18.x86_64
file /usr/lib64 from install of dmd-2.061-0.x86_64 conflicts with file from package filesystem-3.1-2.fc18.x86_64
I believe this is caused by yum/rpm being more fussy about such things and should be fixable by a small change to the spec file used to build the rpm. Basically, don't list directories in %files (only files) unless the directory is exclusive to your package and will be deliberately empty.
I tried using yum's --tolerant switch but the installation still failed.
Comment #1 by pwil3058 — 2013-02-15T21:37:18Z
I'm willing to have a go at fixing this issue. How do I get a copy of the sources including the RPM spec file?
Comment #2 by maxim — 2013-02-15T22:44:07Z
(In reply to comment #1)
> I'm willing to have a go at fixing this issue. How do I get a copy of the
> sources including the RPM spec file?
DMD sources are here http://dlang.org/download.html
But I don't know where is RPM data (I guess nowhere, somebody just uploads ready rpms to dlang.org) and who is preparing release. Perhaps you can found answer at http://forum.dlang.org/
That is indeed the script that builds the rpm.
A first inspection indicates that removal of line 283:
find $TEMPDIR/$DMDDIR/ -type d | sed 's:'$TEMPDIR'/'$DMDDIR':%dir ":' | sed 's:$:":' >> dmd.spec
would fix the problem.
In the meantime, I'm experimenting with "rpmrebuild -e dmd" (and removing the effect of the above line) on a system where I already had dmd installed before I upgraded to Fedora 18 (as judging from that scripts path it's not in the zip tarball).
Comment #5 by pwil3058 — 2013-02-16T18:02:19Z
Unfortunately package rebuilt using rpmrebuild fails to install due to a digest mismatch which I think is a rpmrebuild error.
However, I've now discovered a dmd.spec file at github and notice that the file
https://github.com/D-Programming-Language/installer/blob/master/linux/dmd_rpm.sh
does not appear to exist in the master branch so modifying it would be fruitless.
I will checkout the code from github and see if I can figure out how to build an rpm from that and then try to fix the problem.
Comment #6 by pwil3058 — 2013-02-16T18:15:56Z
Well, that's funny. After logging in to github (rather than being anonymous) I get to see a different set of files (including dmd_rpm.sh albeit in a different directory than that quoted and dmd.spec is no longer there.
Otherwise the plan stays the same.
Comment #7 by pwil3058 — 2013-02-18T16:56:43Z
Created attachment 1191
A patch to add "rpmpkg" sub directory to "installer" repositry at github.
This is a patch to add a new directory (rpmpkg) to the D-Programming-Language/installer repository at github. It provides a mechanism for creating binary rpm packages from the binary package archives (*.pkg.tar.xz) at www.digitalmars.com on any system with rpmbuild and friends installed.
To create i386 and x86_64 binary rpms for the 2.061 release just type:
make
inside the new directory.
Provided there are no radical changes to the base install directories (e.g. /usr/bin, /usr/lib and so on) and /etc/dmd.conf and /etc/bash_completion.d/dmd remain the only configuration files this process should work for other versions/releases by passing the version/release to make e.g.:
make VERSION=2.062 RELEASE=1
would build rpms for version 2.062 release 1 (provided, of course, that the requisite binary package archives are in place at www.digitalmars.com).
Comment #8 by pwil3058 — 2013-02-18T17:02:17Z
the reason for the just uploaded patch (instead of results for modifying dmd_rpm.sh) is that this is the solution I arrived at after being unable to test changes to dmd_rpm.sh due to it only working on debian and my attempts to install on a virtual machine failing (the debian install dvd will not boot).
Comment #9 by pwil3058 — 2013-02-18T21:31:18Z
Created attachment 1192
Fix errors discovered building rpms for 2.062 version
A second patch to fix a bug in the earlier patch and set the default version to version 2.062 release 0.
Comment #10 by pwil3058 — 2013-02-18T21:35:10Z
I've just tried to install the official 2.062 (x86_64) rpm on my Fedora 18 box and it fails with the same messages as in the original bug report.
However, after some bugfixes, the Makefile and dmd.spec files in my first patch build an rpm that installs OK. A patch containing the bugfixes has been uploaded.
Comment #11 by bugzilla — 2013-02-18T21:36:43Z
Thank you. May I ask that you do this as a "pull request" on the github repository?
Comment #12 by pwil3058 — 2013-02-18T22:03:09Z
I'll do that as soon as I figure out how :-)
I'll merge the two patches into one.
In the meantime, it looks like I may be getting a successful debian installation using a different (network) boot iso so I'll (hopefully) be able to check the problem with dmd_rpm.sh.
BTW it looks like whoever is writing the rpm spec files is using outdated documentation as the files no longer have to be as complex as those being defined.
Comment #13 by bugzilla — 2013-02-18T22:04:27Z
It is worth figuring out how. If not just for D, a lot of projects are on github now.
Comment #14 by pwil3058 — 2013-02-19T14:19:16Z
Yes, I know. I'm not a git user as I prefer Mercurial which is similar but with a much better designed user interface. I have books and other documentation for git, however, so I should be able to figure it out.
I'm still having trouble getting Debian going. My latest attempt refused to boot after installation because of a "pointer" error (whatever that is) so I'm trying again. (So far I'm very unimpressed by Debian.)
BTW the rpmsrc directory in installer hasn't been touched for 2 years. Would it be a waste of my time to look at resurrecting it?