From 843736e50534d184f4b07744d68d0f2d27284cae Mon Sep 17 00:00:00 2001 From: Sergey Kulanov Date: Fri, 16 Oct 2015 23:10:20 +0300 Subject: [PATCH] Fix fuel-createmirror spec * Since we are in migration stage to python code implementation we need to fix SPEC files both for RPM and DEB * Small lintian fixes Change-Id: I51e4a6aa27b2855805beab3c61b4d4c499df2732 Related-Bug: #1487077 --- debian/control | 4 ++-- debian/copyright | 2 +- debian/postinst | 2 +- debian/postrm | 2 +- debian/rules | 17 ++++++++++++++--- specs/fuel-createmirror.spec | 9 ++++++--- 6 files changed, 25 insertions(+), 11 deletions(-) diff --git a/debian/control b/debian/control index 3b35ecc..f094c4c 100644 --- a/debian/control +++ b/debian/control @@ -9,6 +9,6 @@ Package: fuel-createmirror Architecture: all Depends: ${shlibs:Depends},python,dpkg-dev,openssl,rsync Description: CLI script for MOS/upstream mirroring - **fuel-createmirror -- utility for creating local mirrors of MOS and - upstream OS repositories + **fuel-createmirror -- utility for creating local mirrors of MOS and + upstream OS repositories . diff --git a/debian/copyright b/debian/copyright index ddf1060..7d1a3a4 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1 +1 @@ -Copyright: GPLv2 \ No newline at end of file +Copyright: GPLv2 diff --git a/debian/postinst b/debian/postinst index 7c8ca3e..4848a06 100644 --- a/debian/postinst +++ b/debian/postinst @@ -1,3 +1,3 @@ #!/bin/bash ln -sf /opt/fuel-createmirror-8.0/fuel-createmirror /usr/bin/ -ln -sf /opt/fuel-createmirror-8.0/config /etc/fuel-createmirror \ No newline at end of file +ln -sf /opt/fuel-createmirror-8.0/config /etc/fuel-createmirror diff --git a/debian/postrm b/debian/postrm index 987d17b..fcb46e0 100644 --- a/debian/postrm +++ b/debian/postrm @@ -7,4 +7,4 @@ if [ "$1" = "1" ]; then else rm -f /usr/bin/fuel-createmirror rm -f /etc/fuel-createmirror -fi \ No newline at end of file +fi diff --git a/debian/rules b/debian/rules index 76cceec..7ef2c46 100755 --- a/debian/rules +++ b/debian/rules @@ -1,5 +1,12 @@ #!/usr/bin/make -f +# FIXME (skulanov) +# Since we are still building packages with ISO +# we have to define DEB_VERSION_EPOCH_UPSTREAM explicitly +DEB_VERSION_EPOCH_UPSTREAM=8.0 +# otherwise this variable correctly defined below +# include /usr/share/dpkg/pkg-info.mk + export DH_ALWAYS_EXCLUDE=CVS:.git:specs PACKAGE=$(shell dh_listpackages) @@ -24,9 +31,13 @@ binary-arch: build dh_installchangelogs # Copy the packages's files. - mkdir -p debian/$(PACKAGE)/opt/$(PACKAGE)-8.0 - find . -maxdepth 1 -mindepth 1 -not -name debian -print0 | \ - xargs -0 -r -i cp -a {} debian/$(PACKAGE)/opt/$(PACKAGE)-8.0 + mkdir -p debian/$(PACKAGE)/opt/$(PACKAGE)-$(DEB_VERSION_EPOCH_UPSTREAM) + cp fuel-createmirror debian/$(PACKAGE)/opt/$(PACKAGE)-$(DEB_VERSION_EPOCH_UPSTREAM) + cp deb-mirror debian/$(PACKAGE)/opt/$(PACKAGE)-$(DEB_VERSION_EPOCH_UPSTREAM) + cp -r util debian/$(PACKAGE)/opt/$(PACKAGE)-$(DEB_VERSION_EPOCH_UPSTREAM) + cp -r config debian/$(PACKAGE)/opt/$(PACKAGE)-$(DEB_VERSION_EPOCH_UPSTREAM) + cp LICENSE debian/$(PACKAGE)/opt/$(PACKAGE)-$(DEB_VERSION_EPOCH_UPSTREAM) + cp README.md debian/$(PACKAGE)/opt/$(PACKAGE)-$(DEB_VERSION_EPOCH_UPSTREAM) # # If you need to move files around in debian/$(PACKAGE) or do some diff --git a/specs/fuel-createmirror.spec b/specs/fuel-createmirror.spec index 0e5fe8b..16f0943 100644 --- a/specs/fuel-createmirror.spec +++ b/specs/fuel-createmirror.spec @@ -30,15 +30,18 @@ Requires: rsync rm -rf %{name}-%{version} mkdir %{name}-%{version} tar xzvf %{SOURCE0} -C %{name}-%{version} -rm -rf %{name}-%{version}/{debian,specs} %build %install rm -rf %{buildroot} mkdir -p %{buildroot}/opt/%{name}-%{version} -cp -R %{name}-%{version}/* %{buildroot}/opt/%{name}-%{version} -rm -f %{buildroot}/opt/%{name}-%{version}/version* +cp %{name}-%{version}/%{name} %{buildroot}/opt/%{name}-%{version} +cp %{name}-%{version}/deb-mirror %{buildroot}/opt/%{name}-%{version} +cp -R %{name}-%{version}/util/ %{buildroot}/opt/%{name}-%{version} +cp -R %{name}-%{version}/config/ %{buildroot}/opt/%{name}-%{version} +cp %{name}-%{version}/LICENSE %{buildroot}/opt/%{name}-%{version} +cp %{name}-%{version}/README.md %{buildroot}/opt/%{name}-%{version} %clean rm -rf %{buildroot}