Re: RPM Stub Package
On Jul 22, 2011, at 10:13 AM, Miller, Vincent (Rick) wrote: Hi Anders, I installed sysutils/file and received an error message indicating that file 5.3 supports only version 7 magic files and that the one installed was version 8. Perhaps this is the reason that RPM 5.2.1 did not install sysutils/file? If there is a version involved, then see if there isn't a way to rebuild the *.mgc files for the distributed rules. Checking … yes here's the file(1) option: -C, --compile Write a magic.mgc output file that contains a pre-parsed version of the magic file or directory. Unless something is seriously different in modern file(1), one can simply remove/rename the *.mgc compiled version and the plain text rules file will be used. Again, if you have a version mismatch in *.mgc, then there are two versions of file(1) floating about, one that has zigged, the other zagged, and that is a distro problem and needs a bug report as Anders suggested. 73 de Jeff [root@bsdsandbox2 /usr/ports/sysutils/file]# find /lib | /usr/local/lib/rpm/bin/rpmdeps --provides error: magic_load(ms, /usr/local/share/file/magic) failed: File 5.3 supports only version 7 magic files. `/usr/local/share/file/magic.mgc' is version 8 Assertion failed: (mg != NULL), function rpmfcClassify, file rpmfc.c, line 1132. Abort trap: 6 (core dumped) == Vincent (Rick) Miller Systems Engineer vmil...@verisign.com t: 703-948-4395 21345 Ridgetop Cir Dulles, VA 20166 VerisignInc.com On 7/22/11 7:47 AM, Anders F Björklund a...@rpm5.org wrote: Miller, Vincent (Rick) wrote: I get an error when I attempt to run rpmdeps. It complains of a missing magic file (see error below). I can't say this surprises me, but I am hoping there is a simple fix, instead of recompiling/installing from ports with different optionsŠ [root@bsdsandbox2 /home/vmiller]# find /lib | /usr/local/lib/rpm/bin/rpmdeps --provides error: magic_load(ms, /usr/local/share/file/magic) failed: could not find any magic files! Assertion failed: (mg != NULL), function rpmfcClassify, file rpmfc.c, line 1132. Abort trap: 6 (core dumped) I think the magic file it needs is /usr/share/misc/magic Thoughts? The archivers/rpm5 port was intended to link against sysutils/file, rather than the system version of libmagic that you ended up with... $ /usr/bin/file --version file-5.03 magic file from /usr/share/misc/magic $ /usr/local/bin/file --version file-5.05 magic file from /usr/local/share/file/magic You should file a Problem Report (PR) against the port, or perhaps just install sysutils/file and rebuild. It should match the library: LIB_DEPENDS= magic:${PORTSDIR}/sysutils/file \ CONFIGURE_ARGS+= --with-path-magic=${LOCALBASE}/share/file/magic --anders __ RPM Package Managerhttp://rpm5.org User Communication List rpm-users@rpm5.org __ RPM Package Managerhttp://rpm5.org User Communication List rpm-users@rpm5.org __ RPM Package Managerhttp://rpm5.org User Communication List rpm-users@rpm5.org
Re: RPM Stub Package
Miller, Vincent (Rick) wrote: Hi Anders, I installed sysutils/file and received an error message indicating that file 5.3 supports only version 7 magic files and that the one installed was version 8. Perhaps this is the reason that RPM 5.2.1 did not install sysutils/file? You'll need to make sure that both the path and the linkage are pointing to the same installation of file/magic. That is, either you need to change the rpm macro (%_rpmfc_magic_path) to point to the system version that the built rpm port has somehow linked to, /or/ you install sysutils/file and rebuild your rpm port to link to /usr/local/lib/libmagic.so.1 instead of /usr/lib/libmagic.so.4. The important part is that the magic file is from the *same* installation of file as the magic library (i.e. same version). The easiest change to packaging might be to include the minor: magic.1:${PORTSDIR}/sysutils/file That way it will always use the ports version instead of system... Installing a static version of file would only add to the problem. But I'm not sure the package really *is* broken ? The one I see links OK to libmagic.so.1, rather than using e.g. libmagic.so.4 ? (which isn't really a big problem in itself, other than that the rpm configuration needs to be updated to match the binaries...) ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8.2-release/Latest/rpm5.tbz $ ldd /usr/local/bin/rpm | grep libmagic.so libmagic.so.1 = /usr/local/lib/libmagic.so.1 (0x80185e000) $ /usr/local/bin/rpm --eval %_rpmfc_magic_path /usr/local/share/file/magic --anders __ RPM Package Managerhttp://rpm5.org User Communication List rpm-users@rpm5.org
Re: RPM Stub Package
On Jul 21, 2011, at 6:59 AM, Miller, Vincent (Rick) wrote: Hi, I've got RPM installed via FreeBSD ports. The next step is to create the stub package which contains all the files that are already installed. The vpkg-provides.sh script does not specifically support FreeBSD. I've considered modifying it to support it. Good. You won't need … all the files .. generally (but you can do that if you wish). RPM uses a database to find Provides: that match Requires:. The stub package is a means to do a database import of certain items. You will almost certainly need Provides: /bin/sh Most other dependencies that are needed are library so names. You can see what will be needed using /usr/lib/rpm/bin/rpmdeps. E.g. here are the provides from /lib/* libraries: find /lib | /usr/lib/rpm/bin/rpmdeps --provides Note that there is a --requires option, and rpmdeps can take files either from stdin, or form the CLI argv list. Building the stub package is little more than capturing output from rpmdeps into a *.spec file used for markup Provides: libc.so.6 which when installed will satisfy dependencies of other packages. (aside) The vpkg generated stub pkg will also generate md5 digests, and has the ability to verify those digests using a %verifyscript, which isn't strictly needed for stubbing out a dependencies, but may be useful. There's other means to verify digests on a file using a probe dependency. E.g. Requires: digest(/path/to/file) = 123456789…. can be added to any @rpm5.org package, and will verify the content digest on that file path. How much of the script will need to be modified to support FreeBSD? Obviously, the case() setting OS defaults would be the first modification necessary, but is there more beyond this that should be modified? Its hard to guess before hand because the hard task isn't modifying the script, but rather identifying all the dependencies will be needed. Simpler than the vpkg script is to supply Provides: dependencies from a file (1 per line please): mkdir -p /etc/rpm/sysinfo echo /bin/sh /etc/rpm/sysinfo/Providename and edit in whatever dependencies you need as found. Its more tedious than hard. But it might help to see what needs to be done before attempting to automate with a script. hth 73 de Jeff == Vincent (Rick) Miller Systems Engineer vmil...@verisign.com t: 703-948-4395 21345 Ridgetop Cir Dulles, VA 20166 VerisignInc.com