]> git.pld-linux.org Git - packages/etckeeper.git/blame - etckeeper.spec
no monkey business on downgrades
[packages/etckeeper.git] / etckeeper.spec
CommitLineData
04edd612 1# TODO:
bc3731ae 2# - Subpackages for yum and apt plugins
cf1e7798 3# - Subpackages for backends (darcs, git, hg)
b11a8e3f 4Summary: Store /etc in a SCM system (git, mercurial, bzr or darcs)
9c5d38f1 5Name: etckeeper
d9348a1f 6Version: 1.18
886b22bc 7Release: 2
1703fc6b 8License: GPL v2+
9c5d38f1 9Group: Applications/System
33d0d13c 10Source0: https://github.com/joeyh/etckeeper/archive/%{version}/%{name}-%{version}.tar.gz
d9348a1f 11# Source0-md5: cfdf340f7dc2c072a13d0a09ee560cb8
886b22bc
ER
12Source1: pre-install.sh
13Source2: post-install.sh
7150bf21 14Patch1: use-libdir.patch
d50be7d4 15Patch2: update-ignore.patch
d9348a1f 16URL: http://etckeeper.branchable.com/
4e56ce8f 17BuildRequires: bzr
49a80e1c 18BuildRequires: python-devel
9c5d38f1
ER
19BuildRequires: rpm-pythonprov
20BuildRequires: rpmbuild(macros) >= 1.219
21BuildRequires: sed >= 4.0
b18058b3 22Requires: findutils
26b55a21 23Requires: mktemp
434b24b3 24Requires: perl-base
b9900fb7 25Requires: poldek >= 0.30.1-7.1
1703fc6b 26Requires: sed >= 4.0
b11a8e3f 27Suggests: %{name}-bzr
d2b41a9d 28Suggests: bash-completion-%{name}
d19ef4bd 29Suggests: git-core >= 1.6.1-1
9c5d38f1 30Obsoletes: yum-etckeeper
b5058f0a 31%if "%{pld_release}" != "ac"
9c5d38f1 32BuildArch: noarch
b5058f0a 33%endif
9c5d38f1
ER
34BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35
886b22bc 36%define _poldekconfdir /etc/poldek
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 44The etckeeper program is a tool to let /etc be stored in a git,
9c5d38f1
ER
45mercurial, bzr or darcs repository. It hooks into APT to automatically
46commit changes made to /etc during package upgrades. It tracks file
47metadata that version control systems do not normally support, but
48that is important for /etc, such as the permissions of /etc/shadow.
49It's quite modular and configurable, while also being simple to use if
50you understand the basics of working with version control.
51
b11a8e3f
ER
52The default backend is git, if want to use a another backend please
53install the appropriate tool (mercurial, darcs or bzr). To use bzr as
54backend, please also install the %{name}-bzr package.
55
56To start using the package please read
57%{_docdir}/%{name}-%{version}/README
58
59%package bzr
60Summary: Support for bzr with etckeeper
61Group: Applications/System
62Requires: %{name} = %{version}-%{release}
63Requires: bzr
64
65%description bzr
66This package provides a bzr backend for etckeeper, if you want to use
67etckeeper with bzr backend, install this package.
68
04edd612
ER
69%package -n bash-completion-%{name}
70Summary: Bash completion routines for %{name}
d19ef4bd
CM
71Group: Applications/Shells
72Requires: %{name} = %{version}-%{release}
73Requires: bash-completion
04edd612 74Obsoletes: etckeeper-bash-completions
d19ef4bd 75
04edd612
ER
76%description -n bash-completion-%{name}
77Bash 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
89find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
90
9c5d38f1
ER
91%build
92%{__make}
93
94%install
95rm -rf $RPM_BUILD_ROOT
886b22bc
ER
96install -d $RPM_BUILD_ROOT{/etc/cron.daily,%{_sysconfdir}/%{name},%{_localstatedir}/cache/%{name}} \
97 $RPM_BUILD_ROOT%{_poldekconfdir}/{pre,post}-install.d
98
9c5d38f1 99%{__make} install \
7150bf21 100 etcdir=/lib \
04b7dd5d
ER
101 LOWLEVEL_PACKAGE_MANAGER=rpm \
102 HIGHLEVEL_PACKAGE_MANAGER=poldek \
b11a8e3f 103 INSTALL="install -p" \
9c5d38f1
ER
104 DESTDIR=$RPM_BUILD_ROOT
105
7150bf21 106mv $RPM_BUILD_ROOT{/lib,%{_sysconfdir}}/%{name}/%{name}.conf
b9900fb7 107mv $RPM_BUILD_ROOT{/lib/bash_completion.d,%{_sysconfdir}}
7150bf21 108
9c5d38f1 109install -p debian/cron.daily $RPM_BUILD_ROOT/etc/cron.daily/%{name}
886b22bc
ER
110install -p %{SOURCE1} $RPM_BUILD_ROOT%{_poldekconfdir}/pre-install.d/%{name}
111install -p %{SOURCE2} $RPM_BUILD_ROOT%{_poldekconfdir}/post-install.d/%{name}
9c5d38f1
ER
112
113%py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
114%py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
115%py_postclean
116
117%clean
118rm -rf $RPM_BUILD_ROOT
119
b11a8e3f 120%post
1703fc6b 121if [ $1 -gt 1 ]; then
b11a8e3f
ER
122 %{_bindir}/%{name} update-ignore
123fi
1703fc6b 124
886b22bc 125%triggerpostun -- %{name} < 1.18-2
b9900fb7
ER
126# don't do anything on --downgrade
127[ $1 -le 1 ] && exit 0
128# poldek itself may be removed
129test -f /etc/poldek/poldek.conf || exit 0
886b22bc 130# remove our hook as "pm command", poldek supports hooks dir now
b9900fb7
ER
131# NOTE: poldek own trigger migrating to hooks dir is invoked after this trigger
132%{__sed} -i -re 's,^pm command = %{_poldeklibdir}/%{name}.sh,#&,' /etc/poldek/poldek.conf
b11a8e3f 133
9c5d38f1
ER
134%files
135%defattr(644,root,root,755)
d9348a1f 136%doc INSTALL
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*
886b22bc
ER
146%attr(755,root,root) %{_poldekconfdir}/pre-install.d/%{name}
147%attr(755,root,root) %{_poldekconfdir}/post-install.d/%{name}
04b7dd5d
ER
148%dir %attr(750,root,root) %{_localstatedir}/cache/%{name}
149
cf1e7798
ER
150# subpackages
151%exclude /lib/etckeeper/commit.d/30bzr-add
152
b11a8e3f
ER
153%files bzr
154%defattr(644,root,root,755)
cf1e7798 155/lib/etckeeper/commit.d/30bzr-add
bc3731ae
CM
156%dir %{py_sitescriptdir}/bzrlib
157%dir %{py_sitescriptdir}/bzrlib/plugins
158%dir %{py_sitescriptdir}/bzrlib/plugins/%{name}
b11a8e3f 159%{py_sitescriptdir}/bzrlib/plugins/%{name}/*.py[co]
b5058f0a 160%if "%{pld_release}" != "ac"
b11a8e3f 161%{py_sitescriptdir}/bzr_etckeeper-*.egg-info
b5058f0a 162%endif
d19ef4bd 163
04edd612 164%files -n bash-completion-%{name}
d19ef4bd
CM
165%defattr(644,root,root,755)
166%{_sysconfdir}/bash_completion.d/%{name}
This page took 0.099149 seconds and 4 git commands to generate.