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