Re: [opensuse] checkinstall and opensuse 11.2 - partial solution



-----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



Relevant Pages

  • Re: KB976569 KB979909 KB979906 fail to install
    ... It is the Fix it 50123 part of the package which is failing. ... A script required for this install to complete ...
    (microsoft.public.windowsupdate)
  • Re: [opensuse] Local cache of updates, installed programs in openSUSE
    ... don't have the same package config, I created a "Generic" openSuSE repository ... script to separate all the files by architecture and then upload to the server ... server instead of from the internet. ... but they are a hell of a lot slower to install. ...
    (SuSE)
  • Re: KB976569 KB979909 KB979906 fail to install
    ... I got kb979909 and kb979906 updates installed by registering the Windows ... Registering Windows Script Host got the scripts ... wouldnt install with the same error I described earlier. ... It is the Fix it 50123 part of the package which is failing. ...
    (microsoft.public.windowsupdate)
  • removeltmodem
    ... apt-get it calls a script that failed. ... When I try to apt-get install ... stuff, it tries to remove this package first, and apt-get exits after ...
    (Debian-User)
  • Re: How do a Lite Touch install with a WIM
    ... You could use the OS Deployment Image Installation CD Wizard. ... "Automatically choose the Operating System Package to install by running a ... custom program or script" and select "Allow installation from SMS ...
    (microsoft.public.sms.tools)