]> git.pld-linux.org Git - packages/etckeeper.git/blame - etckeeper.spec
cleanup backups after patching
[packages/etckeeper.git] / etckeeper.spec
CommitLineData
04edd612 1# TODO:
bc3731ae 2# - Subpackages for yum and apt plugins
04edd612 3# - Subpackages for backends (git, etc)
b11a8e3f 4Summary: Store /etc in a SCM system (git, mercurial, bzr or darcs)
9c5d38f1 5Name: etckeeper
97da4513 6Version: 1.1
6be06498 7Release: 0.16
1703fc6b 8License: GPL v2+
9c5d38f1
ER
9Group: Applications/System
10Source0: http://ftp.debian.org/debian/pool/main/e/etckeeper/%{name}_%{version}.tar.gz
97da4513 11# Source0-md5: 280f75205940f99f8f0295bb8ec3598f
1703fc6b 12Source1: poldek.sh
26b55a21 13Patch0: type-mksh.patch
9c5d38f1 14URL: http://kitenet.net/~joey/code/etckeeper/
4e56ce8f 15BuildRequires: bzr
9c5d38f1
ER
16BuildRequires: rpm-pythonprov
17BuildRequires: rpmbuild(macros) >= 1.219
18BuildRequires: sed >= 4.0
26b55a21 19Requires: mktemp
434b24b3 20Requires: perl-base
1703fc6b
ER
21Requires: poldek >= 0.30.0-1.rc7.4
22Requires: sed >= 4.0
d19ef4bd 23Suggests: %{name}-bash-completions
b11a8e3f 24Suggests: %{name}-bzr
d19ef4bd 25Suggests: git-core >= 1.6.1-1
9c5d38f1
ER
26Obsoletes: yum-etckeeper
27BuildArch: noarch
28BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29
1703fc6b
ER
30%define _poldeklibdir %{_prefix}/lib/poldek
31
9c5d38f1 32%description
b11a8e3f 33The etckeeper program is a tool to let /etc be stored in a git,
9c5d38f1
ER
34mercurial, bzr or darcs repository. It hooks into APT to automatically
35commit changes made to /etc during package upgrades. It tracks file
36metadata that version control systems do not normally support, but
37that is important for /etc, such as the permissions of /etc/shadow.
38It's quite modular and configurable, while also being simple to use if
39you understand the basics of working with version control.
40
b11a8e3f
ER
41The default backend is git, if want to use a another backend please
42install the appropriate tool (mercurial, darcs or bzr). To use bzr as
43backend, please also install the %{name}-bzr package.
44
45To start using the package please read
46%{_docdir}/%{name}-%{version}/README
47
48%package bzr
49Summary: Support for bzr with etckeeper
50Group: Applications/System
51Requires: %{name} = %{version}-%{release}
52Requires: bzr
53
54%description bzr
55This package provides a bzr backend for etckeeper, if you want to use
56etckeeper with bzr backend, install this package.
57
04edd612
ER
58%package -n bash-completion-%{name}
59Summary: Bash completion routines for %{name}
d19ef4bd
CM
60Group: Applications/Shells
61Requires: %{name} = %{version}-%{release}
62Requires: bash-completion
04edd612 63Obsoletes: etckeeper-bash-completions
d19ef4bd 64
04edd612
ER
65%description -n bash-completion-%{name}
66Bash completion routines for etckeeper.
d19ef4bd 67
9c5d38f1 68%prep
fe7cbb49
ER
69%setup -qc
70mv %{name} .tmp
71mv .tmp/* .
26b55a21 72%patch0 -p1
9c5d38f1 73%{__sed} -i -e '
bc3731ae 74 s|HIGHLEVEL_PACKAGE_MANAGER=apt|HIGHLEVEL_PACKAGE_MANAGER=poldek|;
9c5d38f1
ER
75 s|LOWLEVEL_PACKAGE_MANAGER=dpkg|LOWLEVEL_PACKAGE_MANAGER=rpm|;
76' %{name}.conf
77
6be06498
ER
78# cleanup backups after patching
79find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
80
9c5d38f1
ER
81%build
82%{__make}
83
84%install
85rm -rf $RPM_BUILD_ROOT
1703fc6b 86install -d $RPM_BUILD_ROOT{/etc/cron.daily,%{_localstatedir}/cache/%{name},%{_poldeklibdir}}
9c5d38f1 87%{__make} install \
04b7dd5d
ER
88 LOWLEVEL_PACKAGE_MANAGER=rpm \
89 HIGHLEVEL_PACKAGE_MANAGER=poldek \
b11a8e3f 90 INSTALL="install -p" \
9c5d38f1
ER
91 DESTDIR=$RPM_BUILD_ROOT
92
93install -p debian/cron.daily $RPM_BUILD_ROOT/etc/cron.daily/%{name}
1703fc6b 94install -p %{SOURCE1} $RPM_BUILD_ROOT%{_poldeklibdir}/%{name}.sh
9c5d38f1
ER
95
96%py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
97%py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
98%py_postclean
99
100%clean
101rm -rf $RPM_BUILD_ROOT
102
b11a8e3f 103%post
1703fc6b 104if [ $1 -gt 1 ]; then
b11a8e3f
ER
105 %{_bindir}/%{name} update-ignore
106fi
1703fc6b
ER
107
108%triggerin -- poldek
109# add our hook as "pm command"
110if [ -f /etc/poldek/poldek.conf ] && ! grep -q '^pm command = %{_poldeklibdir}/%{name}.sh' /etc/poldek/poldek.conf; then
111 %{__sed} -i -re 's,#?(pm command =).*,\1 %{_poldeklibdir}/%{name}.sh,' /etc/poldek/poldek.conf
112fi
113
114%triggerun -- poldek
115# remove our hook as "pm command"
116if [ "$1" -eq 0 ] && [ -f /etc/poldek/poldek.conf ]; then
117 %{__sed} -i -re 's,^pm command = %{_poldeklibdir}/%{name}.sh,#&,' /etc/poldek/poldek.conf
118fi
b11a8e3f 119
9c5d38f1
ER
120%files
121%defattr(644,root,root,755)
b11a8e3f 122%doc INSTALL TODO README
9c5d38f1 123%dir %{_sysconfdir}/%{name}
9c5d38f1 124%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/%{name}.conf
bc3731ae 125%dir %{_sysconfdir}/%{name}/*.d
8a60c6ac
CM
126%attr(755,root,root) %{_sysconfdir}/%{name}/*.d/[0-9]*
127%{_sysconfdir}/%{name}/*.d/README
9c5d38f1
ER
128
129%attr(755,root,root) /etc/cron.daily/%{name}
b11a8e3f 130%attr(755,root,root) %{_bindir}/%{name}
1703fc6b 131%attr(755,root,root) %{_poldeklibdir}/%{name}.sh
b11a8e3f 132%{_mandir}/man8/%{name}.8*
9c5d38f1 133
04b7dd5d
ER
134%dir %attr(750,root,root) %{_localstatedir}/cache/%{name}
135
b11a8e3f
ER
136%files bzr
137%defattr(644,root,root,755)
bc3731ae
CM
138%dir %{py_sitescriptdir}/bzrlib
139%dir %{py_sitescriptdir}/bzrlib/plugins
140%dir %{py_sitescriptdir}/bzrlib/plugins/%{name}
b11a8e3f
ER
141%{py_sitescriptdir}/bzrlib/plugins/%{name}/*.py[co]
142%{py_sitescriptdir}/bzr_etckeeper-*.egg-info
d19ef4bd 143
04edd612 144%files -n bash-completion-%{name}
d19ef4bd
CM
145%defattr(644,root,root,755)
146%{_sysconfdir}/bash_completion.d/%{name}
This page took 0.077982 seconds and 4 git commands to generate.