# Source function library
. /etc/rc.d/init.d/functions
-# disabled because: seems the mountpoint is namespaced, i.e not visible outside upstart process
-#upstart_controlled --except status
-
BINFMT_DIR=/proc/sys/fs/binfmt_misc
[ -d $BINFMT_DIR ] || exit 0
Summary(pl.UTF-8): Detector typu plików wykonywalnych PE Microsoftu
Name: binfmt-detector
Version: 0.2
-Release: 5
+Release: 6
License: GPL
Group: Base
Source0: http://team.pld-linux.org/~wolf/%{name}.tar.gz
# Source0-md5: d6e9d6d8888b58c97eb65875853fd778
Source1: %{name}.init
-Source2: binfmt-detector.upstart
Patch0: spelling.patch
Patch1: libdir.patch
BuildRequires: rpmbuild(macros) >= 1.268
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir},/etc/{rc.d/init.d,init}}
+install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir},/etc/rc.d/init.d}
install -p binfmt-detector $RPM_BUILD_ROOT%{_libdir}
install -p binfmt-detector.sh $RPM_BUILD_ROOT%{_bindir}/binfmt-detector
sed -i -e 's,/usr/lib,%{_libdir},' $RPM_BUILD_ROOT%{_bindir}/binfmt-detector
install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/binfmt-detector
-cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/init/%{name}.conf
%clean
rm -rf $RPM_BUILD_ROOT
%defattr(644,root,root,755)
%doc README
%attr(754,root,root) /etc/rc.d/init.d/%{name}
-%config(noreplace) %verify(not md5 mtime size) /etc/init/%{name}.conf
%attr(755,root,root) %{_bindir}/%{name}
%attr(755,root,root) %{_libdir}/%{name}
+++ /dev/null
-description "Microsoft PE executable type detector"
-
-start on virtual-filesystems
-
-task
-
-env BINFMT_DIR="/proc/sys/fs/binfmt_misc"
-
-script
- if ! grep -q ${BINFMT_DIR} /proc/mounts; then
- /bin/mount none -t binfmt_misc ${BINFMT_DIR} || :
- fi
-
- echo ':windows:M::MZ::/usr/bin/binfmt-detector:' > ${BINFMT_DIR}/register
- echo ':windowsPE:M::PE::/usr/bin/binfmt-detector:' > ${BINFMT_DIR}/register
-end script
-
-post-stop script
- [ -f ${BINFMT_DIR}/windows ] && echo '-1' > ${BINFMT_DIR}/windows
- [ -f ${BINFMT_DIR}/windowsPE ] && echo '-1' > ${BINFMT_DIR}/windowsPE
-end script