summaryrefslogtreecommitdiffstats
path: root/src/civetweb/VisualStudio/buildRelease.pl
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 18:24:20 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 18:24:20 +0000
commit483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch)
treee5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /src/civetweb/VisualStudio/buildRelease.pl
parentInitial commit. (diff)
downloadceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.tar.xz
ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.zip
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/civetweb/VisualStudio/buildRelease.pl')
-rw-r--r--src/civetweb/VisualStudio/buildRelease.pl71
1 files changed, 71 insertions, 0 deletions
diff --git a/src/civetweb/VisualStudio/buildRelease.pl b/src/civetweb/VisualStudio/buildRelease.pl
new file mode 100644
index 00000000..df8db092
--- /dev/null
+++ b/src/civetweb/VisualStudio/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;