Search
j0ke.net Open Build Service
>
Projects
>
hardware
:
nic
>
netxtreme2
> netxtreme2.spec
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File netxtreme2.spec of Package netxtreme2
%define brcmname netxtreme2 %define brcmvers 7.2.20 %define debug_package %{nil} Summary : Broadcom NetXtreme II iSCSI, FCOE, 1-Gigabit and 10-Gigabit ethernet drivers Name : %{brcmname} Version : %{brcmvers} Release : 1 Vendor : Broadcom Corporation License : GPL Group : System Environment/Base Source : %{brcmname}-%{brcmvers}.tar.bz2 BuildRoot: /var/tmp/%{brcmname}-buildroot %description This package contains the Broadcom NetXtreme II iSCSI (bnx2i), FCOE (bnx2fc, libfcoe2, and libfc2), 1-Gigabit (bnx2) and 10-Gigabit (bnx2x) ethernet drivers. %prep %setup -n %{brcmname}-%{brcmvers} -T -b 0 %build if [ -n "%{?KVER}" ]; then KVER=%{?KVER} elif [ -n "${BUILD_KERNEL}" ]; then KVER=${BUILD_KERNEL} else KVER=$(uname -r) fi make KVER=$KVER %install if [ -n "%{?KVER}" ]; then KVER=%{?KVER} elif [ -n "${BUILD_KERNEL}" ]; then KVER=${BUILD_KERNEL} else KVER=$(uname -r) fi BCM_KVER=`echo $KVER | cut -c1-3 | sed 's/2\.[56]/2\.6/' | sed 's/\.//'` if [ "$BCM_KVER" -ge "26" ]; then BCM_EXT=ko else BCM_EXT=o fi if [ -f ${RPM_BUILD_DIR}/%{brcmname}-%{brcmvers}/bnx2i/driver/bnx2i.${BCM_EXT} ]; then BCM_SCSI="1" fi if [ -f ${RPM_BUILD_DIR}/%{brcmname}-%{brcmvers}/bnx2/src/cnic.${BCM_EXT} ]; then BCM_CNIC="1" fi if [ -f ${RPM_BUILD_DIR}/%{brcmname}-%{brcmvers}/bnx2fc/driver/bnx2fc.${BCM_EXT} ]; then BCM_FCOE="1" fi if [ -f ${RPM_BUILD_DIR}/%{brcmname}-%{brcmvers}/fclibs/fcoe/libfcoe2.${BCM_EXT} ]; then if [ -f ${RPM_BUILD_DIR}/%{brcmname}-%{brcmvers}/fclibs/libfc/libfc2.${BCM_EXT} ]; then BCM_FCLIBS="1" fi fi if [ -d /lib/modules/$KVER/updates ]; then BCM_DIR=updates elif [ -f /etc/depmod.conf ]; then if grep -q "search.*[[:space:]]updates" /etc/depmod.conf; then BCM_DIR=updates fi fi if [ -z "$BCM_DIR" -a -d /etc/depmod.d ]; then if grep -q "search.*[[:space:]]updates" /etc/depmod.d/*; then BCM_DIR=updates fi fi if [ -z "$BCM_DIR" ]; then BCM_DIR=kernel/drivers/net fi echo "%defattr(-,root,root)" > $RPM_BUILD_DIR/file.list.%{brcmname} echo "/lib/modules/$KVER/$BCM_DIR/bnx2.${BCM_EXT}" >> $RPM_BUILD_DIR/file.list.%{brcmname} echo "/lib/modules/$KVER/$BCM_DIR/bnx2x.${BCM_EXT}" >> $RPM_BUILD_DIR/file.list.%{brcmname} mkdir -p $RPM_BUILD_ROOT/lib/modules/$KVER/$BCM_DIR if [ "$BCM_CNIC" = "1" ]; then echo "/lib/modules/$KVER/$BCM_DIR/cnic.ko" >> $RPM_BUILD_DIR/file.list.%{brcmname} fi if [ "$BCM_SCSI" = "1" ]; then if [ -d /lib/modules/$KVER/updates ]; then BCM_SCSI_DIR=updates elif [ -f /etc/depmod.conf ]; then if grep -q "search.*[[:space:]]updates" /etc/depmod.conf; then BCM_SCSI_DIR=updates fi fi if [ -z "$BCM_SCSI_DIR" -a -d /etc/depmod.d ]; then if grep -q "search.*[[:space:]]updates" /etc/depmod.d/*; then BCM_SCSI_DIR=updates fi fi if [ -z "$BCM_SCSI_DIR" ]; then BCM_SCSI_DIR=kernel/drivers/scsi fi echo "/lib/modules/$KVER/$BCM_SCSI_DIR/bnx2i.${BCM_EXT}" >> $RPM_BUILD_DIR/file.list.%{brcmname} mkdir -p $RPM_BUILD_ROOT/lib/modules/$KVER/$BCM_SCSI_DIR fi if [ "$BCM_FCLIBS" = "1" ]; then if [ -d /lib/modules/$KVER/updates ]; then BCM_FCLIBS_DIR=updates elif [ -f /etc/depmod.conf ]; then if grep -q "search.*[[:space:]]updates" /etc/depmod.conf; then BCM_FCLIBS_DIR=updates fi fi if [ -z "$BCM_FCLIBS_DIR" -a -d /etc/depmod.d ]; then if grep -q "search.*[[:space:]]updates" /etc/depmod.d/*; then BCM_FCLIBS_DIR=updates fi fi if [ -z "$BCM_FCLIBS_DIR" ]; then BCM_FCLIBS_DIR=kernel/drivers/scsi fi echo "/lib/modules/$KVER/$BCM_FCLIBS_DIR/libfcoe2.${BCM_EXT}" >> $RPM_BUILD_DIR/file.list.%{brcmname} echo "/lib/modules/$KVER/$BCM_FCLIBS_DIR/libfc2.${BCM_EXT}" >> $RPM_BUILD_DIR/file.list.%{brcmname} mkdir -p $RPM_BUILD_ROOT/lib/modules/$KVER/$BCM_FCLIBS_DIR fi if [ "$BCM_FCOE" = "1" ]; then if [ -d /lib/modules/$KVER/updates ]; then BCM_FCOE_DIR=updates elif [ -f /etc/depmod.conf ]; then if grep -q "search.*[[:space:]]updates" /etc/depmod.conf; then BCM_FCOE_DIR=updates fi fi if [ -z "$BCM_FCOE_DIR" -a -d /etc/depmod.d ]; then if grep -q "search.*[[:space:]]updates" /etc/depmod.d/*; then BCM_FCOE_DIR=updates fi fi if [ -z "$BCM_FCOE_DIR" ]; then BCM_FCOE_DIR=kernel/drivers/scsi fi echo "/lib/modules/$KVER/$BCM_FCOE_DIR/bnx2fc.${BCM_EXT}" >> $RPM_BUILD_DIR/file.list.%{brcmname} mkdir -p $RPM_BUILD_ROOT/lib/modules/$KVER/$BCM_FCOE_DIR fi echo "/usr/share/man/man4/bnx2.4.*" >> $RPM_BUILD_DIR/file.list.%{brcmname} echo "/usr/share/man/man4/bnx2x.4.*" >> $RPM_BUILD_DIR/file.list.%{brcmname} mkdir -p $RPM_BUILD_ROOT/usr/share/man/man4 make install KVER=$KVER PREFIX=$RPM_BUILD_ROOT if [ "$RPM_BUILD_ROOT" != "/" ]; then rm -f $RPM_BUILD_ROOT/lib/modules/$KVER/modules.* fi if [ -d $RPM_BUILD_ROOT/lib/modules/$KVER/extra ]; then BCM_EXTRA_DIR=$RPM_BUILD_ROOT/lib/modules/$KVER/extra BCM_FINAL_DIR=$RPM_BUILD_ROOT/lib/modules/$KVER/${BCM_DIR} if [ "$BCM_SCSI" = "1" ]; then BCM_SCSI_FINAL_DIR=$RPM_BUILD_ROOT/lib/modules/$KVER/${BCM_SCSI_DIR} fi if [ "$BCM_FCLIBS" = "1" ]; then BCM_FCLIBS_FINAL_DIR=$RPM_BUILD_ROOT/lib/modules/$KVER/${BCM_FCLIBS_DIR} fi if [ "$BCM_FCOE" = "1" ]; then BCM_FCOE_FINAL_DIR=$RPM_BUILD_ROOT/lib/modules/$KVER/${BCM_FCOE_DIR} fi if [ -f ${BCM_EXTRA_DIR}/bnx2.${BCM_EXT} ]; then mv ${BCM_EXTRA_DIR}/bnx2.${BCM_EXT} ${BCM_FINAL_DIR} fi if [ -f ${BCM_EXTRA_DIR}/bnx2x.${BCM_EXT} ]; then mv ${BCM_EXTRA_DIR}/bnx2x.${BCM_EXT} ${BCM_FINAL_DIR} fi if [ -f ${BCM_EXTRA_DIR}/bnx2i.${BCM_EXT} ]; then mv ${BCM_EXTRA_DIR}/bnx2i.${BCM_EXT} ${BCM_SCSI_FINAL_DIR} fi if [ -f ${BCM_EXTRA_DIR}/bnx2fc.${BCM_EXT} ]; then mv ${BCM_EXTRA_DIR}/bnx2fc.${BCM_EXT} ${BCM_FCOE_FINAL_DIR} fi if [ -f ${BCM_EXTRA_DIR}/libfcoe2.${BCM_EXT} ]; then mv ${BCM_EXTRA_DIR}/libfcoe2.${BCM_EXT} ${BCM_FCLIBS_FINAL_DIR} fi if [ -f ${BCM_EXTRA_DIR}/libfc2.${BCM_EXT} ]; then mv ${BCM_EXTRA_DIR}/libfc2.${BCM_EXT} ${BCM_FCLIBS_FINAL_DIR} fi if [ -f ${BCM_EXTRA_DIR}/cnic.ko ]; then mv ${BCM_EXTRA_DIR}/cnic.ko ${BCM_FINAL_DIR} fi if [ -z "`ls ${BCM_EXTRA_DIR}`" ]; then rmdir ${BCM_EXTRA_DIR} fi fi cp -f bnx2/LICENSE . cp -f bnx2/README.TXT ./README.bnx2.TXT cp -f bnx2/RELEASE.TXT ./RELEASE.bnx2.TXT cp -f bnx2x/README.TXT ./README.bnx2x.TXT cp -f bnx2x/RELEASE.TXT ./RELEASE.bnx2x.TXT cp -f bnx2i/docs/README.TXT ./README.bnx2i.TXT cp -f bnx2i/docs/RELEASE.TXT ./RELEASE.bnx2i.TXT cp -f bnx2fc/docs/README.TXT ./README.bnx2fc.TXT cp -f bnx2fc/docs/RELEASE.TXT ./RELEASE.bnx2fc.TXT cp -f fclibs/RELEASE.TXT ./RELEASE.fclibs.TXT %post depmod -a > /dev/null 2> /dev/null echo "If this system is configured for boot from SAN or otherwise requires network drivers in the bootloader initialiazed RAM disk (initrd), please note that those drivers will not be replaced with the newly installed versions until the ram disk is updated. In order to complete installation please refer to your Broadcom documentation and your distribution's documentation for instructions on properly updating your ram disk." exit 0 %preun %postun depmod -a > /dev/null 2> /dev/null exit 0 %clean rm -rf $RPM_BUILD_ROOT $RPM_BUILD_DIR/file.list.%{brcmname} %files -f ../file.list.%{brcmname} %doc LICENSE README.bnx2.TXT README.bnx2x.TXT README.bnx2i.TXT README.bnx2fc.TXT RELEASE.bnx2.TXT RELEASE.bnx2x.TXT RELEASE.bnx2i.TXT RELEASE.bnx2fc.TXT RELEASE.fclibs.TXT %changelog