flutter_to_debian은 Linux 시스템에서 프로덕션 배포를 위해 Flutter 애플리케이션을 Debian (.deb) 패키지로 쉽게 패키징하는 명령줄 도구입니다. 빌드 및 패키징 프로세스를 자동화하여 Debian 기반 배포판과의 호환성을 보장합니다. Linux 환경을 대상으로 하는 개발자를 위한 것으로, Flutter 개발 주기에 직접 네이티브 패키징 워크플로우를 통합함으로써 배포를 간소화합니다. 여러 플랫폼을 지원하지만 Linux 출력에 중점을 두어 서버 또는 데스크톱 Linux 배포에 이상적입니다.
사용 사례
생산 준비 완료된 .deb 패키지 만들기
Debian/Ubuntu 시스템에서 Flutter 앱 배포하기
Linux 앱 배포 자동화
CI/CD 파이프라인에 통합
데스크톱 리눅스 애플리케이션 빌드
주요 기능
자동 .deb 패키지 생성
다중 플랫폼 빌드를 지원합니다
Flutter 워크플로우와의 원활한 통합
사용자 정의 가능한 패키지 메타데이터
내장된 종속성 처리
적합한 대상
리눅스 데스크톱 앱 개발자
CI/CD 자동화 엔지니어
Flutter 배포를 관리하는 DevOps 팀
Flutter 앱을 배포하는 시스템 관리자
오픈소스 프로젝트 유지보수자
고려 사항
완전한 기능을 위해 Linux 환경이 필요합니다
Debian 기반 시스템에 한정
복잡한 종속성의 경우 수동 구성이 필요할 수 있습니다
Android/iOS 앱 배포를 위한 것이 아님
빌드 도구를 위해 추가 시스템 패키지가 필요할 수 있습니다
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
Flutter_to_debian
A simple command-line application to help you easily bundle your flutter app build into a debian package ready for production.
Overview of our debian packaging 📦
This plugin is a tool that builds debian package based on the instructions listed in a debian.yaml file. To get a basic understanding and its core concepts, take a look at the debian documentation. Additional links and information are listed at the bottom of this page.
Flutter debian.yaml example
Place the YAML file in your Flutter project under <project root>/debian/debian.yaml. (And remember the YAML files are sensitive to white space!) For example:
the app will be installed in a subdirectory (like mega_cool_app) in this
directory.
nonInteractive
When true, no prompt for confirmation is displayed during package installation.
default: /opt
Example:
parent: /usr/local/lib
the target directory is: /usr/local/lib/mega_cool_app
Package maintainer scripts
If the debian/scripts directory exists, executable files named
preinst, postinst, prerm and postrm in debian/scripts will be
copied to the package, as debian package maintainer scripts.
Note that any preinst script with overwrite the one generated by
default by this tool, effectively disabling the interactive confirmation
prompt shown before installation (as if nonInteractive: true was
used).
Additional files:
If a directory debian/skeleton exists that files will be copied into the package.
This can be used for default configuration files.
Example:
The file debian/skeleton/etc/megacool/main.conf will be installed as /etc/megacool/main.conf
Control
This is what describes to the apt package manager or what ever piece of software you are using to install your app what it's all about.
Depends
List the libraries your project depends on and they will be installed by the apt package manager before your app in installed on the system.
For example:
the pub.dev package flutter_secure_storage linux version depends on
libsecret-1-0 and libjsoncpp1
NB: more than one Depends are separated by " , " .
Desktop file and icon 🖥️
Desktop entry files are used to add an application to the desktop menu. These files specify the name and icon of your application, the categories it belongs to, related search keywords and more. These files have the extension .desktop and follow the XDG Desktop Entry Specification.
Flutter mega-cool-app.desktop example
Place the .desktop file in your Flutter project under <project root>/debian/gui/mega-cool-app.desktop.
Notice: icon and .desktop file name must be the same as your app name in yaml file!
For example:
[DesktopEntry]
Version=1.0Name=MegaCoolAppGenericName=MegaCoolAppComment=A MegaCoolApp that does everything
Terminal=falseType=ApplicationCategories=UtilityKeywords=Flutter;share;files;
Place your icon with .png extension in your Flutter project under <project root>/debian/gui/mega-cool-app.png.
Build the debian package 📦
Once the gui/ folder and debian.yaml file are complete. Run flutter_to_debian as follows from the root directory of the project.
first build your project
$ flutter build linux
install flutter_to_debian if not done yet.
$ dart pub global activate flutter_to_debian
Run flutter_to_debian as follows.
$ flutter_to_debian
Locate and install your .deb app's package 📦
From the root directory of the project, Find it at.
$ cd debian/packages && ls
Install
$ sudo dpkg -i [package_name].deb
Dependency Finder
The command flutter_to_debian can be used to find the dependencies of an amount of library files.
Call flutter_to_debian help to see this description:
Usage: flutter_to_debian [<mode> [<options>] ]
<mode>:
help
Printthis usage.
create
Creates a folder and template files for the Debian package.
build
Build a Debian package file *.deb. Thisis the default mode.
dependencies [<opts>] [<file1> [ <file2>...]]
Detects the dependencies of a amount of library files.
<fileX> can be a file or a directory.
<opts>:
--excluded-packages=<comma-separated-list-of-names>
That packages will be excluded from detection
--excluded-libraries=<pattern>
Excludes that library files from detection. <pattern> is a regular expr.
Examples:
flutter_to_debian
Creates the Debian package described in ./debian/debian.yaml
flutter_to_debian dependencies
Detects the dependencies of the files in ./build/linux/x64/release/bundle/lib
and uses the information of debian/debian.yaml
flutter_to_debian dependencies --excl-lib=-dev|^my_lib release/libs
Detects the dependencies of the files in release/libs without the excluded
specified by "-dev|^my_lib":
The file release/libs/our_lib-dev.2.so and release/libs/my_lib-dev.2.so
will be excluded from detection.
flutter_to_debian dependencies --excluded-packages=lintian,my-project prod/libs
Detects the dependencies of the files in prod/libs
The packages lintian and my-project will be excluded from processing.
Note: modes and options can be abbreviated: --ex-pack means --excluded-packages
Contributions 🤝
Please all PR's and found issues are highly welcome at flutter_to_debian