Dominique Leuenberger 2018-10-08 15:45:17 +00:00 committed by Git OBS Bridge
commit c8d4da39fa
3 changed files with 172 additions and 82 deletions

View File

@ -0,0 +1,18 @@
Index: etckeeper-1.18.8/etckeeper.conf
===================================================================
--- etckeeper-1.18.8.orig/etckeeper.conf
+++ etckeeper-1.18.8/etckeeper.conf
@@ -33,11 +33,11 @@ DARCS_COMMIT_OPTIONS="-a"
# The high-level package manager that's being used.
# (apt, pacman, pacman-g2, yum, dnf, zypper, apk etc)
-HIGHLEVEL_PACKAGE_MANAGER=apt
+HIGHLEVEL_PACKAGE_MANAGER=zypper
# The low-level package manager that's being used.
# (dpkg, rpm, pacman, pacmatic, pacman-g2, apk etc)
-LOWLEVEL_PACKAGE_MANAGER=dpkg
+LOWLEVEL_PACKAGE_MANAGER=rpm
# To push each commit to a remote, put the name of the remote here.
# (eg, "origin" for git). Space-separated lists of multiple remotes

View File

@ -1,3 +1,57 @@
-------------------------------------------------------------------
Tue Oct 2 09:38:10 UTC 2018 - Jan Engelhardt <jengelh@inai.de>
- Remove idempotent %if..%endif guards.
- Fix incorrect trailing slash in make install line.
- Update RPM group for bash-completion.
-------------------------------------------------------------------
Sun Sep 30 07:09:48 UTC 2018 - bkbin005@rinku.zaq.ne.jp
- indicated that subpackages are noarch.
- modified the description longer.
-------------------------------------------------------------------
Thu Sep 13 07:34:35 UTC 2018 - Marcus Rueckert <mrueckert@suse.de>
- obsolete cron sub package on systemd machines
-------------------------------------------------------------------
Thu Sep 13 07:29:24 UTC 2018 - Marcus Rueckert <mrueckert@suse.de>
- use %license
-------------------------------------------------------------------
Wed Sep 12 23:31:38 UTC 2018 - Marcus Rueckert <mrueckert@suse.de>
- dropped non suse support
- added etckeeper-set-package-manager.patch: set the package
manager via a patch now that we only care about suse
- bzr support:
- disable for now as it would force the whole package to be
python2 bound. you can reenable it when building with
--with=bzr or set the options in your prjconf:
%define _with_bzr 1
Macros:
%_with_bzr 1
:Macros
- change bzr support to be in a subpackage if enabled
- build with python3 when not building with bzr support
- patch shebang line in the zypper plugin to match that
- build the whole package as noarch if we don't build with python
as we are just packaging a bunch of shell scripts
- move bash completion to a sub package, which is recommended to
keep the default working, BR and Require the bash-completion
package for path ownership
- downgrade to git-core so we only have the minimal git for small
installs on servers
- no longer build the cron support on systemd machines. the systemd
timer is more powerful and should be used instead.
- when uninstalling we should also disable and stop the systemd
timer
- only ship the documentation files that are also shipped in the
debian package
-------------------------------------------------------------------
Tue Sep 11 07:34:30 UTC 2018 - ecsos@opensuse.org

View File

@ -15,13 +15,24 @@
# 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/
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
# 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))")}
# this would pull python2
%bcond_with bzr
%bcond_without systemd
%if %{with bzr}
%define python_versioned python
%define python_args PYTHON_INSTALL_OPTS="--prefix=%{_prefix} --install-purelib=%{python_sitearch}"
%else
%define python_versioned python3
%define python_args %{nil}
%endif
%define make_args systemddir=%{_unitdir} PYTHON=%{python_versioned} %{python_args}
Name: etckeeper
Version: 1.18.8
Release: 0
@ -31,30 +42,38 @@ Group: System/Management
Source: https://git.joeyh.name/index.cgi/etckeeper.git/snapshot/%{name}-%{version}.tar.gz
# PATCH-FIX-UPSTREAM etckeeper-avoid-packagelist.patch gh#joeyh/etckeeper#17 bkbin005@rinku.zaq.ne.jp -- add AVOID_PACKAGELIST
Patch0: etckeeper-avoid-packagelist.patch
Patch1: etckeeper-set-package-manager.patch
Url: http://etckeeper.branchable.com/
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define LPM rpm
Requires: python-base >= 2.7
BuildRequires: make
# added for bzr 2014-07-10 bkbin005@rinku.zaq.ne.jp
BuildRequires: bzr
BuildRequires: python-devel
%if 0%{?suse_version}
# 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}
BuildRequires: libzypp
%define HPM zypper
%else
BuildRequires: yum
Requires: %{name}-cron = %{version}-%{release}
Requires: %{name}-yum-plugin = %{version}-%{release}
%define HPM yum
%if ! %{with bzr}
BuildArch: noarch
%endif
BuildRequires: %{python_versioned}-devel
%if 0%{suse_version} >= 1500
BuildRequires: bash-completion-devel
%else
BuildRequires: bash-completion
%endif
BuildRequires: make
# for the path ownership
BuildRequires: %{python_versioned}-zypp-plugin
BuildRequires: libzypp
BuildRequires: systemd-rpm-macros
%if %{with bzr}
BuildRequires: bzr
%endif
Recommends: git-core
Recommends: %{name}-bash-completion = %{version}-%{release}
Recommends: %{name}-zypp-plugin = %{version}-%{release}
%if %{with bzr}
Recommends: %{name}-bzr = %{version}-%{release}
%endif
%if %{with systemd}
%{?systemd_requires}
Obsoletes: %{name}-cron = %{version}-%{release}
%else
Recommends: %{name}-cron = %{version}-%{release}
%endif
%description
The etckeeper program is a tool to let /etc be stored in a git,
@ -65,118 +84,117 @@ is important for /etc, such as the permissions of /etc/shadow. It is
quite modular and configurable, while also being simple to use if you
understand the basics of working with version control.
%package cron
Summary: The etckeeper cron function
Group: System/Management
%if ! %{with bzr}
BuildArch: noarch
%endif
Requires: etckeeper = %{version}-%{release}
Provides: etckeeper:%{_sysconfdir}/cron.daily/etckeeper
%if 0%{?suse_version}
Requires: cron
%else
Requires: crontabs
%endif
%description cron
The etckeeper-cron calls etckeeper from cron.
%if 0%{?suse_version}
%package zypp-plugin
Summary: The etckeeper integration function with ZYpp
Group: System/Management
%if ! %{with bzr}
BuildArch: noarch
%endif
Requires: %{python_versioned}-zypp-plugin
Requires: etckeeper = %{version}-%{release}
Requires: zypp-plugin-python
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
%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
%description yum-plugin
The etckeeper-zypp-plugin calls etckeeper from YUM.
%endif
%package bzr
Summary: The etckeeper integration function with bzr
Group: System/Management
Requires: %{python_versioned}-base
Requires: etckeeper = %{version}-%{release}
%description bzr
The etckeeper integration function with bzr
%package bash-completion
Summary: The bash completion for etckeeper
Group: System/Shells
Requires: bash-completion
Requires: etckeeper = %{version}-%{release}
%description bash-completion
Bash command line completion support for %{name}.
%prep
%setup -q
%patch0 -p1
%__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
# rpmlint
find -type f -name ".gitignore" -delete
rm -f ./doc/todo/.mdwn
# use %%{_unitdir} for rpm-based distros
sed -i 's:systemddir=/lib/systemd/system:systemddir=%{_unitdir}:g' Makefile
%patch1 -p1
%build
make %{?_smp_mflags}
find -type f -name ".gitignore" -delete
rm -f ./doc/todo/.mdwn
rm README.md
cp -a doc/README.mdwn README.md
perl -p -i -e 's|%{_bindir}/python|%{_bindir}/%{python_versioned}|g' zypper-etckeeper.py
make %{?_smp_mflags} %{make_args}
%install
make \
DESTDIR="%{buildroot}" \
PYTHON_INSTALL_OPTS="--prefix=%{_prefix} --install-purelib=%{python_sitearch}" \
install
%make_install %{make_args}
%if ! %{with systemd}
install -D debian/cron.daily "%{buildroot}/etc/cron.daily/%{name}"
%endif
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
%service_add_pre etckeeper.timer etckeeper.service
%preun
%service_del_preun etckeeper.service
%service_del_preun etckeeper.timer etckeeper.service
%post
%service_add_post etckeeper.service
%service_add_post etckeeper.timer etckeeper.service
%postun
%service_del_postun etckeeper.service
%service_del_postun etckeeper.timer etckeeper.service
%files
%doc GPL README.md doc
%{_unitdir}/etckeeper*
%doc README.md
%license GPL
%{_unitdir}/etckeeper.timer
%{_unitdir}/etckeeper.service
%{_bindir}/etckeeper
%{_sbindir}/*etckeeper
%dir %{_datadir}/bash-completion
%dir %{_datadir}/bash-completion/completions
%{_datadir}/bash-completion/completions/etckeeper
%{_sbindir}/etckeeper
%{_sbindir}/rcetckeeper
%dir %{_sysconfdir}/etckeeper
%dir %{_sysconfdir}/etckeeper/*.d
%{_sysconfdir}/etckeeper/daily
%config(noreplace) %{_sysconfdir}/etckeeper/etckeeper.conf
%dir %{_sysconfdir}/etckeeper/*.d
%config %{_sysconfdir}/etckeeper/*.d/*
%doc %{_mandir}/man8/etckeeper.8*
%{python_sitearch}/bzrlib/plugins/%{name}/
%{python_sitearch}/bzr_%{name}-*.egg-info
%{_mandir}/man8/etckeeper.8*
%if ! %{with systemd}
%files cron
%config(noreplace) %{_sysconfdir}/cron.daily/etckeeper
%endif
%files bash-completion
%{_datadir}/bash-completion/completions/etckeeper
%if 0%{?suse_version}
%files zypp-plugin
%{_prefix}/lib/zypp/plugins/commit/zypper-etckeeper.py
%else
%files yum-plugin
%config(noreplace) %{_sysconfdir}/yum/pluginconf.d/etckeeper.conf
%{_prefix}/lib/yum-plugins/etckeeper.*
%if %{with bzr}
%files bzr
%{python_sitearch}/bzrlib/plugins/%{name}/
%{python_sitearch}/bzr_%{name}-*.egg-info
%endif
%changelog