Bladeren bron

spec: cleanup spec file to be slightly smarter

move all the conditionals in 2 variables to make it easier to read
and maintain and fix install of dbus-signal file

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
Fabio M. Di Nitto 13 jaren geleden
bovenliggende
commit
8f766dd708
1 gewijzigde bestanden met toevoegingen van 7 en 4 verwijderingen
  1. 7 4
      corosync.spec.in

+ 7 - 4
corosync.spec.in

@@ -14,14 +14,17 @@
 %bcond_with systemd
 %bcond_with systemd
 %bcond_with xmlconf
 %bcond_with xmlconf
 
 
+%global gitver %{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}
+%global gittarver %{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}
+
 Name: corosync
 Name: corosync
 Summary: The Corosync Cluster Engine and Application Programming Interfaces
 Summary: The Corosync Cluster Engine and Application Programming Interfaces
 Version: @version@
 Version: @version@
-Release: 1%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist}
+Release: 1%{?gitver}%{?dist}
 License: BSD
 License: BSD
 Group: System Environment/Base
 Group: System Environment/Base
 URL: http://ftp.corosync.org
 URL: http://ftp.corosync.org
-Source0: ftp://ftp:user@ftp.corosync.org/downloads/%{name}-%{version}/%{name}-%{version}%{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}.tar.gz
+Source0: ftp://ftp:user@ftp.corosync.org/downloads/%{name}-%{version}/%{name}-%{version}%{?gittarver}.tar.gz
 
 
 # Runtime bits
 # Runtime bits
 Requires: corosynclib = %{version}-%{release}
 Requires: corosynclib = %{version}-%{release}
@@ -60,7 +63,7 @@ Requires: libxslt
 BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
 BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
 
 
 %prep
 %prep
-%setup -q -n %{name}-%{version}%{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}
+%setup -q -n %{name}-%{version}%{?gittarver}
 
 
 %build
 %build
 %if %{buildtrunk}
 %if %{buildtrunk}
@@ -110,7 +113,7 @@ make install DESTDIR=%{buildroot}
 
 
 %if %{with dbus}
 %if %{with dbus}
 mkdir -p -m 0700 %{buildroot}/%{_sysconfdir}/dbus-1/system.d
 mkdir -p -m 0700 %{buildroot}/%{_sysconfdir}/dbus-1/system.d
-install -m 644 %{_builddir}/%{name}-%{version}/conf/corosync-signals.conf %{buildroot}/%{_sysconfdir}/dbus-1/system.d/corosync-signals.conf
+install -m 644 %{_builddir}/%{name}-%{version}%{?gittarver}/conf/corosync-signals.conf %{buildroot}/%{_sysconfdir}/dbus-1/system.d/corosync-signals.conf
 %endif
 %endif
 
 
 ## tree fixup
 ## tree fixup