package a single text file into a .deb (possibly on MSYS2/MINGW64)?
0
votes
1
answer
73
views
I have found a similar question on https://askubuntu.com/questions/144547/how-to-package-a-single-text-file-into-a-deb - unfortunately there is no answer I can use.
Basically, I want to manage a text file, say
myapp.txt.config
, in git; and then, I'd want to create a .deb
package that copies it on Raspberry Pi in /usr/share/myapp/myapp.txt.config
. However, most of the work I do in this repository is in MSYS2/MINGW64 on Windows 10, so I would like to avoid the round-trip to a Raspberry Pi, just to build the .deb package. Since this is just a text file, I'd like a single .deb to be valid for all distributions (stretch, bookworm for Raspbian).
How would I go about implementing this? I can see that a .deb
file is an [ar archive with tar archives inside](https://en.wikipedia.org/wiki/Deb_(file_format)) - and there is working ar
, tar
, install
, bash
, python3
, perl
, make
on MSYS2/MINGW64, however there are no Debian tools in the MSYS2/MINGW64 repos, as MSYS2 uses pacman
instead.
I have seen in https://askubuntu.com/questions/90764/how-do-i-create-a-deb-package-for-a-single-python-script that the basic source package layout would be:
myapp-config/
-- myapp.txt.config
-- debian/
-- changelog
-- copyright
-- compat
-- rules
-- control
-- install
... but I'd have to run dch --create
to "create a properly formatted debian/changelog
entry", and debuild --no-tgz-check
to build; though dch
is a Perl script ([devscripts/scripts/debchange.pl](https://github.com/Debian/devscripts/blob/master/scripts/debchange.pl)) , and so is debuild
([devscripts/scripts/debuild.pl](https://github.com/Debian/devscripts/blob/master/scripts/debuild.pl)) ; but I cannot tell to what extent they will work on MSYS2/MINGW64.
I thought also of creating a Makefile with a [single install
entry](https://stackoverflow.com/questions/39892692/how-to-implement-make-install-in-a-makefile) :
install:
install -D -m 644 myapp.txt.config /usr/share/myapp/
... and then calling [checkinstall](https://github.com/ruxkor/checkinstall/blob/master/checkinstall) on it to create a deb package; checkinstall
seems to be bash, but I cannot tell if it will run on MSYS2/MINGW64, as it probably needs sudo
- also that github version is from 13 years ago, and it might even be that checkinstall
is [no longer being maintained](https://askubuntu.com/questions/1138384/why-is-checkinstall-no-longer-being-maintained) .
So, what would be the right approach to build a .deb package in my case? If there is no way to build a .deb package on MSYS2/MINGW64, what would be the right way to organize the project, so I build this single-text-file .deb on Raspberry Pi with least amount of effort?
Asked by sdbbs
(578 rep)
Aug 9, 2024, 12:47 PM
Last activity: Dec 17, 2024, 05:42 PM
Last activity: Dec 17, 2024, 05:42 PM