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