I am creating a .deb package that needs a MySQL database. I am building the package using dpkg-deb --build
. While installing I want my post install script to execute an SQL script to set up the database like so:
cat setup.sql | mysql -u root -p
I am currently putting setup.sql into the "DEBIAN" folder of my package. What path do I need to specify in my post install script to find this SQL script?
I know I could embed the SQL contents into my post-install script but I want to keep them separate for code maintenance reasons.
postinst
script. Is/usr/share/<name/
a more standard location? Should I be tidying up after installation or leaving them there?/usr/share/package
is yours to do what you want in, and yes, that’s the standard location for such files. You should leave them alone,postinst
shouldn’t delete files which are shipped in a package. – Stephen Kitt Nov 17 '17 at 15:27