]> git.pld-linux.org Git - packages/etckeeper.git/blob - etckeeper.spec
- up to 1.18.18
[packages/etckeeper.git] / etckeeper.spec
1 # TODO:
2 # - Subpackages for yum and apt plugins
3 # - Subpackages for backends (darcs, git, hg)
4 Summary:        Store /etc in a SCM system (git, mercurial, bzr or darcs)
5 Name:           etckeeper
6 Version:        1.18.18
7 Release:        1
8 License:        GPL v2+
9 Group:          Applications/System
10 Source0:        https://git.joeyh.name/index.cgi/etckeeper.git/snapshot/%{name}-%{version}.tar.gz
11 # Source0-md5:  2539b082a5c813fae3c1e0d5a6f27b95
12 Source1:        pre-install.sh
13 Source2:        post-install.sh
14 Source3:        https://ftp.debian.org/debian/pool/main/e/etckeeper/etckeeper_%{version}-1.debian.tar.xz
15 # Source3-md5:  f0499366768f9809a36f94b9c4c020d9
16 Patch1:         use-libdir.patch
17 Patch2:         update-ignore.patch
18 URL:            http://etckeeper.branchable.com/
19 BuildRequires:  bzr
20 BuildRequires:  python-devel
21 BuildRequires:  rpm-pythonprov
22 BuildRequires:  rpmbuild(macros) >= 1.717
23 BuildRequires:  sed >= 4.0
24 Requires:       diffutils
25 Requires:       findutils
26 Requires:       mktemp
27 Requires:       perl-base
28 Requires:       poldek >= 0.30.1-7.1
29 Requires:       sed >= 4.0
30 Suggests:       %{name}-bzr
31 Suggests:       bash-completion-%{name}
32 Suggests:       git-core >= 1.6.1-1
33 Obsoletes:      yum-etckeeper
34 %if "%{pld_release}" != "ac"
35 BuildArch:      noarch
36 %endif
37 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38
39 %define         _poldekconfdir  /etc/poldek
40 %if "%{pld_release}" != "ac"
41 %define         _poldeklibdir   %{_prefix}/lib/poldek
42 %else
43 %define         _poldeklibdir   %{_libdir}/poldek
44 %endif
45
46 %description
47 The etckeeper program is a tool to let /etc be stored in a git,
48 mercurial, bzr or darcs repository. It hooks into APT to automatically
49 commit changes made to /etc during package upgrades. It tracks file
50 metadata that version control systems do not normally support, but
51 that is important for /etc, such as the permissions of /etc/shadow.
52 It's quite modular and configurable, while also being simple to use if
53 you understand the basics of working with version control.
54
55 The default backend is git, if want to use a another backend please
56 install the appropriate tool (mercurial, darcs or bzr). To use bzr as
57 backend, please also install the %{name}-bzr package.
58
59 To start using the package please read
60 %{_docdir}/%{name}-%{version}/README
61
62 %package bzr
63 Summary:        Support for bzr with etckeeper
64 Group:          Applications/System
65 Requires:       %{name} = %{version}-%{release}
66 Requires:       bzr
67
68 %description bzr
69 This package provides a bzr backend for etckeeper, if you want to use
70 etckeeper with bzr backend, install this package.
71
72 %package -n bash-completion-%{name}
73 Summary:        Bash completion routines for %{name}
74 Group:          Applications/Shells
75 Requires:       %{name} = %{version}-%{release}
76 Requires:       bash-completion
77 Obsoletes:      etckeeper-bash-completions
78
79 %description -n bash-completion-%{name}
80 Bash completion routines for etckeeper.
81
82 %prep
83 %setup -q -a3
84 %patch1 -p1
85 %patch2 -p1
86
87 patch -p1 < debian/patches/0002-Default-to-UTF8-encoding-for-consistent-ordering.patch || exit 1
88
89 %{__sed} -i -e '
90         s|HIGHLEVEL_PACKAGE_MANAGER=apt|HIGHLEVEL_PACKAGE_MANAGER=poldek|;
91         s|LOWLEVEL_PACKAGE_MANAGER=dpkg|LOWLEVEL_PACKAGE_MANAGER=rpm|;
92 ' %{name}.conf
93
94 # cleanup backups after patching
95 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
96
97 %build
98 %{__make}
99
100 %install
101 rm -rf $RPM_BUILD_ROOT
102 install -d $RPM_BUILD_ROOT{/etc/cron.daily,%{_sysconfdir}/%{name},%{_localstatedir}/cache/%{name}} \
103         $RPM_BUILD_ROOT%{_poldekconfdir}/{pre,post}-install.d
104
105 %{__make} install \
106         etcdir=/lib \
107         LOWLEVEL_PACKAGE_MANAGER=rpm \
108         HIGHLEVEL_PACKAGE_MANAGER=poldek \
109         PYTHON_INSTALL_OPTS="%py_install_opts" \
110         INSTALL="install -p" \
111         DESTDIR=$RPM_BUILD_ROOT
112
113 mv $RPM_BUILD_ROOT{/lib,%{_sysconfdir}}/%{name}/%{name}.conf
114
115 install -p debian/cron.daily $RPM_BUILD_ROOT/etc/cron.daily/%{name}
116 install -p %{SOURCE1} $RPM_BUILD_ROOT%{_poldekconfdir}/pre-install.d/%{name}
117 install -p %{SOURCE2} $RPM_BUILD_ROOT%{_poldekconfdir}/post-install.d/%{name}
118
119 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
120 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
121 %py_postclean
122
123 %clean
124 rm -rf $RPM_BUILD_ROOT
125
126 %post
127 if [ $1 -gt 1 ]; then
128         %{_bindir}/%{name} update-ignore
129 fi
130
131 %triggerpostun -- %{name} < 1.18-2
132 # don't do anything on --downgrade
133 [ $1 -le 1 ] && exit 0
134 # poldek itself may be removed
135 test -f /etc/poldek/poldek.conf || exit 0
136 # remove our hook as "pm command", poldek supports hooks dir now
137 # NOTE: poldek own trigger migrating to hooks dir is invoked after this trigger
138 %{__sed} -i -re 's,^pm command = %{_poldeklibdir}/%{name}.sh,#&,' /etc/poldek/poldek.conf
139
140 %files
141 %defattr(644,root,root,755)
142 %doc doc/README.mdwn doc/install.mdwn
143 %dir %{_sysconfdir}/%{name}
144 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/%{name}.conf
145 %dir /lib/%{name}
146 %dir /lib/%{name}/*.d
147 %attr(755,root,root) /lib/%{name}/daily
148 %attr(755,root,root) /lib/%{name}/*.d/[0-9]*
149 /lib/%{name}/*.d/README
150 %attr(755,root,root) /etc/cron.daily/%{name}
151 %attr(755,root,root) %{_bindir}/%{name}
152 %{_mandir}/man8/%{name}.8*
153 %attr(755,root,root) %{_poldekconfdir}/pre-install.d/%{name}
154 %attr(755,root,root) %{_poldekconfdir}/post-install.d/%{name}
155 %dir %attr(750,root,root) %{_localstatedir}/cache/%{name}
156
157 %{systemdunitdir}/etckeeper.service
158 %{systemdunitdir}/etckeeper.timer
159
160 # subpackages
161 %exclude /lib/etckeeper/commit.d/30bzr-add
162
163 %files bzr
164 %defattr(644,root,root,755)
165 /lib/etckeeper/commit.d/30bzr-add
166 %dir %{py_sitescriptdir}/bzrlib
167 %dir %{py_sitescriptdir}/bzrlib/plugins
168 %dir %{py_sitescriptdir}/bzrlib/plugins/%{name}
169 %{py_sitescriptdir}/bzrlib/plugins/%{name}/*.py[co]
170 %if "%{pld_release}" != "ac"
171 %{py_sitescriptdir}/bzr_etckeeper-*.egg-info
172 %endif
173
174 %files -n bash-completion-%{name}
175 %defattr(644,root,root,755)
176 %{bash_compdir}/etckeeper
This page took 0.11285 seconds and 3 git commands to generate.