Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 141854 - net-analyzer/ifstatus - new ebuild
Summary: net-analyzer/ifstatus - new ebuild
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement
Assignee: Default Assignee for New Packages
URL: http://ifstatus.sourceforge.net/graph...
Whiteboard: [sunrise-overlay]
Keywords: EBUILD, InOverlay
Depends on:
Blocks:
 
Reported: 2006-07-26 23:15 UTC by mikael lammentausta
Modified: 2007-02-03 18:27 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
net-analyzer/ifstatus-1.1.0.ebuild (ifstatus-1.1.0.ebuild,798 bytes, text/plain)
2006-07-29 13:12 UTC, Jose daLuz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mikael lammentausta 2006-07-26 23:15:02 UTC
IFStatus was developed for Linux users that are usually in console mode. It is a simple, easy to use program for displaying commonly needed / wanted statistics in real time about ingoing and outgoing traffic of multiple network interfaces that is usually hard to find, with a simple and effecient view. It is the substitute for PPPStatus and EthStatus projects.
Comment 1 Jose daLuz 2006-07-29 13:12:24 UTC
Created attachment 93019 [details]
net-analyzer/ifstatus-1.1.0.ebuild

Give this a try. I've tested it on both ~x86 and ~amd64, and it seems to build and run fine.

Any devs reading this, I would appreciate if you could look at the pathname munging due to the tarball file name. Is this the proper way to handle it?
Comment 2 Tiziano Müller (RETIRED) gentoo-dev 2006-07-30 11:11:50 UTC
Thanks for the ebuild. I cleaned-it up a bit and submitted it to the Gentoo Sunrise Overlay. You can get the ebuild directly from here (might take a couple of hours until available): http://gentoo-sunrise.org/svn/reviewed/net-analyzers/ifstatus

What I changed:

1)
-MY_PN="${PN}-v"
-MY_P="${MY_PN}${PV}"

This can be simplified since MY_P is only needed in the URL.

2)
+inherit toolchain-funcs

This is needed for $(tc-getCXX) to work, which is needed to make cross-compilation possible.

3)
-RESTRICT="test"
Is not needed.

4)
+DEPEND=">=sys-libs/ncurses-4.2"
+RDEPEND="${DEPEND}"

This is written in the README and can be verified with 'ldd /usr/sbin/ifstatus'

5)
+src_unpack() {
        unpack ${A}
        cd "${S}"

-       # Eliminate custom CFLAGS
-       sed -i -e "6d" Makefile || die "sed failed"
-
-       # Use CXXFLAGS instead of CFLAGS
-       sed -i -e "s:CFLAGS:CXXFLAGS:g" Makefile || die "sed failed"
+       sed -i \
+               -e '/^GCC/d' \
+               -e '/^CFLAGS/d' \
+               -e 's/GCC/CXX/g' \
+               -e 's/CFLAGS/CXXFLAGS/g' \
+               Makefile || die "sed failed"
 }

GCC should not be set explicitly in the ebuild to make cross-compilation work.

6)
 src_compile() {
-       emake || die "Build failed"
+       emake -j1 CXX=$(tc-getCXX) || die "Build failed"
 }

The -j1 is needed because the Makefile isn't thread-safe. CXX has to be set explicitly here for an eventual cross-compilation.

7) 
 src_install() {
-       dobin ifstatus
-       dodoc AUTHORS COPYING README
+       dosbin ifstatus
+       dodoc AUTHORS README
 }

Never install COPYING since we already have the license in /usr/portage/licenses. 'ifstatus' should rather be in /usr/sbin because ifconfig and ip are also there.
Comment 3 Jose daLuz 2006-07-30 11:35:21 UTC
1 - I suspected this could be simplified, which is why I asked.
2, 5,  - cool, now I know.
3 - left over from trying to figure out a problem with the ebuild, I should have eliminated it.
4 - I saw that, but thought it was part of the implicit system deps, and since that version was not available in Portage it didn't need to be here. I stand corrected.
6 - Is there a simple way of determining that, or is it a judgment call based on experience?
7 - Right, missed the COPYING issue. But as for /usr/sbin, this program doesn't require root privileges to run. Should such a program be in a place that is only in root's PATH?
Comment 4 Tiziano Müller (RETIRED) gentoo-dev 2006-07-30 12:06:05 UTC
6. Well, the -j1 can sometimes be hard to tell (see mDNSResponder :-). In this case it was clear: I got the error-message about compilation failure but it still compiled. And when I retried it again, it really failed. After adding -j1 it compiled cleanly everytime. The CXX=... thingy is something you have to know, I figured that one out today myself when I tried to cross-compile one of my ebuilds which has the same situation (no ./configure, just a Makefile). ./configure can figure out if you do cross-compilation.
7. You're right. It would be nice to have it in /usr/bin. I corrected that together with re-adding the ~amd64 keyword.
Comment 5 Jose daLuz 2006-07-31 05:56:41 UTC
Thanks for all the feedback!
Comment 6 Martin Jackson (RETIRED) gentoo-dev 2007-02-03 18:27:10 UTC
Added to main tree.