Simplify conditional macros

The old webkitgtk plugin is obsolete, so remove mention of it entirely.
Simplify all the other conditionals down to a single one for bootstrapping.
Enable the tests in the check phase.

https://fedoraproject.org/wiki/Packaging:Guidelines#Bootstrapping
This commit is contained in:
David King 2016-02-29 08:34:57 +00:00
parent 5c277ecddb
commit df96441e4e

View File

@ -1,15 +1,6 @@
#0 to bootstrap libproxy circle dependencies - 1 normal case
%if 1
%global _with_webkitgtk3 1
%global _with_gnome3 1
%global _with_mozjs 1
%global _with_gnome 1
%global _with_kde 1
%global _with_networkmanager 1
%global _with_python 1
%global _with_pacrunner 1
%endif
# When we are bootstrapping, we drop some dependencies.
# Set this to 0 after bootstrapping.
%{!?_with_bootstrap: %global bootstrap 0}
Name: libproxy
Version: 0.4.12
@ -27,40 +18,25 @@ BuildRequires: python-devel
BuildRequires: libmodman-devel >= 2.0.1
BuildRequires: cmake >= 2.6.0
# gnome
%{?_with_gnome:
BuildRequires: GConf2-devel
BuildRequires: libXmu-devel
}
%if ! 0%{?bootstrap}
# mozjs
%{?_with_mozjs:BuildRequires: pkgconfig(mozjs185)}
BuildRequires: pkgconfig(mozjs185)
# NetworkManager
%{?_with_networkmanager:
BuildRequires: NetworkManager-devel
BuildRequires: dbus-devel
}
# webkit (gtk)
%{?_with_webkit:BuildRequires: WebKit-gtk-devel}
# webkit (gtk3)
%{?_with_webkitgtk3:BuildRequires: webkitgtk3-devel}
BuildRequires: webkitgtk3-devel
# kde
%{?_with_kde:BuildRequires: /usr/bin/kreadconfig5}
BuildRequires: /usr/bin/kreadconfig5
# pacrunner
%{?_with_pacrunner:BuildRequires: dbus-devel}
#Obsoletes of disabled subpackages
%{!?_with_mozjs:
BuildRequires: dbus-devel
%else
# Obsoletes of disabled subpackages.
Provides: %{name}-mozjs = %{version}-%{release}
Obsoletes: %{name}-mozjs < %{version}-%{release}
}
%{!?_with_webkit:
Provides: %{name}-webkit = %{version}-%{release}
Obsoletes: %{name}-webkit < %{version}-%{release}
}
%{!?_with_webkitgtk3:
Provides: %{name}-webkitgtk3 = %{version}-%{release}
Obsoletes: %{name}-webkitgtk3 < %{version}-%{release}
}
%endif
%description
@ -83,7 +59,7 @@ Requires: %{name} = %{version}-%{release}
%description bin
The %{name}-bin package contains the proxy binary for %{name}
%{?_with_python:
%if ! 0%{?bootstrap}
%package python
Summary: Binding for %{name} and python
Group: System Environment/Libraries
@ -92,9 +68,7 @@ BuildArch: noarch
%description python
The %{name}-python package contains the python binding for %{name}
}
%{?_with_gnome:
%package gnome
Summary: Plugin for %{name} and gnome
Group: System Environment/Libraries
@ -102,9 +76,7 @@ Requires: %{name} = %{version}-%{release}
%description gnome
The %{name}-gnome package contains the %{name} plugin for gnome.
}
%{?_with_kde:
%package kde
Summary: Plugin for %{name} and kde
Group: System Environment/Libraries
@ -113,9 +85,7 @@ Requires: /usr/bin/kreadconfig5
%description kde
The %{name}-kde package contains the %{name} plugin for kde.
}
%{?_with_mozjs:
%package mozjs
Summary: Plugin for %{name} and mozjs
Group: System Environment/Libraries
@ -124,9 +94,7 @@ Provides: %{name}-pac = %{version}-%{release}
%description mozjs
The %{name}-mozjs package contains the %{name} plugin for mozjs.
}
%{?_with_networkmanager:
%package networkmanager
Summary: Plugin for %{name} and networkmanager
Group: System Environment/Libraries
@ -135,21 +103,7 @@ Requires: %{name} = %{version}-%{release}
%description networkmanager
The %{name}-networkmanager package contains the %{name} plugin
for networkmanager.
}
%{?_with_webkit:
%package webkit
Summary: Plugin for %{name} and webkit
Group: System Environment/Libraries
Requires: %{name} = %{version}-%{release}
Provides: %{name}-pac = %{version}-%{release}
%description webkit
The %{name}-webkit package contains the %{name} plugin for
webkit.
}
%{?_with_webkitgtk3:
%package webkitgtk3
Summary: Plugin for %{name} and webkitgtk3
Group: System Environment/Libraries
@ -157,11 +111,9 @@ Requires: %{name} = %{version}-%{release}
Provides: %{name}-pac = %{version}-%{release}
%description webkitgtk3
The %{name}-webkit package contains the %{name} plugin for
The %{name}-webkitgtk3 package contains the %{name} plugin for
webkitgtk3.
}
%{?_with_pacrunner:
%package pacrunner
Summary: Plugin for %{name} and PacRunner
Group: System Environment/Libraries
@ -171,7 +123,7 @@ Provides: %{name}-pac = %{version}-%{release}
%description pacrunner
The %{name}-pacrunner package contains the %{name} plugin for
PacRunner.
}
%endif
%package devel
@ -192,9 +144,11 @@ developing applications that use %{name}.
%{cmake} \
-DMODULE_INSTALL_DIR=%{_libdir}/%{name}/%{version}/modules \
-DWITH_PERL=OFF \
%{!?_with_gnome3:-DWITH_GNOME3=OFF}\
%{?_with_webkitgtk3:-DWITH_WEBKIT3=ON}\
%{?_with_mozjs:-DWITH_MOZJS=ON}\
%if ! 0%{?bootstrap}
-DWITH_GNOME3=ON \
-DWITH_WEBKIT3=ON \
-DWITH_MOZJS=ON \
%endif
.
make VERBOSE=1 %{?_smp_mflags}
@ -205,10 +159,8 @@ make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
#In case all modules are disabled
mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{name}/%{version}/modules
%{?_with_test:
%check
make test
}
%post -p /sbin/ldconfig
@ -216,7 +168,6 @@ make test
%files
%defattr(-,root,root,-)
%doc AUTHORS COPYING README
%{_libdir}/*.so.*
%dir %{_libdir}/%{name}
@ -224,64 +175,33 @@ make test
%dir %{_libdir}/%{name}/%{version}/modules
%files bin
%defattr(-,root,root,-)
%{_bindir}/proxy
%{?_with_python:
%if ! 0%{?bootstrap}
%files python
%defattr(-,root,root,-)
%{python_sitelib}/*
}
%{?_with_gnome:
%files gnome
%defattr(-,root,root,-)
%{!?_with_gnome3:
%{_libdir}/%{name}/%{version}/modules/config_gnome.so
%{_libexecdir}/pxgconf}
%{?_with_gnome3:
%{_libdir}/%{name}/%{version}/modules/config_gnome3.so
%{_libexecdir}/pxgsettings}
}
%{_libexecdir}/pxgsettings
%{?_with_kde:
%files kde
%defattr(-,root,root,-)
%{_libdir}/%{name}/%{version}/modules/config_kde.so
}
%{?_with_mozjs:
%files mozjs
%defattr(-,root,root,-)
%{_libdir}/%{name}/%{version}/modules/pacrunner_mozjs.so
}
%{?_with_networkmanager:
%files networkmanager
%defattr(-,root,root,-)
%{_libdir}/%{name}/%{version}/modules/network_networkmanager.so
}
%{?_with_webkit:
%files webkit
%defattr(-,root,root,-)
%{_libdir}/%{name}/%{version}/modules/pacrunner_webkit.so
}
%{?_with_webkitgtk3:
%files webkitgtk3
%defattr(-,root,root,-)
%{_libdir}/%{name}/%{version}/modules/pacrunner_webkit.so
}
%{?_with_pacrunner:
%files pacrunner
%defattr(-,root,root,-)
%{_libdir}/%{name}/%{version}/modules/config_pacrunner.so
}
%endif
%files devel
%defattr(-,root,root,-)
%{_includedir}/proxy.h
%{_libdir}/*.so
%{_libdir}/pkgconfig/libproxy-1.0.pc
@ -291,6 +211,7 @@ make test
%changelog
* Mon Feb 29 2016 David King <amigadave@amigadave.com> - 0.4.12-1
- Update to 0.4.12
- Simplify conditional macros
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.11-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild