[ocp] remove textrel_shlib_t fcontexts on non-i386asm version and on package removal update gtk-update-ico

Charles R. Anderson cra at fedoraproject.org
Sun Jun 5 14:10:17 UTC 2011


commit 5f4c273e4644ce91f6f72e239ffdc711c750043c
Author: Chuck Anderson <cra at wpi.edu>
Date:   Sun Jun 5 10:09:52 2011 -0400

    remove textrel_shlib_t fcontexts on non-i386asm version and on package removal
    update gtk-update-icon-cache scriptlets to latest guidelines
    update upstream URL

 ocp.spec |   47 ++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 36 insertions(+), 11 deletions(-)
---
diff --git a/ocp.spec b/ocp.spec
index 41fbd1d..5eaaa96 100644
--- a/ocp.spec
+++ b/ocp.spec
@@ -1,6 +1,6 @@
 #define snapshot 20100401
 %define version 0.1.20
-%define release %{?snapshot:0.5.%{snapshot}snap}%{!?snapshot:5}%{?dist}
+%define release %{?snapshot:0.5.%{snapshot}snap}%{!?snapshot:6}%{?dist}
 
 Name: ocp
 Version: %{version}
@@ -8,13 +8,11 @@ Release: %{release}
 Summary: Open Cubic Player for MOD/S3M/XM/IT/SID/MIDI music files
 
 Group: Applications/Multimedia
-# 2010/04/04: Asked for status update.  Some files are GPLv2+, some are
-# GPLv3+.  Until this is clarified, it seems that GPLv2+ is the only way
-# this can be legally distributed.  Graphics and animations are CC-BY.
 # 2010/08/08: Verified that upstream has removed GPLv3+ gnulib and added
 # GPLv2+ license text to all source files.
+# Graphics and animations are CC-BY.
 License: GPLv2+ and CC-BY
-URL: http://stian.cubic.org/coding-ocp.php
+URL: http://stian.cubic.org/project-ocp.php
 %define source %{name}-%{?snapshot:snapshot-%{snapshot}}%{!?snapshot:%{version}}
 Source0: http://stian.cubic.org/ocp/%{source}.tar.bz2
 Source1: ftp://ftp.cubic.org/pub/player/gfx/opencp25image1.zip
@@ -44,11 +42,9 @@ Requires: hicolor-icon-theme
 Requires(post): /sbin/install-info
 Requires(preun): /sbin/install-info
 %ifarch %{ix86}
-%if %{?_with_i386asm:1}%{!?_with_i386asm:0}
 Requires(post): /usr/sbin/semanage
 Requires(post): /sbin/restorecon
 %endif
-%endif
 
 %description
 Open Cubic Player is a music file player ported from DOS that supports
@@ -150,15 +146,23 @@ rm -rf %{buildroot}
 
 %post
 /sbin/install-info %{_infodir}/ocp.info.gz %{_infodir}/dir || :
-gtk-update-icon-cache -qf %{_datadir}/icons/hicolor 2>/dev/null || :
+touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
+
 %ifarch %{ix86}
 %if %{?_with_i386asm:1}%{!?_with_i386asm:0}
+# This is the i386 assembly version.  We need to allow text relocations.
 semanage fcontext -a -t textrel_shlib_t '%{_libdir}/ocp-.*/(autoload/)?.*devwmix\.so' 2>/dev/null || :
 semanage fcontext -a -t textrel_shlib_t '%{_libdir}/ocp-.*/(autoload/)?.*devwmixf\.so' 2>/dev/null || :
 semanage fcontext -a -t textrel_shlib_t '%{_libdir}/ocp-.*/(autoload/)?.*mcpbase\.so' 2>/dev/null || :
 semanage fcontext -a -t textrel_shlib_t '%{_libdir}/ocp-.*/(autoload/)?.*mixclip\.so' 2>/dev/null || :
-restorecon -R %{_libdir}/ocp-* || :
+%else
+# This is the i386 non-assembly version.  We don't need nor want to allow text relocations.
+semanage fcontext -d -t textrel_shlib_t '%{_libdir}/ocp-.*/(autoload/)?.*devwmix\.so' 2>/dev/null || :
+semanage fcontext -d -t textrel_shlib_t '%{_libdir}/ocp-.*/(autoload/)?.*devwmixf\.so' 2>/dev/null || :
+semanage fcontext -d -t textrel_shlib_t '%{_libdir}/ocp-.*/(autoload/)?.*mcpbase\.so' 2>/dev/null || :
+semanage fcontext -d -t textrel_shlib_t '%{_libdir}/ocp-.*/(autoload/)?.*mixclip\.so' 2>/dev/null || :
 %endif
+restorecon -R %{_libdir}/ocp-* || :
 %endif
 
 
@@ -169,17 +173,38 @@ fi
 
 
 %postun
-gtk-update-icon-cache -qf %{_datadir}/icons/hicolor 2>/dev/null || :
+if [ $1 -eq 0 ] ; then  # final removal
+    touch --no-create %{_datadir}/icons/hicolor &>/dev/null
+    gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
+
+%ifarch %{ix86}
+%if %{?_with_i386asm:1}%{!?_with_i386asm:0}
+    semanage fcontext -d -t textrel_shlib_t '%{_libdir}/ocp-.*/(autoload/)?.*devwmix\.so' 2>/dev/null || :
+    semanage fcontext -d -t textrel_shlib_t '%{_libdir}/ocp-.*/(autoload/)?.*devwmixf\.so' 2>/dev/null || :
+    semanage fcontext -d -t textrel_shlib_t '%{_libdir}/ocp-.*/(autoload/)?.*mcpbase\.so' 2>/dev/null || :
+    semanage fcontext -d -t textrel_shlib_t '%{_libdir}/ocp-.*/(autoload/)?.*mixclip\.so' 2>/dev/null || :
+%endif
+%endif
+fi
+
+
+%posttrans
+gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
 
 
 %changelog
+* Sun Jun 05 2011 Charles R. Anderson <cra at wpi.edu> 0.1.20-6
+- remove textrel_shlib_t fcontexts on non-i386asm version and on package removal
+- update gtk-update-icon-cache scriptlets to latest guidelines
+- update upstream URL
+
 * Sat Jun 04 2011 Charles R. Anderson <cra at wpi.edu> 0.1.20-5
 - conditionalize compiling the i386 assembly version, and default to off:
   --with-i386asm
 - only set SELinux fcontexts when compiling i386 assembly version
 - fix changelog days
 
-* Fri Jun 03 2011 Charles R. Anderson <cra at wpi.edu> 0.1.20-4
+* Sat Jun 04 2011 Charles R. Anderson <cra at wpi.edu> 0.1.20-4
 - correct fcontext regexps and restorecon glob
 
 * Fri Jun 03 2011 Charles R. Anderson <cra at wpi.edu> 0.1.20-3


More information about the scm-commits mailing list