From ad18ea644ee7650425320736b10a48a8cbd0d340 Mon Sep 17 00:00:00 2001 From: Mark Hammond Date: Sat, 17 Oct 2009 03:30:05 +0000 Subject: have 'make dist' build a windows installer on windows git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@826173 13f79535-47bb-0310-9956-ffa450edef68 --- etc/Makefile.am | 36 ++++++++++++++++++++++++ etc/windows/README.txt.tpl | 24 ++++++++++++++++ etc/windows/couchdb.iss.tpl | 68 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 128 insertions(+) create mode 100644 etc/windows/README.txt.tpl create mode 100644 etc/windows/couchdb.iss.tpl (limited to 'etc') diff --git a/etc/Makefile.am b/etc/Makefile.am index 51a00d26..2ff298ad 100644 --- a/etc/Makefile.am +++ b/etc/Makefile.am @@ -27,6 +27,10 @@ nobase_sysconf_DATA = $(default_sysconf_data) $(init_sysconf_data) EXTRA_DIST = $(init_sysconf_data) +if WINDOWS +EXTRA_DIST += windows/setup-couchdb-@version@.exe +endif + CLEANFILES = $(init_DATA) $(default_sysconf_data) $(launchd_DATA) transform = @program_transform_name@ @@ -63,6 +67,38 @@ launchd/org.apache.couchdb.plist: launchd/org.apache.couchdb.plist.tpl -e "s|%couchdb_command_name%|$(couchdb_command_name)|" \ < $< > $@ +if WINDOWS + +# README.txt has \n line endings in the repo and must have \r\n +# when installed as notepad is used to view it. +# Also: the targets below don't seem to update after an svn-up (which +# changes the version string in the generated files) so we trick make +# into always building it with the FORCE pattern... +windows/README.txt: windows/README.txt.tpl FORCE + sed -e "s|%package_name%|@package_name@|g" \ + -e "s|%version%|@version@|g" \ + < $< | unix2dos > $@ + +windows/couchdb.iss: windows/couchdb.iss.tpl FORCE + sed -e "s|%configure_input%|$@. Generated from $< by configure.|" \ + -e "s|%package_name%|@package_name@|g" \ + -e "s|%locallibbindir%|`cygpath -m @locallibbindir@`|g" \ + -e "s|%version%|@version@|g" \ + -e "s|%openssl_bin_dir%|@openssl_bin_dir@|g" \ + -e "s|%msvc_redist_dir%|@msvc_redist_dir@|g" \ + -e "s|%msvc_redist_name%|@msvc_redist_name@|g" \ + < $< > $@ + +# The installer depends on all files, not just the source .iss file, +# so we trick make into always building it with the FORCE pattern... +windows/setup-couchdb-@version@.exe: windows/couchdb.iss windows/README.txt FORCE + $(INNO_COMPILER_EXECUTABLE) /q $< + @echo Windows Installer is at: `cygpath -a -w windows/setup-couchdb-@version@.exe` + +FORCE: + +endif + install-data-hook: if test -n "$(init_DATA)"; then \ chmod +x "$(DESTDIR)$(initdir)/couchdb"; \ diff --git a/etc/windows/README.txt.tpl b/etc/windows/README.txt.tpl new file mode 100644 index 00000000..485757a3 --- /dev/null +++ b/etc/windows/README.txt.tpl @@ -0,0 +1,24 @@ +This is the README for the %package_name% binary distribution for +Windows, version %version%. + +* Although CouchDB defaults to installing into your "Program Files" directory, + the permissions on the 'var' and 'etc' sub-directories have been adjusted + to allow modification by any authorized user so the couchdb databases, logs + and .ini files can be written. You may like to further restrict these + permissions to only the user who will be running couchdb. + +* To start couchdb execute couchdb.bat in the 'bin' directory. A shortcut + to this batch file should have been installed. There is currently no + support for Windows Services etc, but you are encouraged to look at the + various tools which allow arbitrary programs to be run as services. + +* The Futon application which comes with CouchDB does not work with + Internet Explorer - Mozilla Firefox is generally recommended. + +* The test suite is known to fail on Windows due to what appear to be + permissions errors; this is due to couch being unable to delete a + file while it is in use on Windows. + See also https://issues.apache.org/jira/browse/COUCHDB-326 + +* Additional help with the Windows support is needed - please contact the + couchdb-dev list if you can help. diff --git a/etc/windows/couchdb.iss.tpl b/etc/windows/couchdb.iss.tpl new file mode 100644 index 00000000..b673113e --- /dev/null +++ b/etc/windows/couchdb.iss.tpl @@ -0,0 +1,68 @@ +; Licensed under the Apache License, Version 2.0 (the "License"); you may not +; use this file except in compliance with the License. You may obtain a copy of +; the License at +; +; http://www.apache.org/licenses/LICENSE-2.0 +; +; Unless required by applicable law or agreed to in writing, software +; distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +; WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +; License for the specific language governing permissions and limitations under +; the License. + +; CouchDB inno installer script +; %configure_input% + +[Setup] +AppID=ApacheCouchDB +AppName=%package_name% +AppVerName=%package_name% %version% +AppPublisher=Apache Software Foundation +AppPublisherURL=http://couchdb.apache.org/ +LicenseFile=../../LICENSE +DefaultDirName={pf}\Apache Software Foundation\CouchDB +DefaultGroupName=%package_name% +OutputBaseFilename=setup-couchdb-%version% +OutputDir=. + +[Files] +Source: "%locallibbindir%\..\*.*"; DestDir: "{app}"; Flags: ignoreversion uninsrestartdelete restartreplace +; bin dir +Source: "%locallibbindir%\*.*"; DestDir: "{app}\bin"; Flags: ignoreversion uninsrestartdelete restartreplace recursesubdirs +; other dirs copied '*.*' +Source: "%locallibbindir%\..\erts-5.7.2\*.*"; DestDir: "{app}\erts-5.7.2"; Flags: ignoreversion uninsrestartdelete restartreplace recursesubdirs +Source: "%locallibbindir%\..\lib\*.*"; DestDir: "{app}\lib"; Flags: ignoreversion uninsrestartdelete restartreplace recursesubdirs +Source: "%locallibbindir%\..\share\*.*"; DestDir: "{app}\share"; Flags: ignoreversion uninsrestartdelete restartreplace recursesubdirs +Source: "%locallibbindir%\..\releases\*.*"; DestDir: "{app}\releases"; Flags: ignoreversion uninsrestartdelete restartreplace recursesubdirs +; skip ./usr, ./var + +; custom stuff... +; ./etc/default.ini is unconditional +Source: "%locallibbindir%\..\etc\couchdb\default.ini"; DestDir: "{app}\etc\couchdb"; Flags: ignoreversion uninsrestartdelete restartreplace +; ./etc/local.ini is preserved and should not be updated if it exists +Source: "%locallibbindir%\..\etc\couchdb\local.ini"; DestDir: "{app}\etc\couchdb"; Flags: onlyifdoesntexist uninsneveruninstall +; readme +Source: "README.txt"; DestDir: "{app}"; Flags: isreadme + +; msvc redists - see comments in configure.ac for notes about these... +; ( deleteafterinstall - not needed - {tmp} auto cleaned???? +Source: "%msvc_redist_dir%\%msvc_redist_name%"; DestDir: "{tmp}"; Flags: deleteafterinstall + +; These are erlang requirements and not copied by our makefiles. +Source: "%openssl_bin_dir%\ssleay32.dll"; DestDir: "{app}\bin"; Flags: ignoreversion uninsrestartdelete restartreplace +Source: "%openssl_bin_dir%\libeay32.dll"; DestDir: "{app}\bin"; Flags: ignoreversion uninsrestartdelete restartreplace + +[Dirs] +Name: "{app}\var\lib\couchdb"; Permissions: authusers-modify +Name: "{app}\var\log\couchdb"; Permissions: authusers-modify +Name: "{app}\etc\couchdb"; Permissions: authusers-modify + +[Icons] +Name: "{group}\Start CouchDB"; Filename: "{app}\bin\couchdb.bat" +Name: "{group}\Futon (CouchDB web interface)"; Filename: "http://127.0.0.1:5984/_utils" +Name: "{group}\CouchDB Web Site"; Filename: "http://couchdb.apache.org/" + +[Run] +Filename: "{tmp}\%msvc_redist_name%"; Parameters: "/q" +; This is erlang's Install.exe which updates erl.ini correctly. +Filename: "{app}\Install.exe"; Parameters: "-s"; Flags: runhidden -- cgit v1.2.3