I accidently build nvtv, but than I saw it was already in contribs. I think
it could be improved a bit:
- libgtk+1.2-devel should be added to build requires
- Currently the binaries are setuid root, I think this is a bad idea (its easy
to crash your machine with it). Perhaps using conselehelper would be better:
# add:
Requires: usermode usermode-consoleonly
# in the install section remove:
cp ${RPM_BUILD_DIR}/%{name}-%{version}/src/nvtv
${RPM_BUILD_ROOT}/%{_bindir}/nvtv
chmod +s ${RPM_BUILD_ROOT}/%{_bindir}/nvtv
cp ${RPM_BUILD_DIR}/%{name}-%{version}/src/nvtvd
${RPM_BUILD_ROOT}/%{_bindir}/nvtvd
#and add:
install -D -m755 src/nvtv $RPM_BUILD_ROOT/%_sbindir/nvtv
install -D -m755 src/nvtvd $RPM_BUILD_ROOT/%_sbindir/nvtvd
#Lets make a nice dialog box asking for root perms:
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/{pam.d,security/console.apps}
cat <<EOF >$RPM_BUILD_ROOT%{_sysconfdir}/pam.d/%{name}
#%PAM-1.0
auth sufficient /lib/security/pam_rootok.so
auth required /lib/security/pam_stack.so service=system-auth
session optional /lib/security/pam_xauth.so
account required /lib/security/pam_permit.so
EOF
)
cat <<EOF >$RPM_BUILD_ROOT%{_sysconfdir}/security/console.apps/%{name}
USER=root
PROGRAM=/usr/sbin/nvtv
SESSION=true
FALLBACK=true
EOF
mkdir -p $RPM_BUILD_ROOT%{_bindir}
ln -s %{_bindir}/consolehelper $RPM_BUILD_ROOT%{_bindir}/%name
#the files become:
%files
%defattr (-,root,root)
%doc doc/* README TODO INSTALL BUGS ChangeLog FAQ ANNOUNCE LICENSE
README.binary
%_sbindir/%{name}
%_bindir/%{name}
%_sbindir/%{name}d
%config(noreplace) %{_sysconfdir}/security/console.apps/*
%config(noreplace) %{_sysconfdir}/pam.d/*
%{_prefix}/share/pixmaps/%{name}.png
%{_datadir}/applnk/Multimedia/%{name}.desktop
%{_menudir}/*
hmm...a diff would have been nicer....
Danny