98 lines
3.2 KiB
RPMSpec
98 lines
3.2 KiB
RPMSpec
|
# vim: set sw=4 ts=4 et nu:
|
||
|
|
||
|
# Copyright (c) 2013 Pascal Bleser <pascal.bleser@opensuse.org>
|
||
|
#
|
||
|
# 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/
|
||
|
|
||
|
Name: etckeeper
|
||
|
Version: 1.7
|
||
|
Release: 0
|
||
|
Summary: Store /etc under Version Control
|
||
|
Source: http://ftp.debian.org/debian/pool/main/e/etckeeper/etckeeper_%{version}.tar.gz
|
||
|
Source99: etckeeper.rpmlintrc
|
||
|
URL: http://joeyh.name/code/etckeeper/
|
||
|
Group: System/Management
|
||
|
License: GPL-2.0+
|
||
|
BuildRoot: %{_tmppath}/build-%{name}-%{version}
|
||
|
BuildRequires: make
|
||
|
BuildRequires: python-devel
|
||
|
%{!?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))")}
|
||
|
%py_requires
|
||
|
Requires: git >= 1.6.1
|
||
|
BuildRequires: git >= 1.6.1
|
||
|
BuildRequires: bzr
|
||
|
BuildRequires: libzypp
|
||
|
Requires: cron
|
||
|
%if 0%{?suse_version} >= 1120
|
||
|
BuildArch: noarch
|
||
|
%endif
|
||
|
|
||
|
%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
|
||
|
is important for /etc, such as the permissions of /etc/shadow. It's
|
||
|
quite modular and configurable, while also being simple to use if you
|
||
|
understand the basics of working with version control.
|
||
|
|
||
|
%prep
|
||
|
%setup -q -n "%{name}"
|
||
|
|
||
|
%if 0%{?suse_version}
|
||
|
%define HPM zypper
|
||
|
%define LPM rpm
|
||
|
%else
|
||
|
%if 0%{?fedora}
|
||
|
%define HPM yum
|
||
|
%define LPM rpm
|
||
|
%else
|
||
|
%{error:"Unsupported distribution"}
|
||
|
%endif
|
||
|
%endif
|
||
|
|
||
|
%__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
|
||
|
|
||
|
%build
|
||
|
make %{?_smp_mflags}
|
||
|
|
||
|
%install
|
||
|
make \
|
||
|
DESTDIR="%{buildroot}" \
|
||
|
PYTHON_INSTALL_OPTS="--prefix=%{_prefix} --root=%{buildroot} --record-rpm=$PWD/files.lst" \
|
||
|
install
|
||
|
|
||
|
install -D debian/cron.daily "%{buildroot}/etc/cron.daily/%{name}"
|
||
|
|
||
|
%clean
|
||
|
%{?buildroot:%__rm -rf "%{buildroot}"}
|
||
|
|
||
|
%files -f files.lst
|
||
|
%defattr(-,root,root)
|
||
|
%doc GPL TODO README
|
||
|
%{_bindir}/etckeeper
|
||
|
%config(noreplace) /etc/cron.daily/etckeeper
|
||
|
%dir %{_sysconfdir}/etckeeper
|
||
|
%config(noreplace) %{_sysconfdir}/etckeeper/etckeeper.conf
|
||
|
%dir %{_sysconfdir}/etckeeper/*.d
|
||
|
%config %{_sysconfdir}/etckeeper/*.d/*
|
||
|
%{_prefix}/lib/zypp/plugins/commit/zypper-etckeeper.py
|
||
|
%doc %{_mandir}/man8/etckeeper.8*
|
||
|
%config %{_sysconfdir}/bash_completion.d/etckeeper
|
||
|
|
||
|
%changelog
|