[partimage] Patched for zlib >= 1.2.6. Dropped compat-db.

Paulo Roma Cavalcanti roma at fedoraproject.org
Thu Sep 20 12:11:24 UTC 2012


commit db02dc7ad824c36eab0fca88f01791a89f4f1633
Author: Paulo Roma Cavalcanti <promac at gmail.com>
Date:   Thu Sep 20 09:10:42 2012 -0300

    Patched for zlib >= 1.2.6.
    Dropped compat-db.

 partimage-0.6.9-gzFile.patch |   33 ++++++++++++++++++++++++++++++++
 partimage.spec               |   43 ++++++++++++++++++++++-------------------
 2 files changed, 56 insertions(+), 20 deletions(-)
---
diff --git a/partimage-0.6.9-gzFile.patch b/partimage-0.6.9-gzFile.patch
new file mode 100644
index 0000000..eaf791a
--- /dev/null
+++ b/partimage-0.6.9-gzFile.patch
@@ -0,0 +1,33 @@
+diff -Naur partimage-0.6.9/src/client/imagefile.cpp partimage-0.6.9-new/src/client/imagefile.cpp
+--- partimage-0.6.9/src/client/imagefile.cpp	2010-07-25 12:30:31.000000000 -0300
++++ partimage-0.6.9-new/src/client/imagefile.cpp	2012-09-20 08:52:11.568839328 -0300
+@@ -783,7 +783,7 @@
+   else if (m_options.dwCompression == COMPRESS_GZIP) // Gzip compression
+     {
+       showDebug(1, "open gzip\n");
+-      m_gzImageFile = (gzFile *) gzdopen(m_nFdImage, "wb"); //"wb1h");
++      m_gzImageFile = (gzFile) gzdopen(m_nFdImage, "wb"); //"wb1h");
+       if (m_gzImageFile == NULL)
+ 	{
+ 	  showDebug(1, "error:%d %s\n", errno, strerror(errno));
+@@ -1098,7 +1098,7 @@
+     }
+   else if (m_options.dwCompression == COMPRESS_GZIP) // Gzip compression
+     {
+-      m_gzImageFile = (gzFile *) gzdopen(m_nFdImage, "rb");
++      m_gzImageFile = (gzFile) gzdopen(m_nFdImage, "rb");
+       if (m_gzImageFile == NULL)
+         THROW(ERR_ERRNO, errno);
+       else
+diff -Naur partimage-0.6.9/src/client/imagefile.h partimage-0.6.9-new/src/client/imagefile.h
+--- partimage-0.6.9/src/client/imagefile.h	2010-07-25 12:30:31.000000000 -0300
++++ partimage-0.6.9-new/src/client/imagefile.h	2012-09-20 09:00:44.028620131 -0300
+@@ -41,7 +41,7 @@
+   COptions m_options;
+ 
+   FILE *m_fImageFile;
+-  gzFile *m_gzImageFile;
++  gzFile m_gzImageFile;
+   BZFILE *m_bzImageFile;
+ 
+   int m_nFdImage;
diff --git a/partimage.spec b/partimage.spec
index 21c61a5..d1ca755 100644
--- a/partimage.spec
+++ b/partimage.spec
@@ -22,6 +22,7 @@ Source1: %{name}-man.tar.gz
 Source2: %{name}-scripts.tar.gz
 Source3: README.partimage.html
 Source4: partimaged.service
+Patch0:  partimage-0.6.9-gzFile.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: gettext
 BuildRequires: autoconf 
@@ -33,7 +34,7 @@ BuildRequires: zlib-devel
 %{?with_pam:BuildRequires: pam-devel}
 %{?with_ssl:BuildRequires: openssl-devel}
 
-Requires(post):   chkconfig, systemd-units
+Requires(post):   chkconfig, systemd-units, systemd-sysv
 Requires(postun): chkconfig, shadow-utils, systemd-units
 Requires(preun):  chkconfig, initscripts, systemd-units
 Requires(pre):    shadow-utils
@@ -54,7 +55,7 @@ and supporting the following filesystems:
 %package server
 Summary: Server daemon for remote imaging, much like Ghost
 Group: System Environment/Daemons
-%{?with_pam:Requires: compat-db}
+%{?with_pam:Requires: db4-utils}
 
 %description server
 Partimage is a Linux/UNIX partition imaging utility,
@@ -66,6 +67,7 @@ This package contains the server daemon for remote imaging.
 
 %prep
 %setup -q -a1 -a2
+%patch0 -p1 -b .gzFile
 for i in ./README ./ChangeLog ./THANKS ./README.partimaged; do
         iconv -f iso-8859-1 -t utf-8 < "$i" > "${i}_"
         mv "${i}_" "$i"
@@ -168,28 +170,26 @@ getent passwd partimag >/dev/null || \
 exit 0
 
 %post server
-if [ $1 -eq 1 ]; then
-    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
-fi
-
-%triggerun -- partimaged < 0.6.9-3
-if /sbin/chkconfig --level 3 partimaged; then
-    /bin/systemctl enable partimaged.service >/dev/null 2>&1 || :
-fi
+%systemd_post partimaged.service
+
+%triggerun -- partimaged < 0.6.9-4
+# Save the current service runlevel info
+# User must manually run systemd-sysv-convert --apply partimaged
+# to migrate them to systemd targets
+/usr/bin/systemd-sysv-convert --save partimaged >/dev/null 2>&1 ||:
+
+# If the package is allowed to autostart:
+/bin/systemctl --no-reload enable partimaged.service >/dev/null 2>&1 ||:
+
+# Run these because the SysV package being removed won't do them
 /sbin/chkconfig --del partimaged >/dev/null 2>&1 || :
 /bin/systemctl try-restart partimaged.service >/dev/null 2>&1 || :
 
 %preun server
-if [ $1 -eq 0 ]; then
-    /bin/systemctl --no-reload disable partimaged.service >/dev/null 2>&1 || :
-    /bin/systemctl stop partimaged.service >/dev/null 2>&1 || :
-fi
+%systemd_preun partimaged.service
 
 %postun server
-/bin/systemctl daemon-reload >/dev/null 2>&1 || :
-if [ "$1" -ge "1" ]; then
-    /bin/systemctl try-restart partimaged.service >/dev/null 2>&1 || :
-fi
+%systemd_postun_with_restart partimaged.service 
 
 %clean
 %{__rm} -rf %{buildroot}
@@ -225,8 +225,11 @@ fi
 %dir %{image_place}
 
 %changelog
-* Fri Jul 20 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.6.9-5
-- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
+* Sat Sep 01 2012 Paulo Roma <roma at lcg.ufrj.br> - 0.6.9-5
+- Using new systemd macros.
+- Changed Requires compat-db for db4-utils.
+- Fix incorrect usage only detected with zlib-1.2.6 and later
+  gzFile *" should be "gzFile".
 
 * Sun Jul 15 2012 Paulo Roma <roma at lcg.ufrj.br> - 0.6.9-4
 - Using native systemd.


More information about the scm-commits mailing list