# Linux Service App - Linux服务应用示例配置 # 这个示例展示了如何为Linux服务应用配置DEB和RPM安装包 name: "LinuxServiceApp" version: "0.9.5" description: "A Linux service application" author: "Linux Developer" license: "GPL-3.0" # 构建目标 - 为Linux生成DEB和RPM安装包 targets: - platform: "linux" arch: "amd64" packageType: "deb" outputPath: "dist/debian" - platform: "linux" arch: "amd64" packageType: "rpm" outputPath: "dist/redhat" - platform: "linux" arch: "arm64" packageType: "deb" outputPath: "dist/debian-arm64" - platform: "linux" arch: "arm64" packageType: "rpm" outputPath: "dist/redhat-arm64" # 文件 - 指定要包含在安装包中的文件 files: - source: "bin/service-app" destination: "usr/bin/service-app" permissions: "0755" - source: "config/service-app.conf" destination: "etc/service-app/service-app.conf" permissions: "0644" - source: "systemd/service-app.service" destination: "lib/systemd/system/service-app.service" permissions: "0644" - source: "docs/README.md" destination: "usr/share/doc/service-app/README.md" permissions: "0644" - source: "docs/man/service-app.1" destination: "usr/share/man/man1/service-app.1" permissions: "0644" # 目录 - 指定要包含在安装包中的目录 directories: - source: "data" destination: "var/lib/service-app" permissions: "0755" recursive: true - source: "scripts" destination: "usr/share/service-app/scripts" permissions: "0755" recursive: true # Linux特定配置 plugins: # DEB包配置 deb: section: "net" priority: "optional" maintainer: "Linux Developer " homepage: "https://example.com/service-app" # 控制脚本 scripts: preinst: "debian/preinst" postinst: "debian/postinst" prerm: "debian/prerm" postrm: "debian/postrm" # 创建用户和组 user: name: "service-app" system: true group: "service-app" home: "/var/lib/service-app" shell: "/usr/sbin/nologin" # 配置文件标记 conffiles: - "/etc/service-app/service-app.conf" # RPM包配置 rpm: group: "Applications/Internet" vendor: "Example Corp" url: "https://example.com/service-app" # 控制脚本 scripts: pre: "rpm/pre" post: "rpm/post" preun: "rpm/preun" postun: "rpm/postun" # 创建用户和组 user: name: "service-app" system: true group: "service-app" home: "/var/lib/service-app" shell: "/usr/sbin/nologin" # 配置文件标记 config: - "/etc/service-app/service-app.conf" # 安装前脚本 - 检查系统要求 preInstall: path: "scripts/pre-install.sh" type: "shell" args: ["--check-deps"] # 安装后脚本 - 启动服务 postInstall: path: "scripts/post-install.sh" type: "shell" args: ["--start-service"] # 依赖项 - Linux服务运行所需的依赖 dependencies: - name: "openssl" version: ">=1.1.0" type: "runtime" - name: "systemd" version: ">=230" type: "runtime" - name: "libpq5" version: ">=12.0" type: "runtime"