Prepare downstream patches on upstream
Enable nice checkout with --with sourcegit. It would not base sources directory on tarball, but from git repository configured in spec. Simplifies backporting a new patch from upstream.
This commit is contained in:
parent
a6995451dc
commit
4c831af38b
27
dnsmasq.spec
27
dnsmasq.spec
@ -10,6 +10,13 @@
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%define _hardened_build 1
|
%define _hardened_build 1
|
||||||
|
# path to upstream git repository
|
||||||
|
%global git_upstream git://thekelleys.org.uk/dnsmasq.git
|
||||||
|
# tag of selected version
|
||||||
|
%global gittag v%{version}%{?extraversion}
|
||||||
|
|
||||||
|
# Attempt to prepare source-git with downstream repos
|
||||||
|
%bcond_with sourcegit
|
||||||
|
|
||||||
Name: dnsmasq
|
Name: dnsmasq
|
||||||
Version: 2.81
|
Version: 2.81
|
||||||
@ -51,6 +58,9 @@ BuildRequires: gnupg2
|
|||||||
|
|
||||||
BuildRequires: systemd
|
BuildRequires: systemd
|
||||||
%{?systemd_requires}
|
%{?systemd_requires}
|
||||||
|
%if %{with sourcegit}
|
||||||
|
BuildRequires: git-core
|
||||||
|
%endif
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Dnsmasq is lightweight, easy to configure DNS forwarder and DHCP server.
|
Dnsmasq is lightweight, easy to configure DNS forwarder and DHCP server.
|
||||||
@ -74,7 +84,22 @@ server's leases.
|
|||||||
%if 0%{?gpgverify:1}
|
%if 0%{?gpgverify:1}
|
||||||
%gpgverify -k 4 -s 3 -d 0
|
%gpgverify -k 4 -s 3 -d 0
|
||||||
%endif
|
%endif
|
||||||
%autosetup -p1 -n %{name}-%{version}%{?extraversion}
|
%if %{with sourcegit}
|
||||||
|
%autosetup -n %{name}-%{version}%{?extraversion} -N -S git_am
|
||||||
|
# If preparing with sourcegit, drop again source directory
|
||||||
|
# and clone git repository
|
||||||
|
# FIXME: deleting just unpacked sources is dangerous
|
||||||
|
# But using %%setup changes used directories in %%build and %%install
|
||||||
|
rm -rf %{_builddir}/%{name}-%{version}%{?extraversion}
|
||||||
|
cd %{_builddir}
|
||||||
|
git clone -b %{gittag} %{git_upstream} %{name}-%{version}%{?extraversion}
|
||||||
|
cd %{name}-%{version}%{?extraversion}
|
||||||
|
git checkout -b rpmbuild
|
||||||
|
%else
|
||||||
|
%autosetup -n %{name}-%{version}%{?extraversion} -N
|
||||||
|
%endif
|
||||||
|
# Apply patches on top
|
||||||
|
%autopatch -p1
|
||||||
|
|
||||||
# use /var/lib/dnsmasq instead of /var/lib/misc
|
# use /var/lib/dnsmasq instead of /var/lib/misc
|
||||||
for file in dnsmasq.conf.example man/dnsmasq.8 man/es/dnsmasq.8 src/config.h; do
|
for file in dnsmasq.conf.example man/dnsmasq.8 man/es/dnsmasq.8 src/config.h; do
|
||||||
|
Loading…
Reference in New Issue
Block a user