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