Simple rpm packaging for redhat and clones.

This commit is contained in:
Roy Einar Dragseth 2014-05-02 14:52:30 +02:00
parent 082027dc87
commit 237eea1b0c
3 changed files with 127 additions and 0 deletions

25
redhat/Makefile Normal file
View File

@ -0,0 +1,25 @@
# novnc doesn't seem to have any clear versioning so we just use the checkout date.
VERSION=20140423
SRCDIR=novnc-${VERSION}
rpm: createspecfile createtarfile rpmbuild
rpmbuild:
rpmbuild -ta novnc-${VERSION}.tar.gz
createspecfile:
mkdir -p ${SRCDIR}
sed 's/%version%/${VERSION}/' novnc.spec.in > ${SRCDIR}/novnc.spec
createtarfile:
mkdir -p ${SRCDIR}/{utils,redhat}
cp novnc.init ${SRCDIR}/redhat/novnc.init
cp ../utils/{websockify,websocket.py,Makefile,launch.sh} ${SRCDIR}/utils
cp ../{vnc.html,vnc_auto.html,README.md,LICENSE.txt} ${SRCDIR}
cp -r ../include ${SRCDIR}
cp -r ../images ${SRCDIR}
tar zcf novnc-${VERSION}.tar.gz ${SRCDIR}
clean:
rm -rf ${SRCDIR} novnc-${VERSION}.tar.gz *~

48
redhat/novnc.init Executable file
View File

@ -0,0 +1,48 @@
#!/bin/bash
#
# /etc/rc.d/init.d/novnc
#
# Start the novnc vnc to html5 proxy.
# This init script is based on the example found at
# http://www.sensi.org/~alec/unix/redhat/sysvinit.html
#
# chkconfig: 345 99 0
# description: The novnc proxy.
# Source function library.
. /etc/rc.d/init.d/functions
WEBSOCKIFY=/usr/share/novnc/utils/websockify
WEBSOCKIFYARGS="--web /usr/share/novnc/html/ 6080 localhost:5901"
if [ -e /etc/sysconfig/novnc ]; then
source /etc/sysconfig/novnc
fi
case "$1" in
start)
echo -n "Starting novnc services: "
daemon --user nobody $WEBSOCKIFY -D $WEBSOCKIFYARGS
touch /var/lock/subsys/novnc
;;
stop)
echo -n "Shutting down novnc services: "
ps -ef | grep $WEBSOCKIFY | awk '{print $2}' | xargs kill
rm -f /var/lock/subsys/novnc
echo "[OK]"
;;
status)
ps -ef | grep websockify
;;
restart)
$0 stop; $0 start
;;
reload)
$0 stop; $0 start
;;
*)
echo "Usage: novnc {start|stop|status|reload|restart"
exit 1
;;
esac

54
redhat/novnc.spec.in Normal file
View File

@ -0,0 +1,54 @@
Summary: VNC client using HTML5 (Web Sockets, Canvas) with encryption (wss://) support.
Name: novnc
Version: %version%
Release: 3
License: MPL 2.0
Group: Applications/Internet
URL: http://novnc.com
Source0: %{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
%description
noVNC is a HTML5 VNC client that runs well in any modern browser including mobile browsers (iPhone/iPad and Android).
%prep
%setup -q
%build
%install
rm -rf $RPM_BUILD_ROOT
target=$RPM_BUILD_ROOT/usr/share/novnc
mkdir -p $target/{utils,html/include,doc}
cp vnc.html $target/html
cp vnc_auto.html $target/html
cp README.md $target/doc
cp LICENSE.txt $target/doc
cp utils/Makefile $target/utils
cp utils/launch.sh $target/utils
cp utils/websocket.py $target/utils
cp utils/websockify $target/utils
cp -r images $target/html/
cp -r include $target/html/
mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
cp redhat/novnc.init $RPM_BUILD_ROOT/etc/rc.d/init.d/novnc
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc /usr/share/novnc/doc/README.md
%dir /usr/share/novnc
/usr/
/etc/
%changelog
* Wed Apr 23 2014 Roy Dragseth <royd@stallo-2.local> -
- Initial build.