2013-08-10 14:18:30 +02:00
|
|
|
# vim: set sw=4 ts=4 et nu:
|
2014-07-13 05:28:40 +02:00
|
|
|
#
|
|
|
|
# spec file for package etckeeper
|
|
|
|
#
|
2018-09-15 13:37:37 +02:00
|
|
|
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
|
2014-07-13 05:28:40 +02:00
|
|
|
# Copyright (c) 2014 Mitsutoshi NAKANO <bkbin005@rinku.zaq.ne.jp>
|
|
|
|
# Copyright (c) 2013 Pascal Bleser <pascal.bleser@opensuse.org>
|
2013-08-10 14:18:30 +02:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
2014-07-13 05:28:40 +02:00
|
|
|
#
|
2013-08-10 14:18:30 +02:00
|
|
|
|
2014-07-13 05:28:40 +02:00
|
|
|
|
2014-08-16 21:25:19 +02:00
|
|
|
# see https://en.opensuse.org/openSUSE:Packaging_Python#Compatibility_with_older_distributions
|
|
|
|
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
|
|
|
|
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
|
2014-07-13 05:28:40 +02:00
|
|
|
Name: etckeeper
|
2018-09-15 13:37:37 +02:00
|
|
|
Version: 1.18.8
|
2014-07-13 05:28:40 +02:00
|
|
|
Release: 0
|
|
|
|
Summary: Store /etc under Version Control
|
2018-09-15 13:37:37 +02:00
|
|
|
License: GPL-2.0-or-later
|
2014-07-13 05:28:40 +02:00
|
|
|
Group: System/Management
|
2017-11-03 01:13:02 +01:00
|
|
|
Source: https://git.joeyh.name/index.cgi/etckeeper.git/snapshot/%{name}-%{version}.tar.gz
|
2014-08-16 21:25:19 +02:00
|
|
|
# PATCH-FIX-UPSTREAM etckeeper-avoid-packagelist.patch gh#joeyh/etckeeper#17 bkbin005@rinku.zaq.ne.jp -- add AVOID_PACKAGELIST
|
|
|
|
Patch0: etckeeper-avoid-packagelist.patch
|
2016-10-17 14:27:21 +02:00
|
|
|
Url: http://etckeeper.branchable.com/
|
2014-07-13 05:28:40 +02:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
%define LPM rpm
|
2017-11-03 01:13:02 +01:00
|
|
|
Requires: python-base >= 2.7
|
2014-08-16 21:25:19 +02:00
|
|
|
BuildRequires: make
|
|
|
|
# added for bzr 2014-07-10 bkbin005@rinku.zaq.ne.jp
|
|
|
|
BuildRequires: bzr
|
|
|
|
BuildRequires: python-devel
|
2014-07-13 05:28:40 +02:00
|
|
|
|
2013-08-10 15:04:08 +02:00
|
|
|
%if 0%{?suse_version}
|
2014-08-16 21:25:19 +02:00
|
|
|
# modified 2014-07-09 bkbin005@rinku.zaq.ne.jp
|
|
|
|
# Users should be able to select VCS.
|
|
|
|
Recommends: git
|
|
|
|
Recommends: %{name}-cron = %{version}-%{release}
|
|
|
|
Recommends: %{name}-zypp-plugin = %{version}-%{release}
|
2014-07-13 05:28:40 +02:00
|
|
|
BuildRequires: libzypp
|
2013-08-10 15:04:08 +02:00
|
|
|
%define HPM zypper
|
|
|
|
%else
|
2014-07-13 05:28:40 +02:00
|
|
|
BuildRequires: yum
|
2014-08-16 21:25:19 +02:00
|
|
|
Requires: %{name}-cron = %{version}-%{release}
|
|
|
|
Requires: %{name}-yum-plugin = %{version}-%{release}
|
2013-08-10 15:04:08 +02:00
|
|
|
%define HPM yum
|
|
|
|
%endif
|
2016-10-17 14:27:21 +02:00
|
|
|
%{?systemd_requires}
|
2013-08-10 14:18:30 +02:00
|
|
|
|
|
|
|
%description
|
|
|
|
The etckeeper program is a tool to let /etc be stored in a git,
|
|
|
|
mercurial, bzr or darcs repository. It hooks into yum to automatically
|
|
|
|
commit changes made to /etc during package upgrades. It tracks file
|
|
|
|
metadata that version control systems do not normally support, but that
|
2014-07-13 05:28:40 +02:00
|
|
|
is important for /etc, such as the permissions of /etc/shadow. It is
|
2013-08-10 14:18:30 +02:00
|
|
|
quite modular and configurable, while also being simple to use if you
|
|
|
|
understand the basics of working with version control.
|
|
|
|
|
2014-07-13 05:28:40 +02:00
|
|
|
|
2014-08-16 21:25:19 +02:00
|
|
|
%package cron
|
2014-07-13 05:28:40 +02:00
|
|
|
Summary: The etckeeper cron function
|
|
|
|
Group: System/Management
|
2014-08-16 21:25:19 +02:00
|
|
|
Requires: etckeeper = %{version}-%{release}
|
|
|
|
Provides: etckeeper:%{_sysconfdir}/cron.daily/etckeeper
|
|
|
|
%if 0%{?suse_version}
|
2014-07-13 05:28:40 +02:00
|
|
|
Requires: cron
|
2014-08-16 21:25:19 +02:00
|
|
|
%else
|
|
|
|
Requires: crontabs
|
|
|
|
%endif
|
2014-07-13 05:28:40 +02:00
|
|
|
|
2014-08-16 21:25:19 +02:00
|
|
|
%description cron
|
|
|
|
The etckeeper-cron calls etckeeper from cron.
|
2014-07-13 05:28:40 +02:00
|
|
|
|
|
|
|
|
|
|
|
%if 0%{?suse_version}
|
2014-08-16 21:25:19 +02:00
|
|
|
%package zypp-plugin
|
|
|
|
Summary: The etckeeper integration function with ZYpp
|
|
|
|
Group: System/Management
|
|
|
|
Requires: etckeeper = %{version}-%{release}
|
2014-07-13 05:28:40 +02:00
|
|
|
Requires: zypp-plugin-python
|
2014-08-16 21:25:19 +02:00
|
|
|
BuildRequires: zypp-plugin-python
|
|
|
|
Obsoletes: etckeeper-pkgmanager-collabo < %{version}-%{release}
|
|
|
|
Provides: etckeeper-pkgmanager-collabo = %{version}-%{release}
|
|
|
|
Provides: etckeeper:%{_prefix}/lib/zypp/plugins/commit/zypper-etckeeper.py
|
2014-07-13 05:28:40 +02:00
|
|
|
|
2014-08-16 21:25:19 +02:00
|
|
|
%description zypp-plugin
|
|
|
|
The etckeeper-zypp-plugin calls etckeeper from ZYpp.
|
|
|
|
%else
|
|
|
|
%package yum-plugin
|
|
|
|
Summary: The etckeeper integration function with YUM
|
|
|
|
Group: System/Management
|
|
|
|
Requires: etckeeper = %{version}-%{release}
|
|
|
|
Obsoletes: etckeeper-pkgmanager-collabo
|
|
|
|
Provides: etckeeper-pkgmanager-collabo = %{version}-%{release}
|
|
|
|
Provides: etckeeper:%{_sysconfdir}/yum/pluginconf.d/etckeeper.conf
|
2014-07-13 05:28:40 +02:00
|
|
|
|
2014-08-16 21:25:19 +02:00
|
|
|
%description yum-plugin
|
|
|
|
The etckeeper-zypp-plugin calls etckeeper from YUM.
|
|
|
|
%endif
|
2014-07-13 05:28:40 +02:00
|
|
|
|
2013-08-10 14:18:30 +02:00
|
|
|
%prep
|
2016-10-24 19:00:15 +02:00
|
|
|
%setup -q
|
2014-07-03 09:21:46 +02:00
|
|
|
%patch0 -p1
|
2013-08-10 14:18:30 +02:00
|
|
|
|
|
|
|
%__perl -pi -e '
|
|
|
|
s|^(\s*)(HIGHLEVEL_PACKAGE_MANAGER)=.+|$1$2=%{HPM}|;
|
|
|
|
s|^(\s*)(LOWLEVEL_PACKAGE_MANAGER)=.+|$1$2=%{LPM}|;
|
|
|
|
s|^(\s*)(VCS)=.+|$1$2=git|;
|
|
|
|
' ./etckeeper.conf
|
|
|
|
|
2016-10-17 14:27:21 +02:00
|
|
|
# rpmlint
|
2016-10-24 19:00:15 +02:00
|
|
|
find -type f -name ".gitignore" -delete
|
2017-11-03 01:13:02 +01:00
|
|
|
rm -f ./doc/todo/.mdwn
|
2016-10-17 14:27:21 +02:00
|
|
|
|
|
|
|
# use %%{_unitdir} for rpm-based distros
|
|
|
|
sed -i 's:systemddir=/lib/systemd/system:systemddir=%{_unitdir}:g' Makefile
|
|
|
|
|
2013-08-10 14:18:30 +02:00
|
|
|
%build
|
|
|
|
make %{?_smp_mflags}
|
|
|
|
|
|
|
|
%install
|
|
|
|
make \
|
|
|
|
DESTDIR="%{buildroot}" \
|
2014-08-16 21:25:19 +02:00
|
|
|
PYTHON_INSTALL_OPTS="--prefix=%{_prefix} --install-purelib=%{python_sitearch}" \
|
2013-08-10 14:18:30 +02:00
|
|
|
install
|
|
|
|
install -D debian/cron.daily "%{buildroot}/etc/cron.daily/%{name}"
|
|
|
|
|
2016-10-17 14:27:21 +02:00
|
|
|
mkdir %{buildroot}%{_sbindir}
|
|
|
|
ln -s ../bin/%{name} %{buildroot}%{_sbindir}/%{name}
|
|
|
|
ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rc%{name}
|
|
|
|
|
|
|
|
%pre
|
|
|
|
%service_add_pre etckeeper.service
|
|
|
|
|
|
|
|
%preun
|
|
|
|
%service_del_preun etckeeper.service
|
|
|
|
|
|
|
|
%post
|
|
|
|
%service_add_post etckeeper.service
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%service_del_postun etckeeper.service
|
|
|
|
|
2013-08-10 15:04:08 +02:00
|
|
|
%files
|
2016-10-17 14:27:21 +02:00
|
|
|
%doc GPL README.md doc
|
|
|
|
%{_unitdir}/etckeeper*
|
2013-08-10 14:18:30 +02:00
|
|
|
%{_bindir}/etckeeper
|
2016-10-17 14:27:21 +02:00
|
|
|
%{_sbindir}/*etckeeper
|
|
|
|
%dir %{_datadir}/bash-completion
|
|
|
|
%dir %{_datadir}/bash-completion/completions
|
|
|
|
%{_datadir}/bash-completion/completions/etckeeper
|
2013-08-10 14:18:30 +02:00
|
|
|
%dir %{_sysconfdir}/etckeeper
|
2016-10-17 14:27:21 +02:00
|
|
|
%{_sysconfdir}/etckeeper/daily
|
2013-08-10 14:18:30 +02:00
|
|
|
%config(noreplace) %{_sysconfdir}/etckeeper/etckeeper.conf
|
|
|
|
%dir %{_sysconfdir}/etckeeper/*.d
|
|
|
|
%config %{_sysconfdir}/etckeeper/*.d/*
|
2014-07-13 05:28:40 +02:00
|
|
|
%doc %{_mandir}/man8/etckeeper.8*
|
2014-08-16 21:25:19 +02:00
|
|
|
%{python_sitearch}/bzrlib/plugins/%{name}/
|
|
|
|
%{python_sitearch}/bzr_%{name}-*.egg-info
|
2014-07-13 05:28:40 +02:00
|
|
|
|
2014-08-16 21:25:19 +02:00
|
|
|
%files cron
|
2014-07-13 05:28:40 +02:00
|
|
|
%config(noreplace) %{_sysconfdir}/cron.daily/etckeeper
|
|
|
|
|
2013-08-10 15:04:08 +02:00
|
|
|
%if 0%{?suse_version}
|
2014-08-16 21:25:19 +02:00
|
|
|
%files zypp-plugin
|
2013-08-10 14:18:30 +02:00
|
|
|
%{_prefix}/lib/zypp/plugins/commit/zypper-etckeeper.py
|
2014-07-13 05:28:40 +02:00
|
|
|
%else
|
2014-08-16 21:25:19 +02:00
|
|
|
%files yum-plugin
|
2013-08-10 15:04:08 +02:00
|
|
|
%config(noreplace) %{_sysconfdir}/yum/pluginconf.d/etckeeper.conf
|
|
|
|
%{_prefix}/lib/yum-plugins/etckeeper.*
|
|
|
|
%endif
|
2013-08-10 14:18:30 +02:00
|
|
|
|
|
|
|
%changelog
|