Explorar o código

Added ZIP installation build for Windows

Also moved version define to the header.
Thomas Davis %!s(int64=11) %!d(string=hai) anos
pai
achega
4d9a202f76

+ 1 - 0
.gitignore

@@ -7,6 +7,7 @@ out
 *.dmg
 *.msi
 *.exe
+*.zip
 Output
 
 #################

+ 3 - 3
Makefile.deprecated

@@ -153,7 +153,7 @@ Civetweb: $(LIB_SOURCES) src/main.c
           -framework Cocoa -ObjC -arch i386 -arch x86_64 -o Civetweb
 
 cocoa: Civetweb
-	V=`perl -lne '/define\s+CIVETWEB_VERSION\s+"(\S+)"/ and print $$1' $(LIB_SOURCES)`; DIR=dmg/Civetweb.app && rm -rf $$DIR && mkdir -p $$DIR/Contents/{MacOS,Resources} && install -m 644 resources/civetweb_*.png resources/civetweb.icns $$DIR/Contents/Resources/ && install -m 644 resources/Info.plist $$DIR/Contents/ && install -m 755 Civetweb $$DIR/Contents/MacOS/ && ln -fs /Applications dmg/ ; hdiutil create Civetweb_$$V.dmg -volname "Civetweb $$V" -srcfolder dmg -ov #; rm -rf dmg
+	V=`perl -lne '/define\s+CIVETWEB_VERSION\s+"(\S+)"/ and print $$1' include/civetweb.h`; DIR=dmg/Civetweb.app && rm -rf $$DIR && mkdir -p $$DIR/Contents/{MacOS,Resources} && install -m 644 resources/civetweb_*.png resources/civetweb.icns $$DIR/Contents/Resources/ && install -m 644 resources/Info.plist $$DIR/Contents/ && install -m 755 Civetweb $$DIR/Contents/MacOS/ && ln -fs /Applications dmg/ ; hdiutil create Civetweb_$$V.dmg -volname "Civetweb $$V" -srcfolder dmg -ov #; rm -rf dmg
 
 un:
 	$(CC) test/unit_test.c -o unit_test -I. -I$(LUA) $(LUA_SOURCES) \
@@ -196,11 +196,11 @@ tests:
 	perl test/test.pl $(TEST)
 
 tarball: clean
-	F=civetweb-`perl -lne '/define\s+CIVETWEB_VERSION\s+"(\S+)"/ and print $$1' $(LIB_SOURCES)`.tgz ; cd .. && tar -czf x civetweb/{LICENSE.md,Makefile,examples,test,resources,*.[ch],*.md} && mv x civetweb/$$F
+	F=civetweb-`perl -lne '/define\s+CIVETWEB_VERSION\s+"(\S+)"/ and print $$1' include/civetweb.h`.tgz ; cd .. && tar -czf x civetweb/{LICENSE.md,Makefile,examples,test,resources,*.[ch],*.md} && mv x civetweb/$$F
 
 release: tarball cocoa
 	wine make windows
-	V=`perl -lne '/define\s+CIVETWEB_VERSION\s+"(\S+)"/ and print $$1' $(LIB_SOURCES)`; upx civetweb.exe; cp civetweb.exe civetweb-$$V.exe; cp civetweb.exe civetweb_php_bundle/; zip -r civetweb_php_bundle_$$V.zip civetweb_php_bundle/
+	V=`perl -lne '/define\s+CIVETWEB_VERSION\s+"(\S+)"/ and print $$1' include/civetweb.h`; upx civetweb.exe; cp civetweb.exe civetweb-$$V.exe; cp civetweb.exe civetweb_php_bundle/; zip -r civetweb_php_bundle_$$V.zip civetweb_php_bundle/
 
 clean:
 	rm -rf *.o *.core $(PROG) *.obj *.so $(PROG).txt *.dSYM *.tgz \

+ 1 - 1
Makefile.osx

@@ -18,7 +18,7 @@ CONTENTS_DIR = $(DMG_DIR)/$(PACKAGE).app/Contents
 RESOURCES_DIR = $(CONTENTS_DIR)/Resources
 OSXBIN_DIR = $(CONTENTS_DIR)/MacOS
 
-CIVETWEB_VERSION = $(shell perl -lne '/define\s+CIVETWEB_VERSION\s+"(\S+)"/ and print $$1' src/civetweb.c)
+CIVETWEB_VERSION = $(shell perl -lne '/define\s+CIVETWEB_VERSION\s+"(\S+)"/ and print $$1' include/civetweb.h)
 
 include Makefile
 

+ 3 - 0
RELEASE_NOTES.md

@@ -6,6 +6,9 @@ In planning.
 Changes
 -------
 
+- Moved CEVITWEB_VERSION define into civetweb.h
+- Added new simple zip deployment build for Windows. 
+- Removed windows install package build.
 - Fixes page violation in mod_lua.inl (apkbox)
 - Use C style comments to enable compiling most of civetweb with -ansi. (F-Secure Corporation)
 - Allow directories with non ASCII characters in Windows in UTF-8 encoded (bel2125)

+ 71 - 0
VS2012/buildRelease.pl

@@ -0,0 +1,71 @@
+#!/usr/bin/perl
+# 
+# Copyright (c) 2013 No Face Press, LLC
+# License http://opensource.org/licenses/mit-license.php MIT License
+#
+
+# This script builds and packages a Windows release.
+# It requires ActiveState Perl to use and is intended
+# to be run from the its directory under the 
+# VS Developer Command Prompt.
+
+# Create a Zip file
+use Archive::Zip qw( :ERROR_CODES :CONSTANTS );
+my $zip = Archive::Zip->new();
+
+my $src = "..";
+
+sub getCivetwebVersion {
+    print "Fetching CivetWeb version...\n";
+    open HEADER, "${src}/include/civetweb.h";
+    while (<HEADER>) {
+        if (m/define\s+CIVETWEB_VERSION\s+"(.+)"/) {
+            close HEADER;
+            return $1;
+        }
+    }
+    close HEADER;
+    return "UNKNOWN_VERSION";
+}
+
+my $CIVETWEB_VERSION = getCivetwebVersion();
+my $basename         = "civetweb-$CIVETWEB_VERSION";
+my $dir              = "${basename}";
+
+sub build32() {
+    print "\nBuilding Win32 Release version...\n";
+    system("msbuild /p:Configuration=Release /p:Platform=Win32 civetweb.sln");
+}
+
+sub build64() {
+    print "\nBuilding x64 Release version...\n";
+    system("msbuild /p:Configuration=Release /p:Platform=x64 civetweb.sln");
+}
+
+sub writeArchive() {
+    my $archive = "${basename}-win.zip";
+    print "Creating archive $archive ...\n";
+
+    $zip->addDirectory("${dir}/");
+
+    $zip->addFile( "${src}/LICENSE.md",            "${dir}/LICENSE.md" );
+    $zip->addFile( "${src}/README.md",             "${dir}/README.md" );
+    $zip->addFile( "${src}/resources/systray.ico", "${dir}/systray.ico" );
+    $zip->addFile( "${src}/resources/civetweb_64x64.png",
+        "${dir}/civetweb_64x64.png" );
+    $zip->addFile( "${src}/resources/itworks.html", "${dir}/index.html" );
+    $zip->addFile( "${src}/VS2012/Release/Win32/civetweb_lua.exe",
+        "${dir}/civetweb32.exe" );
+    $zip->addFile( "${src}/VS2012/Release/x64/civetweb_lua.exe",
+        "${dir}/civetweb64.exe" );
+
+    unless ( $zip->writeToFileNamed($archive) == AZ_OK ) {
+        die 'write error';
+    }
+
+}
+
+build32();
+build64();
+writeArchive();
+exit 0;

+ 2 - 0
VS2012/civetweb_lua/civetweb_lua.vcxproj

@@ -28,6 +28,7 @@
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>MultiByte</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
@@ -40,6 +41,7 @@
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>MultiByte</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>

+ 0 - 50
VS2012/innosetup/civetweb32_setup.iss

@@ -1,50 +0,0 @@
-; Script generated by the Inno Setup Script Wizard.
-; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
-
-[Setup]
-; NOTE: The value of AppId uniquely identifies this application.
-; Do not use the same AppId value in installers for other applications.
-; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
-AppId={{49C9C975-D874-463C-BFD4-FD5ACDE796C0}
-AppName=Civetweb
-AppVersion=1.5
-;AppVerName=Civetweb 1.5
-AppPublisher=No Face Press, LLC.
-AppPublisherURL=https://sourceforge.net/projects/civetweb/
-AppSupportURL=https://sourceforge.net/projects/civetweb/
-AppUpdatesURL=https://sourceforge.net/projects/civetweb/
-DefaultDirName={pf}\Civetweb
-DefaultGroupName=Civetweb
-LicenseFile=..\..\LICENSE.md
-OutputDir=..\..
-OutputBaseFilename=civetweb32_setup
-SetupIconFile=..\..\resources\systray.ico
-Compression=lzma
-SolidCompression=yes
-ArchitecturesAllowed=x86 x64 
-
-[Languages]
-Name: "english"; MessagesFile: "compiler:Default.isl"
-
-[Tasks]
-Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
-
-[Dirs]
-Name: "{app}"; Permissions: users-modify
-
-[Files]
-Source: "..\..\VS2012\Release\win32\civetweb_lua.exe"; DestDir: "{app}"; DestName: "civetweb.exe" ; Flags: ignoreversion
-Source: "..\..\LICENSE.md"; DestDir: "{app}"; Flags: ignoreversion
-Source: "..\..\README.md"; DestDir: "{app}"; Flags: ignoreversion
-Source: "..\..\resources\systray.ico"; DestDir: "{app}"; Flags: ignoreversion
-Source: "..\..\resources\civetweb_64x64.png"; DestDir: "{app}"; Flags: ignoreversion
-Source: "..\..\resources\itworks.html"; DestDir: "{app}"; DestName: "index.html"; Flags: ignoreversion
-; NOTE: Don't use "Flags: ignoreversion" on any shared system files
-
-[Icons]
-Name: "{group}\Civetweb"; Filename: "{app}\civetweb.exe"; IconFilename: "{app}\systray.ico"
-Name: "{commondesktop}\Civetweb"; Filename: "{app}\civetweb.exe"; Tasks: desktopicon; IconFilename: "{app}\systray.ico"
-
-[Run]
-Filename: "{app}\civetweb.exe"; Description: "{cm:LaunchProgram,Civetweb}"; Flags: nowait postinstall skipifsilent
-

+ 0 - 51
VS2012/innosetup/civetweb64_setup.iss

@@ -1,51 +0,0 @@
-; Script generated by the Inno Setup Script Wizard.
-; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
-
-[Setup]
-; NOTE: The value of AppId uniquely identifies this application.
-; Do not use the same AppId value in installers for other applications.
-; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
-AppId={{49C9C975-D874-463C-BFD4-FD5ACDE796C0}
-AppName=Civetweb
-AppVersion=1.5
-;AppVerName=Civetweb 1.5
-AppPublisher=No Face Press, LLC.
-AppPublisherURL=https://sourceforge.net/projects/civetweb/
-AppSupportURL=https://sourceforge.net/projects/civetweb/
-AppUpdatesURL=https://sourceforge.net/projects/civetweb/
-DefaultDirName={pf}\Civetweb
-DefaultGroupName=Civetweb
-LicenseFile=..\..\LICENSE.md
-OutputDir=..\..
-OutputBaseFilename=civetweb64_setup
-SetupIconFile=..\..\resources\systray.ico
-Compression=lzma
-SolidCompression=yes
-ArchitecturesInstallIn64BitMode=x64
-ArchitecturesAllowed=x64 
-
-[Languages]
-Name: "english"; MessagesFile: "compiler:Default.isl"
-
-[Tasks]
-Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
-
-[Dirs]
-Name: "{app}"; Permissions: users-modify
-
-[Files]
-Source: "..\..\VS2012\Release\x64\civetweb_lua.exe"; DestDir: "{app}"; DestName: "civetweb.exe" ; Flags: ignoreversion
-Source: "..\..\LICENSE.md"; DestDir: "{app}"; Flags: ignoreversion
-Source: "..\..\README.md"; DestDir: "{app}"; Flags: ignoreversion
-Source: "..\..\resources\systray.ico"; DestDir: "{app}"; Flags: ignoreversion
-Source: "..\..\resources\civetweb_64x64.png"; DestDir: "{app}"; Flags: ignoreversion
-Source: "..\..\resources\itworks.html"; DestDir: "{app}"; DestName: "index.html"; Flags: ignoreversion
-; NOTE: Don't use "Flags: ignoreversion" on any shared system files
-
-[Icons]
-Name: "{group}\Civetweb"; Filename: "{app}\civetweb.exe"; IconFilename: "{app}\systray.ico"
-Name: "{commondesktop}\Civetweb"; Filename: "{app}\civetweb.exe"; Tasks: desktopicon; IconFilename: "{app}\systray.ico"
-
-[Run]
-Filename: "{app}\civetweb.exe"; Description: "{cm:LaunchProgram,Civetweb}"; Flags: nowait postinstall skipifsilent
-

+ 2 - 0
VS2012/lua_lib/lua_lib.vcxproj

@@ -28,6 +28,7 @@
     <ConfigurationType>StaticLibrary</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
     <ConfigurationType>StaticLibrary</ConfigurationType>
@@ -40,6 +41,7 @@
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
     <ConfigurationType>StaticLibrary</ConfigurationType>

+ 1 - 1
contrib/buildroot/civetweb.mk

@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-CIVETWEB_VERSION = 1.4
+CIVETWEB_VERSION = 1.5
 CIVETWEB_SITE = http://github.com/sunsetbrew/civetweb/tarball/v$(CIVETWEB_VERSION)
 CIVETWEB_LICENSE = MIT
 CIVETWEB_LICENSE_FILES = LICENSE.md

+ 4 - 0
include/civetweb.h

@@ -22,6 +22,10 @@
 #ifndef CIVETWEB_HEADER_INCLUDED
 #define CIVETWEB_HEADER_INCLUDED
 
+#ifndef CIVETWEB_VERSION
+#define CIVETWEB_VERSION "1.5"
+#endif
+
 #include <stdio.h>
 #include <stddef.h>
 

+ 0 - 1
src/civetweb.c

@@ -265,7 +265,6 @@ typedef int SOCKET;
 
 #include "civetweb.h"
 
-#define CIVETWEB_VERSION "1.5"
 #define PASSWORDS_FILE_NAME ".htpasswd"
 #define CGI_ENVIRONMENT_SIZE 4096
 #define MAX_CGI_ENVIR_VARS 64