thm pushed to etckeeper (epel7). "Update to 1.18. (..more)"

notifications at fedoraproject.org notifications at fedoraproject.org
Thu Mar 26 16:15:06 UTC 2015


>From 2da25fa5b8498928c0500a53aabd25f9c8c51fd3 Mon Sep 17 00:00:00 2001
From: Thomas Moschny <thm at fedoraproject.org>
Date: Thu, 26 Mar 2015 12:04:13 +0100
Subject: Update to 1.18.

- Update upstream URLs.
- Package DNF plugin.
- Slightly modernize spec file.

diff --git a/.gitignore b/.gitignore
index 54d4ec9..04e5dd0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -26,3 +26,4 @@ etckeeper_0.41.tar.gz
 /etckeeper_1.12.tar.gz
 /etckeeper_1.13.tar.gz
 /etckeeper_1.14.tar.gz
+/etckeeper_1.16.tar.gz
diff --git a/etckeeper-makefile-remove-python-plugins.patch b/etckeeper-makefile-remove-python-plugins.patch
new file mode 100644
index 0000000..9c81f01
--- /dev/null
+++ b/etckeeper-makefile-remove-python-plugins.patch
@@ -0,0 +1,30 @@
+diff -up etckeeper-1.18/Makefile.orig etckeeper-1.18/Makefile
+--- etckeeper-1.18/Makefile.orig	2015-03-20 16:53:23.681037197 +0100
++++ etckeeper-1.18/Makefile	2015-03-20 16:56:28.697621078 +0100
+@@ -13,11 +13,8 @@ CP=cp -R
+ INSTALL=install 
+ INSTALL_EXE=${INSTALL}
+ INSTALL_DATA=${INSTALL} -m 0644
+-PYTHON=python
+ 
+ build: etckeeper.spec etckeeper.version
+-	-$(PYTHON) ./etckeeper-bzr/__init__.py build || echo "** bzr support not built"
+-	-$(PYTHON) ./etckeeper-dnf/etckeeper.py build || echo "** DNF support not built"
+ 
+ install: etckeeper.version
+ 	mkdir -p $(DESTDIR)$(etcdir)/etckeeper/ $(DESTDIR)$(vardir)/cache/etckeeper/
+@@ -45,14 +42,10 @@ ifeq ($(HIGHLEVEL_PACKAGE_MANAGER),yum)
+ 	mkdir -p $(DESTDIR)$(etcdir)/yum/pluginconf.d
+ 	$(INSTALL_DATA) yum-etckeeper.conf $(DESTDIR)$(etcdir)/yum/pluginconf.d/etckeeper.conf
+ endif
+-ifeq ($(HIGHLEVEL_PACKAGE_MANAGER),dnf)
+-	-$(PYTHON) ./etckeeper-dnf/etckeeper.py install --root=$(DESTDIR) ${PYTHON_INSTALL_OPTS} || echo "** DNF support not installed"
+-endif
+ ifeq ($(HIGHLEVEL_PACKAGE_MANAGER),zypper)
+ 	mkdir -p $(DESTDIR)$(prefix)/lib/zypp/plugins/commit
+ 	$(INSTALL) zypper-etckeeper.py $(DESTDIR)$(prefix)/lib/zypp/plugins/commit/zypper-etckeeper.py
+ endif
+-	-$(PYTHON) ./etckeeper-bzr/__init__.py install --root=$(DESTDIR) ${PYTHON_INSTALL_OPTS} || echo "** bzr support not installed"
+ 	echo "** installation successful"
+ 
+ clean: etckeeper.spec etckeeper.version
diff --git a/etckeeper.spec b/etckeeper.spec
index a5202ed..46eac41 100644
--- a/etckeeper.spec
+++ b/etckeeper.spec
@@ -1,15 +1,40 @@
-%global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
+%if 0%{?rhel} && 0%{?rhel} <= 6
+%{!?__python2: %global __python2 /usr/bin/python2}
+%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
+%endif
+
 %{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
 
+%if 0%{?fedora} || 0%{?rhel} > 5
+%global with_bzr 1
+%else
+%global with_bzr 0
+%endif
+
+%if 0%{?fedora}
+# enable for epel7 later
+%global with_dnf 1
+%if 0%{fedora} >= 23
+%global dnf_uses_python3 1
+%global __python_dnf %{__python3}
+%else
+%global dnf_uses_python3 0
+%global __python_dnf %{__python2}
+%endif
+%else
+%global with_dnf 0
+%endif
+
 Name:      etckeeper
-Version:   1.14
-Release:   2%{?dist}
+Version:   1.18
+Release:   1%{?dist}
 Summary:   Store /etc in a SCM system (git, mercurial, bzr or darcs)
 Group:     Applications/System
 License:   GPLv2+
-URL:       http://kitenet.net/~joey/code/etckeeper/
-Source0:   http://ftp.debian.org/debian/pool/main/e/etckeeper/%{name}_%{version}.tar.gz
+URL:       http://etckeeper.branchable.com/
+Source0:   https://github.com/joeyh/etckeeper/archive/%{version}/%{name}-%{version}.tar.gz
 Source1:   README.fedora
+Patch0:    etckeeper-makefile-remove-python-plugins.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildArch: noarch
 BuildRequires: python-markdown
@@ -32,30 +57,75 @@ To use bzr as backend, please also install the %{name}-bzr package.
 
 To start using the package please read %{_pkgdocdir}/README.
 
-%if 0%{?fedora} || 0%{?rhel} > 5
+
+%if 0%{?with_bzr}
 %package bzr
 Summary:  Support for bzr with etckeeper
 Group:    Applications/System
-Requires: %{name} = %{version}-%{release} bzr
+BuildRequires: python2-devel
 BuildRequires: bzr
-BuildRequires: python-devel
+Requires: %{name} = %{version}-%{release}
+Requires: bzr
 
 %description bzr
 This package provides a bzr backend for etckeeper, if you want to use
 etckeeper with bzr backend, install this package.
-%endif
+%endif # with_bzr
+
+
+%if 0%{?with_dnf}
+%package dnf
+Summary:  DNF plugin for etckeeper support
+Group:    Applications/System
+BuildRequires: python2-devel
+BuildRequires: dnf
+BuildRequires: dnf-plugins-core
+Requires: %{name} = %{version}-%{release}
+Requires: dnf
+Requires: dnf-plugins-core
+
+%description dnf
+This package provides a DNF plugin for etckeeper. If you want to use
+etckeeper with DNF, install this package.
+%endif # with_dnf
+
 
 %prep
-%setup -q -n %{name}
-%{__perl} -pi -e '
-    s|HIGHLEVEL_PACKAGE_MANAGER=apt|HIGHLEVEL_PACKAGE_MANAGER=yum|;
-    s|LOWLEVEL_PACKAGE_MANAGER=dpkg|LOWLEVEL_PACKAGE_MANAGER=rpm|;
-    ' etckeeper.conf
-%{__sed} -i -e '1d' yum-etckeeper.py
+%setup -q
+%patch0 -p1
+sed -e 's|HIGHLEVEL_PACKAGE_MANAGER=apt|HIGHLEVEL_PACKAGE_MANAGER=yum|' \
+    -e 's|LOWLEVEL_PACKAGE_MANAGER=dpkg|LOWLEVEL_PACKAGE_MANAGER=rpm|' \
+    -i etckeeper.conf
+sed -e 's|^prefix=.*|prefix=%{_prefix}|' \
+    -e 's|^bindir=.*|bindir=%{_bindir}|' \
+    -e 's|^etcdir=.*|etcdir=%{_sysconfdir}|' \
+    -e 's|^mandir=.*|mandir=%{_mandir}|' \
+    -e 's|^vardir=.*|vardir=%{_localstatedir}|' \
+    -e 's|^INSTALL=.*|INSTALL=install -p|' \
+    -e 's|^CP=.*|CP=cp -pR|' \
+    -i Makefile
+# move each plugin in its own subdirectory, so each has its own build/
+# directory
+mkdir bzr-plugin ; mv etckeeper-bzr bzr-plugin
+mkdir dnf-plugin ; mv etckeeper-dnf dnf-plugin
 cp -av %{SOURCE1} .
 
+
 %build
 make %{?_smp_mflags}
+
+%if 0%{?with_bzr}
+pushd bzr-plugin
+%{__python2} etckeeper-bzr/__init__.py build
+popd
+%endif
+
+%if 0%{?with_dnf}
+pushd dnf-plugin
+%{__python_dnf} etckeeper-dnf/etckeeper.py build
+popd
+%endif
+
 %if 0%{?fedora} || 0%{?rhel} > 6
 # the binary in python-markdown has been renamed
 markdown_py <README.md >README.html
@@ -63,29 +133,45 @@ markdown_py <README.md >README.html
 markdown <README.md >README.html
 %endif
 
+
 %install
 rm -rf %{buildroot}
-make install DESTDIR=%{buildroot} INSTALL="%{__install} -p"
-%{__install} -D -p debian/cron.daily %{buildroot}%{_sysconfdir}/cron.daily/%{name}
-%{__install} -d  %{buildroot}%{_localstatedir}/cache/%{name}
-%if 0%{?fedora} || 0%{?rhel} > 5
-%{__sed} -i -e '1d' %{buildroot}%{python_sitelib}/bzrlib/plugins/%{name}/__init__.py
-%else
-rm -rf %{buildroot}%{python_sitelib}/bzrlib/plugins/%{name}
-rm -rf %{buildroot}%{python_sitelib}/bzr_%{name}-*.egg-info
+make install DESTDIR=%{buildroot}
+
+%if 0%{?with_bzr}
+pushd bzr-plugin
+%{__python2} etckeeper-bzr/__init__.py install -O1 --skip-build --root %{buildroot}
+popd
+%endif
+
+%if 0%{?with_dnf}
+pushd dnf-plugin
+%{__python_dnf} etckeeper-dnf/etckeeper.py install -O1 --skip-build --root %{buildroot}
+popd
 %endif
 
+install -D -p debian/cron.daily %{buildroot}%{_sysconfdir}/cron.daily/%{name}
+install -d  %{buildroot}%{_localstatedir}/cache/%{name}
+
+
 %clean
 rm -rf %{buildroot}
 
+
 %post
 if [ $1 -gt 1 ] ; then
    %{_bindir}/%{name} update-ignore
 fi
 
+
 %files
 %defattr(-, root, root, -)
-%doc GPL TODO README.html README.fedora
+%doc README.html README.fedora
+%if 0%{?_licensedir:1}
+%license GPL
+%else
+%doc GPL
+%endif # licensedir
 %{_bindir}/%{name}
 %{_mandir}/man8/%{name}.8*
 %dir %{_sysconfdir}/%{name}
@@ -100,15 +186,39 @@ fi
 %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/%{name}.conf
 %{_localstatedir}/cache/%{name}
 
-%if 0%{?fedora} || 0%{?rhel} > 5
+
+%if 0%{?with_bzr}
 %files bzr
 %defattr(-, root, root, -)
-%doc GPL
-%{python_sitelib}/bzrlib/plugins/%{name}
-%{python_sitelib}/bzr_%{name}-*.egg-info
-%endif
+%{python2_sitelib}/bzrlib/plugins/%{name}
+%{python2_sitelib}/bzr_%{name}-*.egg-info
+%endif # with_bzr
+
+
+%if 0%{?with_dnf}
+%files dnf
+%defattr(-, root, root, -)
+%if 0%{?dnf_uses_python3}
+%{python3_sitelib}/dnf-plugins/%{name}.py
+%exclude %{python3_sitelib}/dnf-plugins/__init__.py
+%{python3_sitelib}/dnf-plugins/__pycache__/%{name}.*
+%exclude %{python3_sitelib}/dnf-plugins/__pycache__/__init__.*
+%{python3_sitelib}/dnf_%{name}-*.egg-info
+%else
+%{python2_sitelib}/dnf-plugins/%{name}.py*
+%exclude %{python2_sitelib}/dnf-plugins/__init__.py*
+%{python2_sitelib}/dnf_%{name}-*.egg-info
+%endif # dnf_uses_python3
+%endif # with_dnf
+
 
 %changelog
+* Fri Mar 20 2015 Thomas Moschny <thomas.moschny at gmx.de> - 1.18-1
+- Update to 1.18.
+- Update upstream URLs.
+- Package DNF plugin.
+- Slightly modernize spec file.
+
 * Thu Dec 18 2014 Thomas Moschny <thomas.moschny at gmx.de> - 1.14-2
 - Disable bzr plugin on epel5.
 
diff --git a/sources b/sources
index c627817..e8dc104 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-c3e2ef83b946b45459347af14c19fa81  etckeeper_1.14.tar.gz
+cfdf340f7dc2c072a13d0a09ee560cb8  etckeeper-1.18.tar.gz
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/etckeeper.git/commit/?h=epel7&id=2da25fa5b8498928c0500a53aabd25f9c8c51fd3


More information about the scm-commits mailing list