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