aMule Forum
English => Compilation problems => Topic started by: exalik on January 02, 2007, 11:38:52 AM
-
Hello,
I tried to make a rpm for Mandriva 2007 64 bits but i have the error :
make[3]: entrant dans le répertoire « /home/xxxxxxxx/rpm/BUILD/amule-cvs/docs »
make[3]: Rien à faire pour « install-exec-am ».
test -z "/usr/share/doc/aMule-CVS" || mkdir -p -- "/usr/share/doc/aMule-CVS"
mkdir: ne peut créer le répertoire `/usr/share/doc/aMule-CVS': Permission non accordée
make[3]: *** [install-dist_docDATA] Erreur 1
make[3]: quittant le répertoire « /home/xxxxxxx/rpm/BUILD/amule-cvs/docs »
make[2]: *** [install-am] Erreur 2
make[2]: quittant le répertoire « /home/xxxxxxx/rpm/BUILD/amule-cvs/docs »
make[1]: *** [install-recursive] Erreur 1
make[1]: quittant le répertoire « /home/xxxxxxx/rpm/BUILD/amule-cvs/docs »
make: *** [install-recursive] Erreur 1
erreur: Mauvais status de sortie pour /home/xxxxxxxx/rpm/tmp/rpm-tmp.28348 (%install)
Erreur de construction de RPM:
Mauvais status de sortie pour /home/xxxxxxxx/rpm/tmp/rpm-tmp.28348 (%install)
The building want to create a directory in /usr but just root can do it ! and i build aMule-CVS on my user acount ;-)
What append ? please help me
Thank's
Exalik
PS: I tried it with cvs of 20061225, 20070101, and 20070102
-
Probably my fault, I'll try to fix it ASAP.
It should be $DESTDIR/$docdir and not just $docdir
-
Sorry, no, it's not what I thought and therefore probably not my fault either...
Makefile.in has:
install-dist_docDATA: $(dist_doc_DATA)
@$(NORMAL_INSTALL)
test -z "$(docdir)" || $(mkdir_p) "$(DESTDIR)$(docdir)"
@list='$(dist_doc_DATA)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f=$(am__strip_dir) \
echo " $(dist_docDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(docdir)/$$f'"; \
$(dist_docDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(docdir)/$$f"; \
done
As you can see, DESTDIR is correctly encoded everywhere.
Can you, please try the following:
- Unpack the tarball;
- In aMule.spec and aMule-CVS.spec, replace the line
%makeinstall
with
make DESTDIR="$RPM_BUILD_ROOT" install
- Re-package the tarball;
- Repeat the build with the repackaged tarball
and report back if it helps?
-
Ok it's done !
Thank's
I will try the rpm later ....
Exalik
-
Originally posted by exalik
Ok it's done !
What does this mean? Does it build now? That is, did you get an RPM at the end?
Also, can you please provide the exact output of the following command:
rpm --define 'buildroot /test' --eval %makeinstall
-
$ rpmbuild -ta aMule-CVS-20070103.tar.bz2
...
/usr/bin/install -c -m 644 ./amulecmd.hu.1 /home/myself/redhat/tmp/aMule-CVS-20070103-root-myself/usr/share/man/hu/man1/amulecmd.1
/usr/bin/install -c -m 644 ./amuleweb.hu.1 /home/myself/redhat/tmp/aMule-CVS-20070103-root-myself/usr/share/man/hu/man1/amuleweb.1
/usr/bin/install -c -m 644 ./amuleweb.hu.1 /home/myself/redhat/tmp/aMule-CVS-20070103-root-myself/usr/share/man/hu/man1/amuleweb.1
/usr/bin/install -c -m 644 ./amule.hu.1 /home/myself/redhat/tmp/aMule-CVS-20070103-root-myself/usr/share/man/hu/man1/amule.1
/usr/bin/install -c -m 644 ./ed2k.hu.1 /home/myself/redhat/tmp/aMule-CVS-20070103-root-myself/usr/share/man/hu/man1/ed2k.1
make[4]: Leaving directory `/home/myself/redhat/BUILD/amule-cvs/docs/man'
make[3]: Leaving directory `/home/myself/redhat/BUILD/amule-cvs/docs/man'
make[2]: Leaving directory `/home/myself/redhat/BUILD/amule-cvs/docs/man'
make[2]: Entering directory `/home/myself/redhat/BUILD/amule-cvs/docs'
make[3]: Entering directory `/home/myself/redhat/BUILD/amule-cvs/docs'
make[3]: Nothing to be done for `install-exec-am'.
test -z "/usr/share/doc/aMule-CVS" || mkdir -p -- "/usr/share/doc/aMule-CVS"
mkdir: cannot create directory `/usr/share/doc/aMule-CVS': Permission denied
make[3]: *** [install-dist_docDATA] Error 1
make[3]: Leaving directory `/home/myself/redhat/BUILD/amule-cvs/docs'
make[2]: *** [install-am] Error 2
make[2]: Leaving directory `/home/myself/redhat/BUILD/amule-cvs/docs'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/home/myself/redhat/BUILD/amule-cvs/docs'
make: *** [install-recursive] Error 1
error: Bad exit status from /home/myself/redhat/tmp/rpm-tmp.4460 (%install)
RPM build errors:
Bad exit status from /home/myself/redhat/tmp/rpm-tmp.4460 (%install)
Just one question, how do I make sure I am using the right .spec file? The tarball has two specs. I think I am using aMule-CVS.spec. Maybe rpmbuild chooses from the tar file name?
$ rpm --define 'buildroot /test' --eval %makeinstall
/usr/bin/make \
prefix=/test/usr \
exec_prefix=/test/usr \
bindir=/test/usr/bin \
sbindir=/test/usr/sbin \
sysconfdir=/test/etc \
datadir=/test/usr/share \
includedir=/test/usr/include \
libdir=/test/usr/lib \
libexecdir=/test/usr/libexec \
localstatedir=/test/var \
sharedstatedir=/test/usr/com \
mandir=/test/usr/share/man \
infodir=/test/usr/share/info \
install
-
Thanks, phoenix. That explains why it works for me on openSUSE, but not on Fedora and Mandriva because openSUSE defines %makeinstall differently:
$ rpm --define 'buildroot /test' --eval %makeinstall
make DESTDIR=/test install
The issue here is that DESTDIR should be used, but it is not used because of the way how %makeinstall is defined on Fedora and Mandriva. %makeinstall is actually deprecated and discouraged because it's wrong (and that's probably why openSUSE changed the definition), see http://fedoraproject.org/wiki/Packaging/Guidelines#head-fcaf3e6fcbd51194a5d0dbcfbdd2fcb7791dd002
I'd suggest to fix it by doing exactly what the Fedora packaging guidelines recommend, i.e.:
Instead, Fedora packages should use: make DESTDIR=%{buildroot} install or make DESTDIR=$RPM_BUILD_ROOT install
PS: rpm uses a shell glob and picks the first .spec file it can find. It does something equivalent to
ls -1 *.spec | head -1
That's why it's very important to not distribute aMule-CVS.spec in release tarballs.
-
Originally posted by Gerd78
Originally posted by exalik
Ok it's done !
What does this mean? Does it build now? That is, did you get an RPM at the end?
Also, can you please provide the exact output of the following command:
rpm --define 'buildroot /test' --eval %makeinstall
Yes i had a rpm and i have installed it but this cvs crash during ipfilter file downloading ...
Thank's
Exalik
-
The ipfilter crash is already known (and unrelated to this problem).
The rpm build failure is solved (I know what's going on, the patch above fixes it and should be committed to SVN).
Just for the records, explaining what's going on here. The Makefile generated by automake looks similar to this (simplified):
prefix = /usr
bindir = $(prefix)/bin
install: amule
mkdir -p $(DESTDIR)$(bindir)
cp amule $(DESTDIR)$(bindir)
This example means that running "make install" will copy amule to /usr/bin, but this is undesirable while building packages. Building packages must work without root privileges.
This is solved by using a so-called "build root", installing files to /var/tmp/amule-build/usr instead of /usr. This can be implemented in basically 2 ways:
(1) Redefine prefix = /usr to prefix = /var/tmp/amule-build/usr by running "make install prefix=$RPM_BUILD_ROOT/usr".
(2) Define DESTDIR (empty string by default) to point to the build root.
What %makeinstall does is identical to (1). The reason why it doesn't work is that redefining prefix is not enough, you have to redefine bindir, libdir, datadir etc. as well. %makeinstall does that for a lot of variables, but it misses docdir => Problem.
The much better, "official" way is (2), using DESTDIR. That's what DESTDIR has been created for: See http://www.gnu.org/prep/standards/html_node/DESTDIR.html. It should by used.
Investigating further, the %makeinstall rpm macro was meant to be used only with Makefiles that don't support DESTDIR at all. But aMule supports it perfectly fine => It's wrong that we're using %makeinstall!
-
Gerd78,
Great explanation :baby:, thank you very much!
Patch is applied and tomorrow cvs tarball will include it.
PS: rpm uses a shell glob and picks the first .spec file it can find. It does something equivalent to
ls -1 *.spec | head -1
That's why it's very important to not distribute aMule-CVS.spec in release tarballs.
Then, we are lucky that it picks up the right spec, because due to the restriction of not having a public svn repository, tarballs are our public repository and should contain all files in svn. And you are totally right, release tarballs are another story and should not have aMule-CVS.spec in it. One more reason for "make dist" to be properly working ;)
Cheers!
-
Just one question, how do I make sure I am using the right .spec file? The tarball has two specs. I think I am using aMule-CVS.spec. Maybe rpmbuild chooses from the tar file name?
By my side, I unpacked .spec file I want to use (I use same specs from the beginning) place it in your own directory (I put it in SPECS dir, under rpm -mandriva directory standard for build rpm as user-) and then call rpmbuild from rpm dir like this:
$rpmbuild -bb SPECS/aMule-CVS-20071212.spec
please place your .tar.bz2 files in SOURCES dir after doing rpmbuild. You never need take care what .spec are into tarball, you always use your (custom) .spec
I don't know if it helps you, thanks Gerd78 for your make DESDIR :) it make me a big headache