ygoe / dotnetmakedeb Goto Github PK
View Code? Open in Web Editor NEWCreates a .deb Debian binary package from a specification file through the dotnet CLI command or as standalone command-line tool.
License: MIT License
Creates a .deb Debian binary package from a specification file through the dotnet CLI command or as standalone command-line tool.
License: MIT License
It would be great to have the possibillity not only to copy the files within the source directory, but also the files in subdirectories.
This would make the package build of a ASP.NET Core application more easy as you'll have many folders within your wwwroot
.
Currently config.tar.gz
section can only have following files:
control
md5sums
conffiles
preinst
postinst
prerm
postrm
Because I want to display prompt for custom user input to pre-configure the package, I am planning to add feature that allow *.debspec
file to add config
and templates
file as well.
My plan is to create controlfile
(control file) directive with following description:
Sets the name of any kind of additional control file (e.g.
config
,templates
). This file is included in the control part of the package and may be called during uninstallation or other operations of the package. It will not be available on the target system after installation. This directive has multiple parameters that are separated by white-space (any number of spaces or tabs):
- The source path: The file is read from this path. Non-rooted paths are interpreted relative to the base path, if set before this directive.
- Optional: text keyword to convert the file from DOS to Unix line endings.
- The file mode: The target file is created with the specified mode, written in the usual octal notation. If unset, the default file mode is 644 (owner-write, world-read, no execute).
- The file user ID: The target file is owned by the user with the specified numeric user ID. If unset, the file will be owned by the root user (ID 0).
- The file group ID: The target file is owned by the group with the specified numeric group ID. If unset, the file will be owned by the root group (ID 0).
The source path may contain wildcards (* and ?) in the file name (not in the directory). If such a wildcard occurs, a file item for each local found file is added in place of this directive. All other parameters (mode, owner, group) are applied equally to all found files.
If the last path segment (the file name) of the source path is ** then all files from the specified directory and all its subdirectories are included. This allows the inclusion of entire subtrees of directories and files.
Source files can be specified multiple times. The last entry will overwrite any previous entry. This can be used to set different modes or owners for specific files that were already covered by a wildcard. In this case, the wildcard entry must occur before the specific file entry.
References to debconf
:
Would it be possible to update the target to .net 7?
Thank you for providing this library by the way :)
There should be an option to convert text files from DOS/Windows line endings to the Unix format, on a per-file basis. This is useful for configuration files that are also used on Windows platforms. Most Linux editors can handle DOS line endings (recent Windows notepad can even handle Unix line endings) but the file should be formatted correctly for the target platform. It might also be useful for shell scripts (which must have Unix format) where the VCS doesn't support managing line formats explicitly (like Git defaults).
I noticed if I write the *.debspec
like so:
# Common directory variables
APP_NAME = myappnameisverylong
APP_NAME_SHORT = myapp # Workaround for https://github.com/ygoe/DotnetMakeDeb/issues/3
It will trigger error:
Process is terminated due to StackOverflowException.
Hi @ygoe I got following error:
Error: An unhandled exception has occurred: FileName is too long. It must be less than 100 bytes.
When trying to create Debian package with following *.debspec
:
# Spec file options
basepath: .
outdir: .
# Common directory variables
APP_NAME = myapp
SETUP_DIR = Setup\Linux
INSTALLDIR = Files\INSTALLDIR
PROGRAMDATA_CONFIG_DIR = Files\PROGRAMDATA_CONFIG_DIR
OPT_DIR = opt/{APP_NAME}
VAR_DIR = var/opt/{APP_NAME}
# Package control file
package: {APP_NAME}
version: 1.0.0.0
architecture: amd64
maintainer: John Doe <[email protected]>
homepage: https://john.doe.com/
description: My App is created by John Doe.
# Maintenance scripts
preinst: {SETUP_DIR}\preinst text
postinst: {SETUP_DIR}\postinst text
prerm: {SETUP_DIR}\prerm text
postrm: {SETUP_DIR}\postrm text
# Startup scripts
file: {SETUP_DIR}\{APP_NAME} etc/init.d/ 755
# Application files
file: {INSTALLDIR}\** {OPT_DIR}/ 755
# Configuration
conffile: {INSTALLDIR}\Configuration\** {OPT_DIR}/Configuration/ 755
conffile: {PROGRAMDATA_CONFIG_DIR}\** {VAR_DIR}/ 755
# This line seems the one that causing trouble
file: {INSTALLDIR}\Configuration\** {OPT_DIR}/abcdefghijklmnopqrstuvwxyz/abcdefghijklmnopqrstuvwxyz/abcdefghijklmnopqrstuvwxyz/ 755
Do the target path have path+file name length limitation? How can we get around this issue, since from what I have look up following are the limitation in Linux (source: Ref: https://askubuntu.com/a/859953/937325):
The max filename length is 255 bytes.
And a maximum path of 4096 characters.
I have tried your example at https://htmlpreview.github.io/?https://github.com/ygoe/DotnetMakeDeb/blob/master/MakeDeb.html or specifically at
Line 426 in 9b71c28
conffile: Setup\Config\Linux\myapp.cfg text {ETCDIR}/
Running that example will give me:
Specification file: D:\Documents\Visual Studio\DotnetMakeDeb\Example\myapp.debspec
Error: An unhandled exception has occurred: Unrecognised directive in line 30.
Press any key to exit...
It seems conffile
directive does not support text
keyword?
Hi! I have discovered this project but it seems to cover only .deb files, (I know, that's the name of the project)
I wonder if you would like to cover more packaging formats for more OSes like Windows, Mac, Android...
I've found this project https://github.com/quamotion/dotnet-packaging, but it's not compatible with .NET 7+ and it seems unmaintained. I hope you can collaborate or create your own version.
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.