]> git.pld-linux.org Git - packages/etckeeper.git/blobdiff - etckeeper.spec
requires diff
[packages/etckeeper.git] / etckeeper.spec
index bc70c1e2327b17df1a82789e9bb282ffbd28cced..a88de205c31e994c64c753afcdf11a00b6b5cf9b 100644 (file)
@@ -1,32 +1,32 @@
 # TODO:
 # - Subpackages for yum and apt plugins
-# - Subpackages for backends (git, etc)
+# - Subpackages for backends (darcs, git, hg)
 Summary:       Store /etc in a SCM system (git, mercurial, bzr or darcs)
 Name:          etckeeper
-Version:       1.1
-Release:       0.27
+Version:       1.18.4
+Release:       1
 License:       GPL v2+
 Group:         Applications/System
-Source0:       http://ftp.debian.org/debian/pool/main/e/etckeeper/%{name}_%{version}.tar.gz
-# Source0-md5: 280f75205940f99f8f0295bb8ec3598f
-Source1:       poldek.sh
-Patch0:                type-mksh.patch
+Source0:       https://github.com/joeyh/etckeeper/archive/%{version}/%{name}-%{version}.tar.gz
+# Source0-md5: 0d9f38775cabb7eae9be9cabbf8e17e1
+Source1:       pre-install.sh
+Source2:       post-install.sh
 Patch1:                use-libdir.patch
 Patch2:                update-ignore.patch
-URL:           http://kitenet.net/~joey/code/etckeeper/
+URL:           http://etckeeper.branchable.com/
 BuildRequires: bzr
+BuildRequires: python-devel
 BuildRequires: rpm-pythonprov
-BuildRequires: rpmbuild(macros) >= 1.219
+BuildRequires: rpmbuild(macros) >= 1.717
 BuildRequires: sed >= 4.0
+Requires:      diffutils
 Requires:      findutils
 Requires:      mktemp
 Requires:      perl-base
+Requires:      poldek >= 0.30.1-7.1
 Requires:      sed >= 4.0
-%if "%{pld_release}" != "ac"
-Requires:      poldek >= 0.30.0-1.rc7.4
-%endif
-Suggests:      %{name}-bash-completions
 Suggests:      %{name}-bzr
+Suggests:      bash-completion-%{name}
 Suggests:      git-core >= 1.6.1-1
 Obsoletes:     yum-etckeeper
 %if "%{pld_release}" != "ac"
@@ -34,6 +34,7 @@ BuildArch:    noarch
 %endif
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
+%define                _poldekconfdir  /etc/poldek
 %if "%{pld_release}" != "ac"
 %define                _poldeklibdir   %{_prefix}/lib/poldek
 %else
@@ -77,10 +78,7 @@ Obsoletes:   etckeeper-bash-completions
 Bash completion routines for etckeeper.
 
 %prep
-%setup -qc
-mv %{name} .tmp
-mv .tmp/* .
-%patch0 -p1
+%setup -q
 %patch1 -p1
 %patch2 -p1
 %{__sed} -i -e '
@@ -88,6 +86,8 @@ mv .tmp/* .
        s|LOWLEVEL_PACKAGE_MANAGER=dpkg|LOWLEVEL_PACKAGE_MANAGER=rpm|;
 ' %{name}.conf
 
+%{__sed} -i -e 's#$(prefix)/lib/systemd#/lib/systemd#' Makefile
+
 # cleanup backups after patching
 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
 
@@ -96,19 +96,22 @@ find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{/etc/cron.daily,%{_sysconfdir}/%{name},%{_localstatedir}/cache/%{name},%{_poldeklibdir}}
+install -d $RPM_BUILD_ROOT{/etc/cron.daily,%{_sysconfdir}/%{name},%{_localstatedir}/cache/%{name}} \
+       $RPM_BUILD_ROOT%{_poldekconfdir}/{pre,post}-install.d
+
 %{__make} install \
        etcdir=/lib \
        LOWLEVEL_PACKAGE_MANAGER=rpm \
        HIGHLEVEL_PACKAGE_MANAGER=poldek \
+       PYTHON_INSTALL_OPTS="%py_install_opts" \
        INSTALL="install -p" \
        DESTDIR=$RPM_BUILD_ROOT
 
 mv $RPM_BUILD_ROOT{/lib,%{_sysconfdir}}/%{name}/%{name}.conf
-mv $RPM_BUILD_ROOT{/lib/bash_completion.d,/etc}
 
 install -p debian/cron.daily $RPM_BUILD_ROOT/etc/cron.daily/%{name}
-install -p %{SOURCE1} $RPM_BUILD_ROOT%{_poldeklibdir}/%{name}.sh
+install -p %{SOURCE1} $RPM_BUILD_ROOT%{_poldekconfdir}/pre-install.d/%{name}
+install -p %{SOURCE2} $RPM_BUILD_ROOT%{_poldekconfdir}/post-install.d/%{name}
 
 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
@@ -122,21 +125,18 @@ if [ $1 -gt 1 ]; then
        %{_bindir}/%{name} update-ignore
 fi
 
-%triggerin -- poldek
-# add our hook as "pm command"
-if [ -f /etc/poldek/poldek.conf ] && ! grep -q '^pm command = %{_poldeklibdir}/%{name}.sh' /etc/poldek/poldek.conf; then
-       %{__sed} -i -re 's,#?(pm command =).*,\1 %{_poldeklibdir}/%{name}.sh,' /etc/poldek/poldek.conf
-fi
-
-%triggerun -- poldek
-# remove our hook as "pm command"
-if [ "$1" -eq 0 ] && [ -f /etc/poldek/poldek.conf ]; then
-       %{__sed} -i -re 's,^pm command = %{_poldeklibdir}/%{name}.sh,#&,' /etc/poldek/poldek.conf
-fi
+%triggerpostun -- %{name} < 1.18-2
+# don't do anything on --downgrade
+[ $1 -le 1 ] && exit 0
+# poldek itself may be removed
+test -f /etc/poldek/poldek.conf || exit 0
+# remove our hook as "pm command", poldek supports hooks dir now
+# NOTE: poldek own trigger migrating to hooks dir is invoked after this trigger
+%{__sed} -i -re 's,^pm command = %{_poldeklibdir}/%{name}.sh,#&,' /etc/poldek/poldek.conf
 
 %files
 %defattr(644,root,root,755)
-%doc INSTALL TODO README
+%doc doc/README.mdwn doc/install.mdwn
 %dir %{_sysconfdir}/%{name}
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/%{name}.conf
 %dir /lib/%{name}
@@ -146,11 +146,19 @@ fi
 %attr(755,root,root) /etc/cron.daily/%{name}
 %attr(755,root,root) %{_bindir}/%{name}
 %{_mandir}/man8/%{name}.8*
-%attr(755,root,root) %{_poldeklibdir}/%{name}.sh
+%attr(755,root,root) %{_poldekconfdir}/pre-install.d/%{name}
+%attr(755,root,root) %{_poldekconfdir}/post-install.d/%{name}
 %dir %attr(750,root,root) %{_localstatedir}/cache/%{name}
 
+%{systemdunitdir}/etckeeper.service
+%{systemdunitdir}/etckeeper.timer
+
+# subpackages
+%exclude /lib/etckeeper/commit.d/30bzr-add
+
 %files bzr
 %defattr(644,root,root,755)
+/lib/etckeeper/commit.d/30bzr-add
 %dir %{py_sitescriptdir}/bzrlib
 %dir %{py_sitescriptdir}/bzrlib/plugins
 %dir %{py_sitescriptdir}/bzrlib/plugins/%{name}
@@ -161,4 +169,4 @@ fi
 
 %files -n bash-completion-%{name}
 %defattr(644,root,root,755)
-%{_sysconfdir}/bash_completion.d/%{name}
+%{bash_compdir}/etckeeper
This page took 0.091031 seconds and 4 git commands to generate.