From b550ce4b919563bda6d53299d6bcfb5b3133ffe176322ce5c57ce70ff2d29b43 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Wed, 23 Jan 2013 08:41:15 +0000 Subject: [PATCH] . OBS-URL: https://build.opensuse.org/package/show/Base:System/file?expand=0&rev=62 --- file-5.12-visibility.patch | 21 --------------------- file-rpmlintrc | 4 ++++ file.spec | 26 ++++++++++++++++++++++---- 3 files changed, 26 insertions(+), 25 deletions(-) create mode 100644 file-rpmlintrc diff --git a/file-5.12-visibility.patch b/file-5.12-visibility.patch index 807b6d2..01f708e 100644 --- a/file-5.12-visibility.patch +++ b/file-5.12-visibility.patch @@ -9,24 +9,3 @@ if MINGW MINGWLIBS = -lgnurx -lshlwapi else ---- src/libmagic.map -+++ src/libmagic.map 2011-06-14 00:00:00.000000000 +0000 -@@ -0,0 +1,18 @@ -+{ -+global: -+ magic_buffer; -+ magic_check; -+ magic_close; -+ magic_compile; -+ magic_descriptor; -+ magic_errno; -+ magic_error; -+ magic_file; -+ magic_getpath; -+ magic_list; -+ magic_load; -+ magic_open; -+ magic_setflags; -+ magic_version; -+local: *; -+}; diff --git a/file-rpmlintrc b/file-rpmlintrc new file mode 100644 index 0000000..218dbc5 --- /dev/null +++ b/file-rpmlintrc @@ -0,0 +1,4 @@ +addFilter(".*Warning:.*using.*regular.*magic.*file.*/usr/share/misc/magic.*") +addFilter(".*E:.*shlib-fixed-dependency.*") +addFilter(".*W:.*no-dependency-on.*") +addFilter(".*W:.*name-repeated-in-summary.*") diff --git a/file.spec b/file.spec index 3543079..572e92b 100644 --- a/file.spec +++ b/file.spec @@ -69,18 +69,18 @@ specified file. File type recognition is controlled by the file /etc/magic, which contains the classification criteria. This command is used by apsfilter to permit automatic printing of different file types. -%package -n libmagic-data +%package -n file-magic Summary: The magic files for libmagic to use Group: Development/Libraries/Other -%description -n libmagic-data +%description -n file-magic This package contains the basic magic files that libmagic reads and uses to estimate a file's type. %package -n libmagic1 Summary: Library with file's functionality Group: Development/Libraries/Other -Requires: libmagic-data = %{version} +Requires: file-magic = %{version} %description -n libmagic1 This library reads magic files and detects file types. Used by file command @@ -133,6 +133,24 @@ rm -f ltcf-c.sh ltconfig ltmain.sh autoreconf -fiv CFLAGS="$RPM_OPT_FLAGS -DHOWMANY=69632" %configure --disable-silent-rules --datadir=%{_miscdir} --disable-static --with-pic --enable-fsect-man5 +# +# Used by patch #30 the visibility patch which allows us to +# export only the public magic_<...>() functions of libmagic.so +# +pushd src/ + %{__make} %{?_smp_mflags} pkgdatadir='$(datadir)' magic.h + cat > libmagic.map <<-'EOF' + { + global: + EOF + sed -rn '/[[:alnum:]]+_[[:alnum:]]+\(/{ + s/.*([[:blank:]\*])([[:alnum:]]+_[[:alnum:]]+)\(.*\);/ \2\;/p + }' < magic.h >> libmagic.map + cat >> libmagic.map <<-'EOF' + local: *; + }; + EOF +popd %{__make} %{?_smp_mflags} pkgdatadir='$(datadir)' %if 0%{?build_python_bindings:1} pushd python @@ -165,7 +183,7 @@ unset LD_LIBRARY_PATH %defattr (644,root,root,755) %{_libdir}/lib*.so.* -%files -n libmagic-data +%files -n file-magic %defattr (644,root,root,755) %config(noreplace) %{_sysconfdir}/magic %{_miscdir}/magic