San Mehat | a430b2b | 2014-09-23 08:30:51 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | VERSION="0.9.13" |
| 4 | |
| 5 | cd "$(dirname "$0")" |
| 6 | |
| 7 | mv configure.ac configure.ac.LibVNCServer |
| 8 | |
| 9 | cat configure.ac.LibVNCServer | \ |
| 10 | egrep -v '(AC_CONFIG_COMMANDS|chmod).*libvncserver-config' | \ |
| 11 | egrep -v '^[ ]*libvncserver-config$' | \ |
| 12 | sed -e "s/LibVNCServer, [^,)]*\([(,]\)*/x11vnc, $VERSION\1/g" \ |
| 13 | -e "s/\(contrib\|examples\|vncterm\|test\|client_examples\)\/Makefile//g" \ |
| 14 | -e "s/LibVNCServer.spec/x11vnc.spec/g" \ |
| 15 | -e "s/AC_PROG_LIBTOOL/AC_PROG_RANLIB/" \ |
| 16 | -e "s/PKG_CHECK/#PKG_CHECK/" \ |
| 17 | -e 's/if test "x$with_gnutls/with_gnutls=no; if test "x$with_gnutls/' \ |
| 18 | -e 's/if test "x$with_ipv6/with_ipv6=no; if test "x$with_ipv6/' \ |
| 19 | > configure.ac |
| 20 | |
| 21 | mv Makefile.am Makefile.am.LibVNCServer |
| 22 | |
| 23 | echo "EXTRA_DIST=tightvnc-1.3dev5-vncviewer-alpha-cursor.patch RELEASE-NOTES README.LibVNCServer" > Makefile.am |
| 24 | echo "" >> Makefile.am |
| 25 | echo "if HAVE_SYSTEM_LIBVNCSERVER" >> Makefile.am |
| 26 | echo "SUBDIRS=x11vnc classes" >> Makefile.am |
| 27 | echo "DIST_SUBDIRS=x11vnc classes" >> Makefile.am |
| 28 | echo "else" >> Makefile.am |
| 29 | echo "SUBDIRS=libvncserver libvncclient x11vnc classes" >> Makefile.am |
| 30 | echo "DIST_SUBDIRS=libvncserver libvncclient x11vnc classes" >> Makefile.am |
| 31 | echo "endif" >> Makefile.am |
| 32 | echo "" >> Makefile.am |
| 33 | |
| 34 | cat Makefile.am.LibVNCServer | \ |
| 35 | sed -e "s/^SUBDIRS.*$/#SUBDIRS=libvncserver libvncclient x11vnc classes/" \ |
| 36 | -e "s/^DIST_SUBDIRS.*$/#DIST_SUBDIRS=libvncserver libvncclient x11vnc classes/" \ |
| 37 | -e "/^.*bin_SCRIPTS.*$/d" \ |
| 38 | -e "s/^include_HEADERS/if HAVE_SYSTEM_LIBVNCSERVER^else^include_HEADERS/" \ |
| 39 | -e "s/rfbclient\.h/rfbclient.h^endif/" \ |
| 40 | | tr '^' '\n' \ |
| 41 | >> Makefile.am |
| 42 | |
| 43 | mv README README.LibVNCServer |
| 44 | cp x11vnc/README ./README |
| 45 | cp x11vnc/RELEASE-NOTES ./RELEASE-NOTES |
| 46 | |
| 47 | cat LibVNCServer.spec.in | \ |
| 48 | sed -e "s/Johannes.Schindelin@gmx.de/runge@karlrunge.com/gi" \ |
| 49 | -e "s/Johannes.Schindelin/Karl Runge/g" \ |
| 50 | -e "s/a library to make writing a vnc server easy/a VNC server for the current X11 session/" \ |
| 51 | -e "/^%description$/,/%description devel$/d" \ |
| 52 | -e 's/^Static libraries.*$/%description\ |
| 53 | x11vnc is to X Window System what WinVNC is to Windows, i.e. a server\ |
| 54 | which serves the current Xwindows desktop via RFB (VNC) protocol\ |
| 55 | to the user.\ |
| 56 | \ |
| 57 | Based on the ideas of x0rfbserver and on LibVNCServer, it has evolved\ |
| 58 | into a versatile and performant while still easy to use program.\ |
| 59 | \ |
| 60 | x11vnc was put together and is (actively ;-) maintained by\ |
| 61 | Karl Runge <runge@karlrunge.com>\ |
| 62 | \ |
| 63 | /i' \ |
| 64 | > x11vnc.spec.in.tmp |
| 65 | |
| 66 | perl -e ' |
| 67 | $s = 0; |
| 68 | while (<>) { |
| 69 | if ($s) { |
| 70 | if (/^\s*$/) { |
| 71 | $s = 0; |
| 72 | } |
| 73 | } else { |
| 74 | if (/^%files\s*$/ || /^%files devel/) { |
| 75 | $s = 1; |
| 76 | } |
| 77 | } |
| 78 | next if $s; |
| 79 | if (/^%files x11vnc/) { |
| 80 | print "\%files\n"; |
| 81 | print "\%doc README x11vnc/ChangeLog\n"; |
| 82 | next; |
| 83 | } |
| 84 | print; |
| 85 | }' < x11vnc.spec.in.tmp > x11vnc.spec.in |
| 86 | |
| 87 | rm -f x11vnc.spec.in.tmp |
| 88 | |
| 89 | mv libvncserver/Makefile.am libvncserver/Makefile.am.LibVNCServer |
| 90 | |
| 91 | cat libvncserver/Makefile.am.LibVNCServer | \ |
| 92 | sed -e "s/\(include\|LIB\|lib\)_/noinst_/g" \ |
| 93 | -e "s/_la_/_a_/" \ |
| 94 | -e "s/\.la/.a/" \ |
| 95 | -e "s/_LTLIBRARIES/_LIBRARIES/" \ |
| 96 | > libvncserver/Makefile.am |
| 97 | |
| 98 | mv libvncclient/Makefile.am libvncclient/Makefile.am.LibVNCServer |
| 99 | |
| 100 | cat libvncclient/Makefile.am.LibVNCServer | \ |
| 101 | sed -e "s/\(include\|LIB\|lib\)_/noinst_/g" \ |
| 102 | -e "s/_la_/_a_/" \ |
| 103 | -e "s/\.la/.a/" \ |
| 104 | -e "s/_LTLIBRARIES/_LIBRARIES/" \ |
| 105 | > libvncclient/Makefile.am |
| 106 | |
| 107 | mv x11vnc/Makefile.am x11vnc/Makefile.am.LibVNCServer |
| 108 | |
| 109 | cat x11vnc/Makefile.am.LibVNCServer | \ |
| 110 | sed -e "s/_la_/_a_/" \ |
| 111 | -e "s/\.la/.a/g" \ |
| 112 | -e "s/_LTLIBRARIES/_LIBRARIES/" \ |
| 113 | > x11vnc/Makefile.am |
| 114 | |
| 115 | |
| 116 | cp classes/Makefile.am classes/Makefile.am.LibVNCServer |
| 117 | echo 'pkgdatadir = $(datadir)/@PACKAGE@/classes' >> classes/Makefile.am |
| 118 | echo 'pkgdata_DATA=VncViewer.jar index.vnc' >> classes/Makefile.am |
| 119 | |
| 120 | cp classes/ssl/Makefile.am classes/ssl/Makefile.am.LibVNCServer |
| 121 | sed -e 's/EXTRA_DIST=/EXTRA_DIST=tightvnc-1.3dev7_javasrc-vncviewer-ssl.patch tightvnc-1.3dev7_javasrc-vncviewer-cursor-colors+no-tab-traversal.patch /' \ |
| 122 | classes/ssl/Makefile.am.LibVNCServer > classes/ssl/Makefile.am |
| 123 | echo 'pkgdatadir = $(datadir)/@PACKAGE@/classes/ssl' >> classes/ssl/Makefile.am |
| 124 | echo 'pkgdata_DATA=VncViewer.jar index.vnc SignedVncViewer.jar proxy.vnc README UltraViewerSSL.jar SignedUltraViewerSSL.jar ultra.vnc ultrasigned.vnc' >> classes/ssl/Makefile.am |
| 125 | echo 'pkgdata_SCRIPTS=ss_vncviewer' >> classes/ssl/Makefile.am |
| 126 | |
| 127 | chmod 755 classes/ssl/ss_vncviewer |
| 128 | |
| 129 | mv acinclude.m4 acinclude.m4.LibVNCServer |
| 130 | |
| 131 | cat acinclude.m4.LibVNCServer | \ |
| 132 | sed -e "s/^\(_PKG.*\)\$PACKAGE\(.*\)$/\1LibVNCServer\2/" \ |
| 133 | > acinclude.m4 |
| 134 | |
| 135 | make x11vnc-${VERSION}.tar.gz |
| 136 | for f in configure.ac Makefile.am x11vnc/Makefile.am libvncserver/Makefile.am libvncclient/Makefile.am classes/Makefile.am classes/ssl/Makefile.am acinclude.m4 README; do |
| 137 | mv -f $f.LibVNCServer $f |
| 138 | done |
| 139 | rm -f ./RELEASE-NOTES |
| 140 | |