Can Anyone Compile Mtr Source RPM On CentOS 6.7?

Home » CentOS » Can Anyone Compile Mtr Source RPM On CentOS 6.7?
CentOS 16 Comments

Hi all,

I was trying to rebuild mtr
and I keep getting:

===Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.gu9Ds0
+ umask 022
+ cd /root/rpmbuild/BUILD
+ ‘[‘ /root/rpmbuild/BUILDROOT/mtr-0.75-5.el6.x86_64 ‘!=’ / ‘]’
+ rm -rf /root/rpmbuild/BUILDROOT/mtr-0.75-5.el6.x86_64
++ dirname /root/rpmbuild/BUILDROOT/mtr-0.75-5.el6.x86_64
+ mkdir -p /root/rpmbuild/BUILDROOT
+ mkdir /root/rpmbuild/BUILDROOT/mtr-0.75-5.el6.x86_64
+ cd mtr-0.75
+ export LANG
+ unset DISPLAY
+ rm -rf /root/rpmbuild/BUILDROOT/mtr-0.75-5.el6.x86_64
+ mkdir -p /root/rpmbuild/BUILDROOT/mtr-0.75-5.el6.x86_64//usr/bin
+ mkdir -p /root/rpmbuild/BUILDROOT/mtr-0.75-5.el6.x86_64//usr/sbin
+ mkdir -p /root/rpmbuild/BUILDROOT/mtr-0.75-5.el6.x86_64//usr/share/pixmaps
+ mkdir -p
+ install -m 0755 mtr
+ make DESTDIR=/root/rpmbuild/BUILDROOT/mtr-0.75-5.el6.x86_64 install make: *** No rule to make target `install’. Stop. error: Bad exit status from /var/tmp/rpm-tmp.gu9Ds0 (%install)
I fully admit to not knowing much about Makefiles, so maybe I am missing something obvious. The Makefile is pretty sparce:

# This is an attempt on simplifying the compilation of mtr to a simple


rm -f *.o *~ core

distclean: clean rm -f mtr config.cache config.status config.log \
stamp-h stamp-h[0-9]* TAGS ID
Obviously the mtr package built for CentOS itself, so I have to assume I am doing something dumb.

Thanks for any insight/tips!

16 thoughts on - Can Anyone Compile Mtr Source RPM On CentOS 6.7?

  • I’m not surprised, given that it is in the repo. That’s why I was asking if anyone tried building it themselves and, if so, did they have the same issue as I describe below?

    Alternatively, any tips/advice on solving my build issue would be helpful.


  • 1) please don’t top post

    2) given it builds fine in mock and that’s the best way of providing the clean reproducible environment to build anything perhaps you’d get better feedback and tips (beyond the sensible “use mock”) if you provided details on what you are actually trying to accomplish? Your actual end goal?

  • Am 08.03.2016 um 01:50 schrieb Digimer :

    what says /var/tmp/rpm-tmp.gu9Ds0?

    all dependencies installed?

  • No need to check that …. the error is clear “make: *** No rule to make target `install’. Stop.” … that mini Makefile he posted doesn’t include an install: section

    Of course what the OP is missing is *that* makefile does not get used.

    In the tarball there is a that gets processed into the actual makefile by ./configure (well %configure in the spec but you get the point)

    So we come back round the houses to the key point – Digimer what are you
    *actually* trying to do?

    You obviously aren’t building from the spec in that src.rpm or using mock as those have configure which would generate the valid makefile with the make install target… so what are you doing and what do you want to achieve?

    The %install phase you posted is really not of interest to your ‘problem’
    but rather the %build phase would be telling.

  • As I’ve done with several other RPMs, I did the following;

    ==yumdownloader –source mtr-gtk

    rpm -Uvh mtr-0.75-5.el6.src.rpm

    cd rpmbuild/SPECS/

    # Change “Release”

    rpmbuild -ba mtr.spec
    If you’re asking a more generic “why are you doing this?” question; I am including the RPM in a project we’re working on and I don’t want to risk running fould of the CentOS project by directly redistributing their
    (and RHEL’s) rpms.

  • I’m sure Karanbir and Johnny can weigh in here more but so long as you are not claiming to be CentOS and using their trademarks (see the modified ones with CentOS in the name) I’m pretty certain that you are safe building an appliance on CentOS and can ship the RPMs on that …

    Regardless of that issue what you’ve described above should work (or freak out if a build dependency was missing … unless one isn’t defined as a BuildRequires but is in the default mock root and is causing %configure not to generate the Makefile).

    Again the right answer here is “use mock” …

    yumdownloader –source mtr-gtk

    rpm -Uvh mtr-0.75-5.el6.src.rpm

    cd rpmbuild

    vi SPECS/mtr.spec (change release etc … bear in mind that bumping release may not help you when a CentOS update happens … may not care for an appliance)

    rpmbuild -bs SPECS/mtr.spec

    mock -r epel-6-x86_64 SRPMS/mtr-*.src.rpm

    That will get you a reproducible clean build environment in a way not dependent on the state of your workstation and avoid any accidental depednencies etc popping up

  • Thanks for the help, but I got the same results;

    ===mock /home/digimer/rpmbuild/SRPMS/mtr-0.75-5.el6.anvil.src.rpm

    + make DESTDIR=/builddir/build/BUILDROOT/mtr-0.75-5.el6.anvil.x86_64 install make: *** No rule to make target `install’. Stop.

    RPM build errors:
    error: Bad exit status from /var/tmp/rpm-tmp.8atuER (%install)
    Bad exit status from /var/tmp/rpm-tmp.8atuER (%install)
    Config(epel-6-x86_64) 5 minutes 54 seconds INFO: Results and/or logs in: /var/lib/mock/epel-6-x86_64/result ERROR: Command failed. See logs for output.
    # bash –login -c /usr/bin/rpmbuild -bb –target x86_64 –nodeps
    As for redistribution; I spoke to someone here some months back about creating a custom ISO and I was told I couldn’t modify ‘Packages’, which is what I needed to do. I am also making a RHEL variant, and emailing their legal didn’t get a reply, so I am going this route to not step on toes.

  • What’s odd is how it works in Fedora using mock but not EPEL6 with mock … got to be down to how the build roots are constructed.

    Decided to do a quick test of something given how EPEL has adjusted macros recently to reduce boilerplate between Fedora and itself …

    I just removed the rm -rf line from %clean and got a clean mock build on a CentOS6 base.

    It must have cleaned out the generated makefile between %build and %install and that left it with the bare one that had no install: section

    This will bite Red Hat at the 6.8 milestone (unless they build on Fedora)
    and presumably CentOS when 6.8 rolls round if RH don’t remove the rm -rf from %clean ;)

  • No leave it as is for now …

    I’m really quite confused as after it worked I thought I’d try the original SRPM again and it worked :/

    I have no idea what has changed on the system to provide for that – doing some quick looks now.

  • Okay I have what I believe to be the answer … a rather horrible race condition.

    The generated makefile has a ‘(sleep 3; cp Makefile.dist Makefile) &’ in it for the distclean target.

    The Makefile.dist is the bare empty one.

    Note how this backgrounds ? There is no wait after this …

    So three seconds after the make distclean target is hit *bam* the full Makefile with the install target gets overwritten by the bare one.

    So now whether the build works or not is a function of how fast you make it to make install …. Take longer than 3 seconds after the ./configure and there won’t be a valid Makefile for the install (unless ./configure has rerun already – see how messy this is?)

    This is definitely not a mock bug – that can be closed. It’s a bug in the EL6 mtr spec file.

    See lines 1812 and 4005 for the relevant happenings in the pastebin I put up before showing the behavioural difference between F23 and EPEL6

    Note that my EPEL6 system is a VM so inherently slower… but once the data from disk is in the kernel cache it’s faster on the subsequent builds and makes the race….

    The VM is on a spinning disk (on btrfs) whereas the F23 build happened on an SSD (btrfs but less of an issue then) which would naturally cause the big speed difference.

    I’d open a bug on bugzilla instead against RHEL6 and mtr explaining the race condition.

    I can’t think of a good reason in a spec file to background a 3 second wait and then overwrite a file that will be used in compilation/install …

  • Um, wow. That’s pretty dumb.

    I’ve reassigned the ticket to EL6 -> mtr.

    Thank you very much for your help! I will poke at the .spec and report back here/the ticket if I make any progress (again, I’m fairly new to all this. :) ).