Bump to file 5.41 51/265751/1 accepted/tizen_7.0_base accepted/tizen_7.0_base_hotfix accepted/tizen_7.0_base_tool accepted/tizen_7.0_base_tool_hotfix sandbox/backup/file_5.41_20230106 sandbox/dh0128.kwak/file-5.41-20211028 tizen_7.0_base tizen_7.0_base_hotfix accepted/tizen/7.0/base/20230714.002908 accepted/tizen/7.0/base/hotfix/20230714.003723 accepted/tizen/7.0/base/tool/20221028.113222 accepted/tizen/7.0/base/tool/hotfix/20221115.085008 accepted/tizen/base/tool/20211115.010732 submit/tizen_7.0_base/20221028.200901 submit/tizen_7.0_base_hotfix/20221115.161501 submit/tizen_base/20211111.053703 tizen_7.0_m2_release
authorDongHun Kwak <dh0128.kwak@samsung.com>
Thu, 28 Oct 2021 05:28:19 +0000 (14:28 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Thu, 28 Oct 2021 05:28:45 +0000 (14:28 +0900)
Change-Id: I7c9c9a1b58e854bd0e1b0e55a7253bb1af956384
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
packaging/baselibs.conf [new file with mode: 0644]
packaging/file.manifest [new file with mode: 0644]
packaging/file.spec [new file with mode: 0644]

diff --git a/packaging/baselibs.conf b/packaging/baselibs.conf
new file mode 100644 (file)
index 0000000..8e7ce75
--- /dev/null
@@ -0,0 +1 @@
+libmagic
diff --git a/packaging/file.manifest b/packaging/file.manifest
new file mode 100644 (file)
index 0000000..017d22d
--- /dev/null
@@ -0,0 +1,5 @@
+<manifest>
+ <request>
+    <domain name="_"/>
+ </request>
+</manifest>
diff --git a/packaging/file.spec b/packaging/file.spec
new file mode 100644 (file)
index 0000000..6ab0e97
--- /dev/null
@@ -0,0 +1,132 @@
+Name:           file
+BuildRequires:  findutils
+BuildRequires:  libtool
+BuildRequires:  zlib-devel
+Url:            http://www.darwinsys.com/file/
+Version:        5.41
+Release:        0
+Summary:        A Tool to Determine File Types
+License:        BSD-2-Clause
+Group:          System/Utilities
+
+### SOURCES BEGIN ###
+Source:         file-%{version}.tar.gz
+Source2:        baselibs.conf
+Source1001:     file.manifest
+### SOURCES END ###
+
+%description
+With the file command, you can obtain information on the file type of a
+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
+Summary:        The magic files for libmagic to use
+Group:          System/Libraries
+
+%description -n libmagic-data
+This package contains the basic magic files that libmagic reads and uses
+to estimate a file's type.
+
+%package -n libmagic
+Summary:        Library with file's functionality
+Group:          System/Libraries
+Requires:       libmagic-data = %{version}
+Provides:       libfile
+Obsoletes:      libfile =< 5.04
+
+%description -n libmagic
+This library reads magic files and detects file types. Used by file command
+
+%package -n file-devel
+Summary:        Include Files and Libraries mandatory for Development
+Group:          System/Libraries
+Provides:       file:/usr/include/magic.h
+Requires:       glibc-devel
+Requires:       libmagic = %{version}
+
+%description -n file-devel
+This package contains all necessary include files and libraries needed
+to develop applications that require the magic "file" interface.
+
+%global         _miscdir    %{_datadir}/misc
+
+%prep
+%setup -q -n file-%{version}
+### PREP BEGIN ###
+cp %{SOURCE1001} .
+### PREP END ###
+
+%build
+### BUILD BEGIN ###
+export LANG=POSIX
+export LC_ALL=POSIX
+rm -f Magdir/*,v Magdir/*~
+rm -f ltcf-c.sh ltconfig ltmain.sh
+autoreconf -fiv
+CFLAGS="$RPM_OPT_FLAGS -fPIC -fPIE -Wl,-z,relro -DHOWMANY=69632"
+LDFLAGS="-pie"
+%configure --disable-silent-rules --datadir=%{_miscdir} --disable-static --with-pic --enable-fsect-man5
+sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
+sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
+
+%{__make} %{?_smp_mflags} pkgdatadir='$(datadir)'
+%if 0%{?build_python_bindings:1}
+pushd python
+python setup.py build
+popd
+%endif
+### BUILD END ###
+
+%install
+export LANG=POSIX
+export LC_ALL=POSIX
+mkdir  %{buildroot}%{_sysconfdir}
+make DESTDIR=%{buildroot} install pkgdatadir='$(datadir)'
+rm -vf %{buildroot}%{_sysconfdir}/magic
+echo '# Localstuff: file(1) magic(5) for locally observed files' > %{buildroot}%{_sysconfdir}/magic
+echo '#     global magic file is %{_miscdir}/magic(.mgc)'   >> %{buildroot}%{_sysconfdir}/magic
+%{nil install -s dcore %{buildroot}%{_bindir}}
+# Check out that the binary does not bail out:
+LD_LIBRARY_PATH=%{buildroot}%{_libdir}
+export LD_LIBRARY_PATH
+%{buildroot}%{_bindir}/file --version
+find %{buildroot}%{_bindir}/file %{_bindir}/ /%{_lib}/ %{_libdir}/ | \
+    xargs %{buildroot}%{_bindir}/file -m %{buildroot}%{_miscdir}/magic
+unset LD_LIBRARY_PATH
+%{__rm} -f %{buildroot}%{_libdir}/*.la
+
+%remove_docs
+
+%post -n libmagic -p /sbin/ldconfig
+
+%postun -n libmagic -p /sbin/ldconfig
+
+%files -n libmagic
+%manifest %{name}.manifest
+%defattr (644,root,root,755)
+%license COPYING
+%{_libdir}/lib*.so.*
+
+%files -n libmagic-data
+%manifest %{name}.manifest
+%defattr (644,root,root,755)
+%license COPYING
+%config(noreplace) %{_sysconfdir}/magic
+%{_miscdir}/magic.mgc
+
+%files
+%manifest %{name}.manifest
+%defattr (644,root,root,755)
+%license COPYING
+%{nil %{_bindir}/dcore}
+%attr(755,root,root) %{_bindir}/file
+
+%files -n file-devel
+%manifest %{name}.manifest
+%defattr (644,root,root,755)
+%license COPYING
+%{_libdir}/lib*.so
+%{_libdir}/pkgconfig/libmagic.pc
+%{_includedir}/magic.h