From 6dbe44dd823ee34e8d69b8f677139f521a4a474c53d0d641347c5842168d61a7 Mon Sep 17 00:00:00 2001 From: Mitsutoshi NAKANO Date: Mon, 24 Sep 2018 06:11:23 +0000 Subject: [PATCH 1/3] Accepting request 636715 from home:darix:playground - obsolete cron sub package on systemd machines - use %license - 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 OBS-URL: https://build.opensuse.org/request/show/636715 OBS-URL: https://build.opensuse.org/package/show/utilities/etckeeper?expand=0&rev=19 --- etckeeper-set-package-manager.patch | 18 +++ etckeeper.changes | 41 +++++++ etckeeper.spec | 172 +++++++++++++++------------- 3 files changed, 152 insertions(+), 79 deletions(-) create mode 100644 etckeeper-set-package-manager.patch diff --git a/etckeeper-set-package-manager.patch b/etckeeper-set-package-manager.patch new file mode 100644 index 0000000..0e4bc1b --- /dev/null +++ b/etckeeper-set-package-manager.patch @@ -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 diff --git a/etckeeper.changes b/etckeeper.changes index ebecb9c..7f00ee4 100644 --- a/etckeeper.changes +++ b/etckeeper.changes @@ -1,3 +1,44 @@ +------------------------------------------------------------------- +Thu Sep 13 07:34:35 UTC 2018 - Marcus Rueckert + +- obsolete cron sub package on systemd machines + +------------------------------------------------------------------- +Thu Sep 13 07:29:24 UTC 2018 - Marcus Rueckert + +- use %license + +------------------------------------------------------------------- +Wed Sep 12 23:31:38 UTC 2018 - Marcus Rueckert + +- 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 diff --git a/etckeeper.spec b/etckeeper.spec index 0df2a66..f6c569e 100644 --- a/etckeeper.spec +++ b/etckeeper.spec @@ -19,9 +19,20 @@ # -# 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,113 @@ 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. - +%if ! %{with systemd} %package cron Summary: The etckeeper cron function Group: System/Management 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. +%endif - -%if 0%{?suse_version} %package zypp-plugin Summary: The etckeeper integration function with ZYpp Group: System/Management +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 + +%if %{with bzr} +%package bzr +Summary: The etckeeper integration function with bzr 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. +Requires: %{python_versioned}-base +%description bzr +The etckeeper integration function with bzr %endif +%package bash-completion +Summary: The bash completion for etckeeper +Group: System/Management +Requires: etckeeper = %{version}-%{release} +Requires: bash-completion +%description bash-completion +The bash completion for etckeeper. + %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 DESTDIR="%{buildroot}" %{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 From 3024afeb55e3efbafd5a4b7ce75ff24a13f1ab0c4928d978377777c2312a4410 Mon Sep 17 00:00:00 2001 From: Mitsutoshi NAKANO Date: Sun, 30 Sep 2018 07:43:38 +0000 Subject: [PATCH 2/3] Accepting request 639223 from home:Mitsutoshi:branches:utilities - indicated that subpackages are noarch. - modified the description longer. OBS-URL: https://build.opensuse.org/request/show/639223 OBS-URL: https://build.opensuse.org/package/show/utilities/etckeeper?expand=0&rev=20 --- etckeeper.changes | 6 ++++++ etckeeper.spec | 14 +++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/etckeeper.changes b/etckeeper.changes index 7f00ee4..99b9aa4 100644 --- a/etckeeper.changes +++ b/etckeeper.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +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 diff --git a/etckeeper.spec b/etckeeper.spec index f6c569e..cee8607 100644 --- a/etckeeper.spec +++ b/etckeeper.spec @@ -88,6 +88,9 @@ 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 Requires: cron @@ -99,6 +102,9 @@ The etckeeper-cron calls etckeeper from cron. %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} Obsoletes: etckeeper-pkgmanager-collabo < %{version}-%{release} @@ -112,8 +118,9 @@ The etckeeper-zypp-plugin calls etckeeper from ZYpp. %package bzr Summary: The etckeeper integration function with bzr Group: System/Management -Requires: etckeeper = %{version}-%{release} Requires: %{python_versioned}-base +Requires: etckeeper = %{version}-%{release} + %description bzr The etckeeper integration function with bzr %endif @@ -121,10 +128,11 @@ The etckeeper integration function with bzr %package bash-completion Summary: The bash completion for etckeeper Group: System/Management -Requires: etckeeper = %{version}-%{release} Requires: bash-completion +Requires: etckeeper = %{version}-%{release} + %description bash-completion -The bash completion for etckeeper. +Bash command line completion support for %{name}. %prep %setup -q From 58b8681a168a1fd64e80cc3cf13eb6d533ba6692bdc498935f06d66bbcafd591 Mon Sep 17 00:00:00 2001 From: Mitsutoshi NAKANO Date: Sat, 6 Oct 2018 00:16:35 +0000 Subject: [PATCH 3/3] Accepting request 639554 from home:jengelh:branches:utilities - Remove idempotent %if..%endif guards. - Fix incorrect trailing slash in make install line. - Update RPM group for bash-completion. OBS-URL: https://build.opensuse.org/request/show/639554 OBS-URL: https://build.opensuse.org/package/show/utilities/etckeeper?expand=0&rev=21 --- etckeeper.changes | 7 +++++++ etckeeper.spec | 10 +++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/etckeeper.changes b/etckeeper.changes index 99b9aa4..cb347d5 100644 --- a/etckeeper.changes +++ b/etckeeper.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Oct 2 09:38:10 UTC 2018 - Jan Engelhardt + +- 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 diff --git a/etckeeper.spec b/etckeeper.spec index cee8607..b3abaf7 100644 --- a/etckeeper.spec +++ b/etckeeper.spec @@ -15,7 +15,7 @@ # 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/ # @@ -84,7 +84,6 @@ 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. -%if ! %{with systemd} %package cron Summary: The etckeeper cron function Group: System/Management @@ -97,7 +96,6 @@ Requires: cron %description cron The etckeeper-cron calls etckeeper from cron. -%endif %package zypp-plugin Summary: The etckeeper integration function with ZYpp @@ -114,7 +112,6 @@ Provides: etckeeper:%{_prefix}/lib/zypp/plugins/commit/zypper-etckeeper.py %description zypp-plugin The etckeeper-zypp-plugin calls etckeeper from ZYpp. -%if %{with bzr} %package bzr Summary: The etckeeper integration function with bzr Group: System/Management @@ -123,11 +120,10 @@ Requires: etckeeper = %{version}-%{release} %description bzr The etckeeper integration function with bzr -%endif %package bash-completion Summary: The bash completion for etckeeper -Group: System/Management +Group: System/Shells Requires: bash-completion Requires: etckeeper = %{version}-%{release} @@ -148,7 +144,7 @@ perl -p -i -e 's|%{_bindir}/python|%{_bindir}/%{python_versioned}|g' zypper-etck make %{?_smp_mflags} %{make_args} %install -make install DESTDIR="%{buildroot}" %{make_args} \ +%make_install %{make_args} %if ! %{with systemd} install -D debian/cron.daily "%{buildroot}/etc/cron.daily/%{name}" %endif