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