2 # - Subpackages for yum and apt plugins
3 # - Subpackages for backends (darcs, git, hg)
4 Summary: Store /etc in a SCM system (git, mercurial, bzr or darcs)
9 Group: Applications/System
10 Source0: https://git.joeyh.name/index.cgi/etckeeper.git/snapshot/%{name}-%{version}.tar.gz
11 # Source0-md5: fde6b3dc09b4ce75fa4faf4dabbb2d4a
12 Source1: pre-install.sh
13 Source2: post-install.sh
14 Source3: https://ftp.debian.org/debian/pool/main/e/etckeeper/etckeeper_%{version}-1.debian.tar.xz
15 # Source3-md5: 07bcade67ac5ab7bf1ea7d97a42f2d18
16 Patch1: use-libdir.patch
17 Patch2: update-ignore.patch
18 URL: http://etckeeper.branchable.com/
20 BuildRequires: python-devel
21 BuildRequires: rpm-pythonprov
22 BuildRequires: rpmbuild(macros) >= 1.717
23 BuildRequires: sed >= 4.0
28 Requires: poldek >= 0.30.1-7.1
31 Suggests: bash-completion-%{name}
32 Suggests: git-core >= 1.6.1-1
33 Obsoletes: yum-etckeeper
34 %if "%{pld_release}" != "ac"
37 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39 %define _poldekconfdir /etc/poldek
40 %if "%{pld_release}" != "ac"
41 %define _poldeklibdir %{_prefix}/lib/poldek
43 %define _poldeklibdir %{_libdir}/poldek
47 The etckeeper program is a tool to let /etc be stored in a git,
48 mercurial, bzr or darcs repository. It hooks into APT to automatically
49 commit changes made to /etc during package upgrades. It tracks file
50 metadata that version control systems do not normally support, but
51 that is important for /etc, such as the permissions of /etc/shadow.
52 It's quite modular and configurable, while also being simple to use if
53 you understand the basics of working with version control.
55 The default backend is git, if want to use a another backend please
56 install the appropriate tool (mercurial, darcs or bzr). To use bzr as
57 backend, please also install the %{name}-bzr package.
59 To start using the package please read
60 %{_docdir}/%{name}-%{version}/README
63 Summary: Support for bzr with etckeeper
64 Group: Applications/System
65 Requires: %{name} = %{version}-%{release}
69 This package provides a bzr backend for etckeeper, if you want to use
70 etckeeper with bzr backend, install this package.
72 %package -n bash-completion-%{name}
73 Summary: Bash completion routines for %{name}
74 Group: Applications/Shells
75 Requires: %{name} = %{version}-%{release}
76 Requires: bash-completion
77 Obsoletes: etckeeper-bash-completions
79 %description -n bash-completion-%{name}
80 Bash completion routines for etckeeper.
87 patch -p1 < debian/patches/0002-Default-to-UTF8-encoding-for-consistent-ordering.patch || exit 1
90 s|HIGHLEVEL_PACKAGE_MANAGER=apt|HIGHLEVEL_PACKAGE_MANAGER=poldek|;
91 s|LOWLEVEL_PACKAGE_MANAGER=dpkg|LOWLEVEL_PACKAGE_MANAGER=rpm|;
94 # cleanup backups after patching
95 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
101 rm -rf $RPM_BUILD_ROOT
102 install -d $RPM_BUILD_ROOT{/etc/cron.daily,%{_sysconfdir}/%{name},%{_localstatedir}/cache/%{name}} \
103 $RPM_BUILD_ROOT%{_poldekconfdir}/{pre,post}-install.d
107 LOWLEVEL_PACKAGE_MANAGER=rpm \
108 HIGHLEVEL_PACKAGE_MANAGER=poldek \
109 PYTHON_INSTALL_OPTS="%py_install_opts" \
110 INSTALL="install -p" \
111 DESTDIR=$RPM_BUILD_ROOT
113 mv $RPM_BUILD_ROOT{/lib,%{_sysconfdir}}/%{name}/%{name}.conf
115 install -p debian/cron.daily $RPM_BUILD_ROOT/etc/cron.daily/%{name}
116 install -p %{SOURCE1} $RPM_BUILD_ROOT%{_poldekconfdir}/pre-install.d/%{name}
117 install -p %{SOURCE2} $RPM_BUILD_ROOT%{_poldekconfdir}/post-install.d/%{name}
119 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
120 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
124 rm -rf $RPM_BUILD_ROOT
127 if [ $1 -gt 1 ]; then
128 %{_bindir}/%{name} update-ignore
131 %triggerpostun -- %{name} < 1.18-2
132 # don't do anything on --downgrade
133 [ $1 -le 1 ] && exit 0
134 # poldek itself may be removed
135 test -f /etc/poldek/poldek.conf || exit 0
136 # remove our hook as "pm command", poldek supports hooks dir now
137 # NOTE: poldek own trigger migrating to hooks dir is invoked after this trigger
138 %{__sed} -i -re 's,^pm command = %{_poldeklibdir}/%{name}.sh,#&,' /etc/poldek/poldek.conf
141 %defattr(644,root,root,755)
142 %doc doc/README.mdwn doc/install.mdwn
143 %dir %{_sysconfdir}/%{name}
144 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/%{name}.conf
146 %dir /lib/%{name}/*.d
147 %attr(755,root,root) /lib/%{name}/daily
148 %attr(755,root,root) /lib/%{name}/*.d/[0-9]*
149 /lib/%{name}/*.d/README
150 %attr(755,root,root) /etc/cron.daily/%{name}
151 %attr(755,root,root) %{_bindir}/%{name}
152 %{_mandir}/man8/%{name}.8*
153 %attr(755,root,root) %{_poldekconfdir}/pre-install.d/%{name}
154 %attr(755,root,root) %{_poldekconfdir}/post-install.d/%{name}
155 %dir %attr(750,root,root) %{_localstatedir}/cache/%{name}
157 %{systemdunitdir}/etckeeper.service
158 %{systemdunitdir}/etckeeper.timer
161 %exclude /lib/etckeeper/commit.d/30bzr-add
164 %defattr(644,root,root,755)
165 /lib/etckeeper/commit.d/30bzr-add
166 %dir %{py_sitescriptdir}/bzrlib
167 %dir %{py_sitescriptdir}/bzrlib/plugins
168 %dir %{py_sitescriptdir}/bzrlib/plugins/%{name}
169 %{py_sitescriptdir}/bzrlib/plugins/%{name}/*.py[co]
170 %if "%{pld_release}" != "ac"
171 %{py_sitescriptdir}/bzr_etckeeper-*.egg-info
174 %files -n bash-completion-%{name}
175 %defattr(644,root,root,755)
176 %{bash_compdir}/etckeeper