Re: [opensuse] checkinstall and opensuse 11.2 - partial solution
- From: "Carlos E. R." <carlos.e.r@xxxxxxxxxxxx>
- Date: Mon, 7 Dec 2009 15:28:39 +0100 (CET)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Sunday, 2009-12-06 at 17:45 +0100, I wrote:
A second problem is that the created spec file and the script set up a
buildroot under /var/tmp/checkinstall.RANDOMNAME/, but the rpmbuild
program instead searches in:
/usr/src/packages/BUILDROOT/package_name_version/
That's the current problem. The hack is to copy the files there in
script mid-run.
Let's see, how easy is to solve this one. I'll explain both problems, using a compilation of package poedit as an example.
On first trial, I get this:
========================= Installation results ===========================
Making install in src
make[1]: Entering directory `/home/cer/Compilaciones/Translators/poedit-1.4.3/src'
Making install in icons
make[2]: Entering directory `/home/cer/Compilaciones/Translators/poedit-1.4.3/src/icons'
make[3]: Entering directory `/home/cer/Compilaciones/Translators/poedit-1.4.3/src/icons'
make[3]: Nothing to be done for `install-exec-am'.
test -z "/usr/local/share/icons/hicolor/16x16/apps" || /bin/mkdir -p
"/usr/local/share/icons/hicolor/16x16/apps"
/bin/mkdir: cannot create directory `/usr/local/share/icons': No such file or directory
make[3]: *** [install-icons16DATA] Error 1
make[3]: Leaving directory `/home/cer/Compilaciones/Translators/poedit-1.4.3/src/icons'
make[2]: *** [install-am] Error 2
make[2]: Leaving directory `/home/cer/Compilaciones/Translators/poedit-1.4.3/src/icons'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/home/cer/Compilaciones/Translators/poedit-1.4.3/src'
make: *** [install-recursive] Error 1
**** Installation failed. Aborting package creation.
The program fails to create some target directories, I have no idea why. I'm not a dev. I lack some knowledge. Bug 432497 is aboth this (please vote for it). There are two hacks:
a) create manually those directories.
b) run make install first, then checkinstall.
c) temporarily install a previously made rpm of this package (uninstall
before installing the new one).
Thus:
bombadillo:/home/cer/Compilaciones/Translators/poedit-1.4.3 # rpm --install /usr/src/packages/RPMS/i386/poedit-1.4.3-1.i386.rpm
and then we find the second problem, which is more complex to locate. We get this:
Building RPM package... FAILED!
*** Failed to build the package
Do you want to see the log file? [y]:
In the log we see:
Building target platforms: i386
Building for target i386
Processing files: poedit-1.4.3-1.i386
error: File not found: /usr/src/packages/BUILDROOT/poedit-1.4.3-1.i386/usr
error: File not found: /usr/src/packages/BUILDROOT/poedit-1.4.3-1.i386/usr/local
....
It is looking for the files it is going to package in "/usr/src/packages/BUILDROOT/poedit-1.4.3-1.i386/", which does not exist.
If in the script "/etc/checkinstallrc" you change, in order to investigate:
# Inspect the file list before creating the package
CK_INSPECT=1
# Review the .spec file before creating a .rpm
REVIEW_SPEC=1
On running, it will open a text editor (vi) with the list of files to package, and the temporary spec file.
Note: if you don't like vi, like me, just create
"/etc/bash.bashrc.local":
export EDITOR=/usr/bin/mcedit
and relogin as root (in the xterm: ctrl-d, su -)
And continue. With the checkinstall changed, we run again the script. When you reach the spec file, we see something of this sort:
Summary: poEdit is cross-platform gettext catalogs (.po files) editor.
Name: poedit
Version: 1.4.3
Release: 1
License: GPL
Packager: checkinstall-1.6.1
Group: Applications/System..........
BuildRoot: /var/tmp/checkinstall.0qISC2/package
Provides: poedit
Requires: ,/bin/sh
Let's see. The summary is taken from the first line of file "description-pak" in the compilation dir, which I created. It is erased on end, so better change this var:
# Automatic deletion of "description-pak"?
DEL_DESC=0
More. The line "Requires" is wrong, you can erase it. It has been bad for years, no idea why. I'm no dev. You can hack the script to comment it out. The important thing now is the line "BuildRoot": what was created went there, not to "/usr/src/packages/BUILDROOT". If you copy one to the other:
/var/tmp/checkinstall.0qISC2/package --> /usr/src/packages/BUILDROOT/poedit-1.4.3-1.i386/
and then you exit the editor, checkinstall creates the rpm just fine.
That is the hack.
The solution I did is this. I edited the script "/usr/sbin/checkinstall" changing this line (make a backup first):
$RPMBUILD -bb ${RPM_TARGET_FLAG}${ARCHITECTURE} "$SPEC_PATH" &> ${TMP_DIR}/rpmbuild.log
with this other:
$RPMBUILD --buildroot $BUILDROOT -bb ${RPM_TARGET_FLAG}${ARCHITECTURE} "$SPEC_PATH" &> ${TMP_DIR}/rpmbuild.log
That is what was broken and was impossible to mend! Was it so difficult? "Broken by design"? Gosh! :-/
(Bug 561317)
Another solution would be to symlink one directory to the other, and remove the link on exit. I don't have the knowledge to decide.
Now that we are at it, change this as well:
cat > "$SPEC_PATH" << EOF
Summary: $SUMMARY
Name: $NAME
Version: $VERSION
Release: $RELEASE
License: $LICENSE
Packager: checkinstall-$CHECKINSTALL_VERSION
Group: $PKG_GROUP
BuildRoot: $BROOTPATH
Provides: $PROVIDES
#Requires: ${REQUIRES}/bin/sh
%description
EOF
cat description-pak >> "$SPEC_PATH"
With the "requires" line commented out.
- -- Cheers,
Carlos E. R.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
iEYEARECAAYFAksdER0ACgkQtTMYHG2NR9U8mQCcD+Yz80HY/VWmqet+yrw2fzuW
3VoAn1nfzCl1o5ykagnPPepI3zwii7kc
=rYCl
-----END PGP SIGNATURE-----
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx
- Follow-Ups:
- Re: [opensuse] checkinstall and opensuse 11.2 - partial solution
- From: Cristian Rodríguez
- Re: [opensuse] checkinstall and opensuse 11.2 - partial solution
- References:
- [opensuse] checkinstall and opensuse 11.2
- From: Teruel de Campo MD
- Re: [opensuse] checkinstall and opensuse 11.2
- From: Carlos E. R.
- [opensuse] checkinstall and opensuse 11.2
- Prev by Date: [opensuse] SuSE firewall questions
- Next by Date: Re: [opensuse] checkinstall and opensuse 11.2
- Previous by thread: Re: [opensuse] checkinstall and opensuse 11.2
- Next by thread: Re: [opensuse] checkinstall and opensuse 11.2 - partial solution
- Index(es):
Relevant Pages
|