]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
Change handling of conditional builds in the spec file
authorPeter Kjellström <cap@nsc.liu.se>
Fri, 12 Feb 2010 11:31:13 +0000 (12:31 +0100)
committerVincent Bernat <bernat@luffy.cx>
Fri, 12 Feb 2010 17:19:51 +0000 (18:19 +0100)
Change handling of build options from using simple define statements
to using the RPMs bcond_without functionality. bcond_without instead
of bcond_with ensures that the old behaviour is preserved (all
options are still enabled by default). This change allows the
convenient "rpmbuild --without xxx" and is in line with:

http://www.rpm.org/wiki/PackagerDocs/ConditionalBuilds

redhat/lldpd.spec

index feadaeabb8c61c77693052bb092ea151ce8e023e..8861759d1fc715f71a8b940882128ee526bdda39 100644 (file)
@@ -1,12 +1,15 @@
 # configure options
-%define with_snmp 1
-%define with_cdp 1
-%define with_edp 1
-%define with_sonmp 1
-%define with_fdp 1
-%define with_lldpmed 1
-%define with_dot1 1
-%define with_dot3 1
+
+# Conditional build options, disable with "--without xxx"
+%bcond_without snmp
+%bcond_without cdp
+%bcond_without edp
+%bcond_without sonmp
+%bcond_without fdp
+%bcond_without lldpmed
+%bcond_without dot1
+%bcond_without dot3
+
 %define lldpd_user _lldpd
 %define lldpd_group _lldpd
 %define lldpd_chroot /var/run/lldpd
@@ -22,7 +25,7 @@ Source0: http://www.luffy.cx/lldpd/%{name}-%{version}.tar.gz
 Source1: lldpd.init
 Source2: lldpd.sysconfig
 
-%if %with_snmp
+%if %{with snmp}
 BuildRequires: net-snmp-devel
 Requires:      net-snmp
 %endif
@@ -47,40 +50,40 @@ protocol. It also handles LLDP-MED extension.
 %setup -q
 %build
 %configure \
-%if %with_snmp
+%if %{with snmp}
    --with-snmp \
 %endif
-%if %with_cdp
+%if %{with cdp}
    --enable-cdp \
 %else
    --disable-cdp \
 %endif
-%if %with_edp
+%if %{with edp}
    --enable-edp \
 %else
    --disable-edp \
 %endif
-%if %with_sonmp
+%if %{with sonmp}
    --enable-sonmp \
 %else
    --disable-sonmp \
 %endif
-%if %with_fdp
+%if %{with fdp}
    --enable-fdp \
 %else
    --disable-fdp \
 %endif
-%if %with_lldpmed
+%if %{with lldpmed}
    --enable-lldpmed \
 %else
    --disable-lldpmed \
 %endif
-%if %with_dot1
+%if %{with dot1}
    --enable-dot1 \
 %else
    --disable-dot1 \
 %endif
-%if %with_dot3
+%if %{with dot3}
    --enable-dot3 \
 %else
    --disable-dot3 \