Commit ecb55c3f authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

added a rewritten recipe for net-tools

parent e3ca079d
#
# Makefile Main Makefile for the net-tools Package
#
# NET-TOOLS A collection of programs that form the base set of the
# NET-3 Networking Distribution for the LINUX operating
# system.
#
# Version: 2001-02-13
#
# Author: Bernd Eckenfels <net-tools@lina.inka.de>
# Copyright 1995-1996 Bernd Eckenfels, Germany
#
# URLs: ftp://ftp.inka.de/pub/comp/Linux/networking/NetTools/
# ftp://ftp.linux.org.uk/pub/linux/Networking/PROGRAMS/NetTools/
# http://www.inka.de/sites/lina/linux/NetTools/index_en.html
#
# Based on: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
# Copyright 1988-1993 MicroWalt Corporation
#
# Modifications:
# Extensively modified from 01/21/94 onwards by
# Alan Cox <A.Cox@swansea.ac.uk>
# Copyright 1993-1994 Swansea University Computer Society
#
# Be careful!
# This Makefile doesn't describe complete dependencies for all include files.
# If you change include files you might need to do make clean.
#
# {1.20} Bernd Eckenfels: Even more modifications for the new
# package layout
# {1.21} Bernd Eckenfels: Check if config.in is newer than
# config.status
# {1.22} Bernd Eckenfels: Include ypdomainname and nisdomainame
#
# 1.3.50-BETA6 private Release
#
#960125 {1.23} Bernd Eckenfels: Peter Tobias' rewrite for
# makefile-based installation
# 1.3.50-BETA6a private Release
#
#960201 {1.24} Bernd Eckenfels: net-features.h added
#
#960201 1.3.50-BETA6b private Release
#
#960203 1.3.50-BETA6c private Release
#
#960204 1.3.50-BETA6d private Release
#
#960204 {1.25} Bernd Eckenfels: DISTRIBUTION added
#
#960205 1.3.50-BETA6e private Release
#
#960206 {1.26} Bernd Eckenfels: afrt.o removed (cleaner solution)
#
#960215 1.3.50-BETA6f Release
#
#960216 {1.30} Bernd Eckenfels: net-lib support
#960322 {1.31} Bernd Eckenfels: moveable netlib, TOPDIR
#960424 {1.32} Bernd Eckenfels: included the URLs in the Comment
#
#960514 1.31-alpha release
#
#960518 {1.33} Bernd Eckenfels: -I/usr/src/linux/include comment added
#
# This program is free software; you can redistribute it
# and/or modify it under the terms of the GNU General
# Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# set the base of the Installation
# BASEDIR = /mnt
# path to the net-lib support library. Default: lib
NET_LIB_PATH = lib
NET_LIB_NAME = net-tools
PROGS := ifconfig hostname arp netstat route rarp slattach plipconfig nameif
-include config.make
ifeq ($(HAVE_IP_TOOLS),1)
PROGS += iptunnel ipmaddr
endif
ifeq ($(HAVE_MII),1)
PROGS += mii-tool
endif
ifeq ($(HAVE_MII_DIAG),1)
PROGS += mii-diag
endif
# Compiler and Linker Options
# You may need to uncomment and edit these if you are using libc5 and IPv6.
COPTS = -D_GNU_SOURCE -O2 -Wall -g # -I/usr/inet6/include
ifeq ($(origin LOPTS), undefined)
LOPTS =
endif
RESLIB = # -L/usr/inet6/lib -linet6
ifeq ($(HAVE_AFDECnet),1)
DNLIB = -ldnet
endif
# -------- end of user definitions --------
MAINTAINER = Philip.Blundell@pobox.com
RELEASE = 1.60
.EXPORT_ALL_VARIABLES:
ifeq ("$(NET_LIB_PATH)","lib2")
TOPDIR = ..
else
TOPDIR := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
endif
NET_LIB = $(NET_LIB_PATH)/lib$(NET_LIB_NAME).a
CFLAGS = $(COPTS) -I. -idirafter ./include/ -I$(NET_LIB_PATH)
LDFLAGS = $(LOPTS) -L$(NET_LIB_PATH)
SUBDIRS = man/ $(NET_LIB_PATH)/
ifeq ($(origin CC), undefined)
CC = gcc
endif
LD = $(CC)
NLIB = -l$(NET_LIB_NAME)
MDEFINES = COPTS='$(COPTS)' LOPTS='$(LOPTS)' TOPDIR='$(TOPDIR)'
%.o: %.c config.h version.h intl.h net-features.h $<
$(CC) $(CFLAGS) -c $<
all: config.h version.h subdirs $(PROGS)
config: cleanconfig config.h
install: all savebin installbin installdata
update: all installbin installdata
mostlyclean:
rm -f *.o DEADJOE config.new *~ *.orig lib/*.o
clean: mostlyclean
rm -f $(PROGS)
@for i in $(SUBDIRS); do (cd $$i && $(MAKE) clean) ; done
@cd po && $(MAKE) clean
cleanconfig:
rm -f config.h
clobber: clean
rm -f $(PROGS) config.h version.h config.status config.make
@for i in $(SUBDIRS); do (cd $$i && $(MAKE) clobber) ; done
dist: clobber
@echo Creating net-tools-$(RELEASE) in ..
@tar -cvz -f ../net-tools-$(RELEASE).tar.gz -C .. net-tools
config.h: config.in Makefile
@echo "Configuring the Linux net-tools (NET-3 Base Utilities)..." ; echo
@if [ config.status -nt config.in ]; \
then ./configure.sh config.status; \
else ./configure.sh config.in; \
fi
version.h: Makefile
@echo "#define RELEASE \"net-tools $(RELEASE)\"" >version.h
$(NET_LIB): config.h version.h intl.h libdir
i18n.h: i18ndir
libdir:
@$(MAKE) -C $(NET_LIB_PATH) $(MDEFINES)
i18ndir:
@$(MAKE) -C po
subdirs:
@for i in $(SUBDIRS); do $(MAKE) -C $$i $(MDEFINES) ; done
ifconfig: $(NET_LIB) ifconfig.o
$(CC) $(LDFLAGS) -o ifconfig ifconfig.o $(NLIB) $(RESLIB)
nameif: nameif.o
$(CC) $(LDFLAGS) -o nameif nameif.o
hostname: hostname.o
$(CC) $(LDFLAGS) -o hostname hostname.o $(DNLIB)
route: $(NET_LIB) route.o
$(CC) $(LDFLAGS) -o route route.o $(NLIB) $(RESLIB)
arp: $(NET_LIB) arp.o
$(CC) $(LDFLAGS) -o arp arp.o $(NLIB) $(RESLIB)
rarp: $(NET_LIB) rarp.o
$(CC) $(LDFLAGS) -o rarp rarp.o $(NLIB)
slattach: $(NET_LIB) slattach.o
$(CC) $(LDFLAGS) -o slattach slattach.o $(NLIB)
plipconfig: $(NET_LIB) plipconfig.o
$(CC) $(LDFLAGS) -o plipconfig plipconfig.o $(NLIB)
netstat: $(NET_LIB) netstat.o statistics.o
$(CC) $(LDFLAGS) -o netstat netstat.o statistics.o $(NLIB) $(RESLIB)
iptunnel: $(NET_LIB) iptunnel.o
$(CC) $(LDFLAGS) -o iptunnel iptunnel.o $(NLIB) $(RESLIB)
ipmaddr: $(NET_LIB) ipmaddr.o
$(CC) $(LDFLAGS) -o ipmaddr ipmaddr.o $(NLIB) $(RESLIB)
mii-tool: mii-tool.o
$(CC) $(LDFLAGS) -o mii-tool mii-tool.o
mii-diag: libmii.o mii-diag.o
$(CC) $(LDFLAGS) -o mii-diag libmii.o mii-diag.o
installbin:
install -m 0755 -d ${BASEDIR}/sbin
install -m 0755 -d ${BASEDIR}/bin
install -m 0755 arp ${BASEDIR}/sbin
install -m 0755 hostname ${BASEDIR}/bin
install -m 0755 ifconfig ${BASEDIR}/sbin
install -m 0755 nameif ${BASEDIR}/sbin
install -m 0755 netstat ${BASEDIR}/bin
install -m 0755 plipconfig $(BASEDIR)/sbin
install -m 0755 rarp ${BASEDIR}/sbin
install -m 0755 route ${BASEDIR}/sbin
install -m 0755 slattach $(BASEDIR)/sbin
ifeq ($(HAVE_IP_TOOLS),1)
install -m 0755 ipmaddr $(BASEDIR)/sbin
install -m 0755 iptunnel $(BASEDIR)/sbin
endif
ifeq ($(HAVE_MII),1)
install -m 0755 mii-tool $(BASEDIR)/sbin
endif
ifeq ($(HAVE_MII_DIAG),1)
install -m 0755 mii-diag $(BASEDIR)/sbin
endif
ln -fs hostname $(BASEDIR)/bin/dnsdomainname
ln -fs hostname $(BASEDIR)/bin/ypdomainname
ln -fs hostname $(BASEDIR)/bin/nisdomainname
ln -fs hostname $(BASEDIR)/bin/domainname
ifeq ($(HAVE_AFDECnet),1)
ln -fs hostname $(BASEDIR)/bin/nodename
endif
savebin:
@for i in ${BASEDIR}/sbin/arp ${BASEDIR}/sbin/ifconfig \
${BASEDIR}/bin/netstat \
${BASEDIR}/sbin/rarp ${BASEDIR}/sbin/route \
${BASEDIR}/bin/hostname ${BASEDIR}/bin/ypdomainname \
${BASEDIR}/bin/dnsdomainname ${BASEDIR}/bin/nisdomainname \
${BASEDIR}/bin/domainname ; do \
[ -f $$i ] && cp -f $$i $$i.old ; done ; echo Saved.
installdata:
$(MAKE) -C man install
$(MAKE) -C po install
# End of Makefile.
I18N=1
HAVE_AFUNIX=1
HAVE_AFINET=1
HAVE_AFINET6=1
# HAVE_AFIPX=0
# HAVE_AFATALK=0
# HAVE_AFAX25=0
HAVE_AFNETROM=1
# HAVE_AFROSE=0
# HAVE_AFX25=0
# HAVE_AFECONET=0
# HAVE_AFDECnet=0
# HAVE_AFASH=0
HAVE_HWETHER=1
HAVE_HWARC=1
HAVE_HWSLIP=1
HAVE_HWPPP=1
HAVE_HWTUNNEL=1
HAVE_HWSTRIP=1
HAVE_HWTR=1
# HAVE_HWAX25=0
# HAVE_HWROSE=0
HAVE_HWNETROM=1
# HAVE_HWX25=0
HAVE_HWFR=1
# HAVE_HWSIT=0
# HAVE_HWFDDI=0
# HAVE_HWHIPPI=0
# HAVE_HWASH=0
# HAVE_HWHDLCLAPB=0
HAVE_HWIRDA=1
# HAVE_HWEC=0
# HAVE_HWIB=0
HAVE_FW_MASQUERADE=1
HAVE_IP_TOOLS=1
HAVE_MII=1
HAVE_MII_DIAG=1
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
/*
* config.h Automatically generated configuration includefile
*
* NET-TOOLS A collection of programs that form the base set of the
* NET-3 Networking Distribution for the LINUX operating
* system.
*
* DO NOT EDIT DIRECTLY
*
*/
/*
*
* Internationalization
*
* The net-tools package has currently been translated to French,
* German and Brazilian Portugese. Other translations are, of
* course, welcome. Answer `n' here if you have no support for
* internationalization on your system.
*
*/
#define I18N 1
/*
*
* Protocol Families.
*
*/
#define HAVE_AFUNIX 1
#define HAVE_AFINET 1
#define HAVE_AFINET6 1
#define HAVE_AFIPX 0
#define HAVE_AFATALK 0
#define HAVE_AFAX25 0
#define HAVE_AFNETROM 1
#define HAVE_AFROSE 0
#define HAVE_AFX25 0
#define HAVE_AFECONET 0
#define HAVE_AFDECnet 0
#define HAVE_AFASH 0
/*
*
* Device Hardware types.
*
*/
#define HAVE_HWETHER 1
#define HAVE_HWARC 1
#define HAVE_HWSLIP 1
#define HAVE_HWPPP 1
#define HAVE_HWTUNNEL 1
#define HAVE_HWSTRIP 0
#define HAVE_HWTR 0
#define HAVE_HWAX25 0
#define HAVE_HWROSE 0
#define HAVE_HWNETROM 1
#define HAVE_HWX25 0
#define HAVE_HWFR 1
#define HAVE_HWSIT 0
#define HAVE_HWFDDI 0
#define HAVE_HWHIPPI 0
#define HAVE_HWASH 0
#define HAVE_HWHDLCLAPB 0
#define HAVE_HWIRDA 1
#define HAVE_HWEC 0
#define HAVE_HWIB 0
/*
*
* Other Features.
*
*/
#define HAVE_FW_MASQUERADE 1
#define HAVE_IP_TOOLS 1
#define HAVE_MII 1
SUMMARY="Basic networking tools"
DESCRIPTION="A collection of programs that form the base set of the NET-3 networking distribution for the Linux operating system"
HOMEPAGE = "http://net-tools.berlios.de/"
BUGTRACKER = "http://bugs.debian.org/net-tools"
LICENSE = "GPLv2+"
LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \
file://ifconfig.c;beginline=11;endline=15;md5=d1ca372080ad5401e23ca0afc35cf9ba"
PR = "r0"
SRC_URI = "${DEBIAN_MIRROR}/main/n/net-tools/net-tools_1.60.orig.tar.gz;name=tarball \
${DEBIAN_MIRROR}/main/n/net-tools/${BPN}_${PV}.diff.gz;apply=no;name=patch \
file://net-tools-config.h"
#Notice the leading space
SRC_URI_append = " file://config.make \
file://libmii.c \
file://mii-diag.c \
file://Makefile"
S = "${WORKDIR}/net-tools-1.60"
SRC_URI[tarball.md5sum] = "ecaf37acb5b5daff4bdda77785fd916d"
SRC_URI[tarball.sha256sum] = "ec67967cf7b1a3a3828a84762fbc013ac50ee5dc9aa3095d5c591f302c2de0f5"
SRC_URI[patch.md5sum] = "524658bb8df5ff92c4a991f5edcaf240"
SRC_URI[patch.sha256sum] = "170cc024fcb34329f4c25fd88b5f160a06be5d6d3eaf0bc976650fd1b1a6235d"
inherit gettext
# The Makefile is lame, no parallel build
PARALLEL_MAKE = ""
# Unlike other Debian packages, net-tools *.diff.gz contains another series of
# patches maintained by quilt. So manually apply them before applying other local
# patches. Also remove all temp files before leaving, because do_patch() will pop
# up all previously applied patches in the start
nettools_do_patch() {
cd ${S}
quilt pop -a || true
if [ -d ${S}/.pc-nettools ]; then
mv ${S}/.pc-nettools ${S}/.pc
QUILT_PATCHES=${S}/debian/patches quilt pop -a
rm -rf ${S}/.pc ${S}/debian
fi
patch -p1 < ${WORKDIR}/${BPN}_${PV}.diff
QUILT_PATCHES=${S}/debian/patches quilt push -a
mv ${S}/.pc ${S}/.pc-nettools
}
do_unpack[cleandirs] += "${S}"
# We invoke base do_patch at end, to incorporate any local patch
python do_patch() {
bb.build.exec_func('nettools_do_patch', d)
bb.build.exec_func('patch_do_patch', d)
}
do_configure() {
# net-tools has its own config mechanism requiring "make config"
# we pre-generate desired options and copy to source directory instead
cp ${WORKDIR}/Makefile ${S}/Makefile
cp ${WORKDIR}/config.make ${S}/config.make
cp ${WORKDIR}/libmii.c ${S}/libmii.c
cp ${WORKDIR}/mii-diag.c ${S}/mii-diag.c
cp ${WORKDIR}/net-tools-config.h ${S}/config.h
}
do_compile() {
# net-tools use COPTS/LOPTS to allow adding custom options
export COPTS="$CFLAGS"
export LOPTS="$LDFLAGS"
unset CFLAGS
unset LDFLAGS
oe_runmake
}
do_install() {
oe_runmake 'BASEDIR=${D}' install
}
inherit update-alternatives
base_sbindir_progs = "arp ifconfig ipmaddr iptunnel mii-tool nameif plipconfig rarp route slattach"
base_bindir_progs = "dnsdomainname domainname hostname netstat nisdomainname ypdomainname"
ALTERNATIVE_${PN} = "${base_sbindir_progs} ${base_bindir_progs}"
python __anonymous() {
for prog in d.getVar('base_sbindir_progs', True).split():
d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_sbindir', True), prog))
for prog in d.getVar('base_bindir_progs', True).split():
d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir', True), prog))
}
ALTERNATIVE_PRIORITY = "100"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment