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