[packages/rpm-build-macros/rpm.org: 4/8] - import rpm5 macros that don't exist in rpm.org - remove mimetype generator, rpm.org has it's own

baggins baggins at pld-linux.org
Tue Jan 7 07:48:26 CET 2020


commit 54401b3c2677758e53f356587253a7a8181fba43
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Mon Jan 6 19:33:49 2020 +0900

    - import rpm5 macros that don't exist in rpm.org
    - remove mimetype generator, rpm.org has it's own

 attr.gstreamer        |  2 ++
 macros.gstreamer      |  3 +++
 macros.mimetype       |  7 -------
 macros.selinux        | 38 ++++++++++++++++++++++++++++++++++++++
 rpm-build-macros.spec | 15 +++++++++------
 rpm-mimetypedeps      | 21 ---------------------
 6 files changed, 52 insertions(+), 34 deletions(-)
---
diff --git a/rpm-build-macros.spec b/rpm-build-macros.spec
index 925ed68..ca90620 100644
--- a/rpm-build-macros.spec
+++ b/rpm-build-macros.spec
@@ -47,9 +47,10 @@ Source50:	macros.upstart
 Source51:	macros.webapp
 Source52:	macros.xmms
 Source53:	macros.xorg
+Source54:	macros.selinux
 
-Source60:	rpm-mimetypedeps
-Source61:	macros.mimetypedeps
+Source60:	macros.gstreamer
+Source61:	attr.gstreamer
 
 Patch0:		disable-systemd.patch
 BuildRequires:	rpm >= 4.4.9-56
@@ -227,9 +228,10 @@ cp -p %{SOURCE50} $RPM_BUILD_ROOT%{_usrlibrpm}/macros.d/upstart
 cp -p %{SOURCE51} $RPM_BUILD_ROOT%{_usrlibrpm}/macros.d/webapp
 cp -p %{SOURCE52} $RPM_BUILD_ROOT%{_usrlibrpm}/macros.d/xmms
 cp -p %{SOURCE53} $RPM_BUILD_ROOT%{_usrlibrpm}/macros.d/xorg
+cp -p %{SOURCE54} $RPM_BUILD_ROOT%{_usrlibrpm}/macros.d/selinux
 
-cp -p %{SOURCE60} $RPM_BUILD_ROOT%{_usrlibrpm}/mimetypedeps.sh
-cp -p %{SOURCE61} $RPM_BUILD_ROOT%{_usrlibrpm}/macros.d/mimetype
+cp -p %{SOURCE60} $RPM_BUILD_ROOT%{_usrlibrpm}/macros.d/gstreamer
+cp -p %{SOURCE61} $RPM_BUILD_ROOT%{_usrlibrpm}/fileattrs/gstreamer.attr
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -242,6 +244,7 @@ rm -rf $RPM_BUILD_ROOT
 %files build
 %defattr(644,root,root,755)
 %{_usrlibrpm}/fileattrs/java.attr
+%{_usrlibrpm}/fileattrs/gstreamer.attr
 %{_usrlibrpm}/fileattrs/kernel.attr
 %{_usrlibrpm}/fileattrs/php.attr
 %{_usrlibrpm}/fileattrs/ruby.attr
@@ -250,15 +253,16 @@ rm -rf $RPM_BUILD_ROOT
 %{_usrlibrpm}/macros.d/cacti
 %{_usrlibrpm}/macros.d/emacs
 %{_usrlibrpm}/macros.d/ghc
+%{_usrlibrpm}/macros.d/gstreamer
 %{_usrlibrpm}/macros.d/java
 %{_usrlibrpm}/macros.d/kernel
-%{_usrlibrpm}/macros.d/mimetype
 %{_usrlibrpm}/macros.d/nagios
 %{_usrlibrpm}/macros.d/openldap
 %{_usrlibrpm}/macros.d/perl
 %{_usrlibrpm}/macros.d/php
 %{_usrlibrpm}/macros.d/python
 %{_usrlibrpm}/macros.d/ruby
+%{_usrlibrpm}/macros.d/selinux
 %{_usrlibrpm}/macros.d/systemd
 %{_usrlibrpm}/macros.d/tcl
 %{_usrlibrpm}/macros.d/upstart
@@ -266,7 +270,6 @@ rm -rf $RPM_BUILD_ROOT
 %{_usrlibrpm}/macros.d/xmms
 %{_usrlibrpm}/macros.d/xorg
 
-%attr(755,root,root) %{_rpmlibdir}/mimetypedeps.sh
 %attr(755,root,root) %{_usrlibrpm}/compress-doc
 %attr(755,root,root) %{_usrlibrpm}/dokuwiki-find-lang.sh
 %attr(755,root,root) %{_usrlibrpm}/find-lang.sh
diff --git a/attr.gstreamer b/attr.gstreamer
new file mode 100644
index 0000000..02e23ae
--- /dev/null
+++ b/attr.gstreamer
@@ -0,0 +1,2 @@
+%__gstreamer_provides	%{_rpmconfigdir}/gstreamer.sh --provides --gst-inspect %__gst_inspect
+#__gstreamer_requires	%{_rpmconfigdir}/gstreamer.sh --requires
diff --git a/macros.gstreamer b/macros.gstreamer
new file mode 100644
index 0000000..bf64a74
--- /dev/null
+++ b/macros.gstreamer
@@ -0,0 +1,3 @@
+# Gstreamer specific macro definitions.
+
+%__gst_inspect		/usr/bin/gst-inspect-1.0
diff --git a/macros.mimetype b/macros.mimetype
deleted file mode 100644
index 5f67ab5..0000000
--- a/macros.mimetype
+++ /dev/null
@@ -1,7 +0,0 @@
-#------------------------------------------------------------------------
-# mimetype(...) configuration.
-#
-# Path to script to autogenerate mimetype(foo) provides, based on MimeType
-# key from desktop files.
-#
-%__mimetype_provides %{_usrlibrpm}/mimetypedeps.sh --provides
diff --git a/macros.selinux b/macros.selinux
new file mode 100644
index 0000000..f5f5934
--- /dev/null
+++ b/macros.selinux
@@ -0,0 +1,38 @@
+# SELinux specific macro definitions.
+
+# Desired selinux policy tree
+%__policy_tree	%{expand:%%global __policy_tree %{lua:\
+t="targeted"\
+f = io.open("/etc/selinux/config")\
+if f then\
+  for l in f:lines() do\
+    if "SELINUXTYPE=" == string.sub(l,0,12) then t=string.sub(l,13); end\
+  end\
+  f:close()\
+end\
+print (t)\
+}}%{__policy_tree}
+
+# Path to selinux file context patterns.
+%__file_context_path /etc/selinux/%{__policy_tree}/contexts/files/file_contexts
+
+#
+# Path to selinux file context patterns used to add
+# RPMTAG_FILECONTEXTS to packages when building.
+#
+# Undefined, missing or %{nil} will disable.
+%_build_file_context_path	%{nil}
+
+#
+# Path to selinux file context patterns used to set
+# (or override package content) file contexts when installing.
+#
+# Undefined, missing or %{nil} will use package content (if available).
+%_install_file_context_path	%{__file_context_path}
+
+#
+# Path to selinux file context patterns used to verify
+# file contexts on file system.
+#
+# Undefined, missing or %{nil} will use package content (if available).
+%_verify_file_context_path	%{__file_context_path}
diff --git a/rpm-mimetypedeps b/rpm-mimetypedeps
deleted file mode 100644
index 6c0176d..0000000
--- a/rpm-mimetypedeps
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/sh
-
-case $1 in
--P|--provides)
-	while read filename; do
-	case "$filename" in
-	*.desktop)
-		mime=$(awk -F= '/^MimeType=/{print $2}' "$filename")
-		IFS=';'
-		for type in $mime; do
-			if [ -n "$type" ]; then
-				echo "mimetype($type)"
-			fi
-		done
-		;;
-	esac
-	done
-	;;
-esac
-
-exit 0
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/rpm-build-macros.git/commitdiff/0c4a87cbfb5cfc4b9a707f657b25f01e04db0843



More information about the pld-cvs-commit mailing list