diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..73271d9
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2026 Nitload-NSI
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/README.md b/README.md
index e4f7eb8..ed74406 100644
--- a/README.md
+++ b/README.md
@@ -38,4 +38,8 @@ docs/ 设计、状态与验收文档
deploy/ Windows Service 与 systemd 模板
```
-阅读[文档库](docs/README.md)、[单域名通信入口](docs/client-server-transport.md)、[架构](docs/architecture.md)、[交付状态](docs/implementation-status.md)和[贡献指南](CONTRIBUTING.md)。
\ No newline at end of file
+阅读[文档库](docs/README.md)、[单域名通信入口](docs/client-server-transport.md)、[架构](docs/architecture.md)、[交付状态](docs/implementation-status.md)和[贡献指南](CONTRIBUTING.md)。
+
+## 许可证
+
+Charac 项目代码采用 [MIT 许可证](LICENSE)。Client 内嵌的 IBM Plex Mono 字体采用 [SIL Open Font License 1.1](src/client/Assets/Fonts/IBM-Plex-LICENSE.txt),不属于项目的 MIT 授权范围。
diff --git a/packaging/package.ps1 b/packaging/package.ps1
index 7d69e5a..8418fbf 100644
--- a/packaging/package.ps1
+++ b/packaging/package.ps1
@@ -50,7 +50,7 @@ if ($Target -eq 'ClientMsi') {
if (-not $WixPath) { $WixPath = Join-Path $repository 'temp/tools/wix.exe' }
if (-not (Test-Path -LiteralPath $WixPath -PathType Leaf)) { throw 'WiX CLI 6.0.2 is required; pass -WixPath.' }
$output = Join-Path $packages "charac-client_${version}_win-x64.msi"
- & $WixPath build '-arch' 'x64' '-d' "PackageVersion=$version" '-d' "PayloadDir=$payload" '-d' "ConfigTemplatePath=$(Join-Path $repository 'client.config.example')" '-pdbtype' 'none' '-o' $output (Join-Path $PSScriptRoot 'windows/Client.wxs')
+ & $WixPath build '-arch' 'x64' '-d' "PackageVersion=$version" '-d' "PayloadDir=$payload" '-d' "ConfigTemplatePath=$(Join-Path $repository 'client.config.example')" '-d' "LicensePath=$(Join-Path $repository 'LICENSE')" '-pdbtype' 'none' '-o' $output (Join-Path $PSScriptRoot 'windows/Client.wxs')
if ($LASTEXITCODE -ne 0) { throw "WiX failed with exit code $LASTEXITCODE." }
Write-Output $output
exit 0
@@ -65,12 +65,12 @@ if ($Target -eq 'ClientTermuxDeb') {
$lines = [System.Collections.Generic.List[string]]::new()
$lines.Add('name: charac')
$lines.Add("version: $version")
- $lines.Add('release: 1')
+ $lines.Add('release: 2')
$lines.Add('arch: aarch64')
$lines.Add('platform: linux')
$lines.Add('maintainer: nitload')
$lines.Add('vendor: nitload')
- $lines.Add('license: Proprietary')
+ $lines.Add('license: MIT AND OFL-1.1')
$lines.Add('description: Charac CLI for Termux')
$lines.Add('depends:')
$lines.Add(' - dotnet-runtime-10.0')
@@ -82,9 +82,11 @@ if ($Target -eq 'ClientTermuxDeb') {
Add-PackageFile $lines $file.FullName "$prefix/opt/charac/$relative" $mode
}
Add-PackageFile $lines (Join-Path $PSScriptRoot 'termux/charac') "$prefix/bin/charac" '0755'
+ Add-PackageFile $lines (Join-Path $repository 'LICENSE') "$prefix/share/doc/charac/LICENSE"
+ Add-PackageFile $lines (Join-Path $repository 'src/client/Assets/Fonts/IBM-Plex-LICENSE.txt') "$prefix/share/doc/charac/IBM-Plex-LICENSE.txt"
$config = Join-Path $scratch 'charac-termux.yaml'
[IO.File]::WriteAllLines($config, [string[]]$lines)
- $output = Join-Path $packages "charac_${version}-1_aarch64.deb"
+ $output = Join-Path $packages "charac_${version}-2_aarch64.deb"
& $NfpmPath package --config $config --packager deb --target $output
if ($LASTEXITCODE -ne 0) { throw "nFPM failed with exit code $LASTEXITCODE." }
Write-Output $output
@@ -99,7 +101,7 @@ if (-not $NfpmPath) { $NfpmPath = Join-Path $repository 'temp/tools/nfpm/nfpm.ex
if (-not (Test-Path -LiteralPath $NfpmPath -PathType Leaf)) { throw 'nFPM 2.47.0 is required; pass -NfpmPath.' }
$name = "charac-$kind"
-$release = if ($kind -eq 'server') { '2' } else { '1' }
+$release = if ($kind -eq 'server') { '3' } else { '2' }
$lines = [System.Collections.Generic.List[string]]::new()
$lines.Add("name: $name")
$lines.Add("version: $version")
@@ -108,7 +110,7 @@ $lines.Add('arch: amd64')
$lines.Add('platform: linux')
$lines.Add('maintainer: nitload')
$lines.Add('vendor: nitload')
-$lines.Add('license: Proprietary')
+$lines.Add($(if ($kind -eq 'server') { 'license: MIT' } else { 'license: MIT AND OFL-1.1' }))
$lines.Add("description: Charac $kind")
if ($kind -eq 'server') {
$lines.Add('depends:')
@@ -118,6 +120,11 @@ if ($kind -eq 'server') {
$lines.Add(' postremove: ' + (ConvertTo-Json -InputObject (Join-Path $PSScriptRoot 'linux/server-postremove.sh') -Compress))
}
$lines.Add('contents:')
+$licenseDirectory = "/usr/share/licenses/$name"
+Add-PackageFile $lines (Join-Path $repository 'LICENSE') "$licenseDirectory/LICENSE"
+if ($kind -eq 'client') {
+ Add-PackageFile $lines (Join-Path $repository 'src/client/Assets/Fonts/IBM-Plex-LICENSE.txt') "$licenseDirectory/IBM-Plex-LICENSE.txt"
+}
$files = Get-ChildItem -LiteralPath $payload -Recurse -File | Sort-Object FullName
foreach ($file in $files) {
$relative = [IO.Path]::GetRelativePath($payload, $file.FullName).Replace('\', '/')
diff --git a/packaging/windows/Client.wxs b/packaging/windows/Client.wxs
index f7e3fc9..978363c 100644
--- a/packaging/windows/Client.wxs
+++ b/packaging/windows/Client.wxs
@@ -17,12 +17,16 @@
+
+
+
+
-
\ No newline at end of file
+