-
Notifications
You must be signed in to change notification settings - Fork 9
Description
I got a private email with the following question:
I try to use debpkg project to automactly build .deb packages but i did't find the way to add postinst script.
this is an extract of my debpkg.yml:
name: service version: 1.1.0 {...} files: {...} - file: service dest: {{.BINDIR}}/serviceIt's could be great if you can give me some directives.
You need to add a control_extra section in the yaml file:
Script from file: https://github.com/xor-gate/debpkg/blob/master/config_test.go#L54-L58
Inline script: https://github.com/xor-gate/debpkg/blob/master/config_test.go#L96-L108
Let me know if it works. You could open a github issue this feature should be documented in the README.md
thats work like a charm :
root@115f40df64c1:/pkg# dpkg-deb -R service-1.1.7-x86_64.deb tmp
root@115f40df64c1:/pkg# cd tmp/
root@115f40df64c1:/pkg/tmp# ls
DEBIAN etc usr
root@115f40df64c1:/pkg/tmp# cd DEBIAN/
root@115f40df64c1:/pkg/tmp/DEBIAN# ls
conffiles control md5sums postinst
root@115f40df64c1:/pkg/tmp/DEBIAN# cat postinst
chown root:root /etc/service.conf
chown root:root /usr/bin/service
chmod 600 /etc/service.conf
chmod 700 /usr/bin/service
chmod u+s /usr/bin/service
root@115f40df64c1:/pkg/tmp/DEBIAN#debpkg.yml :
name: service
version: 1.1.7
architecture: amd64
maintainer: John Doe
maintainer_email: john@doe.com
section: doe
priority: standard
built_using: doe/builder
homepage: *****
description:
short: Doe service platform utility
long: >
This paackage install a simple utility
to restart or reload some services without
privileges.files:
- file: service.conf
dest: /etc/service.conf
conffile: true- file: service
dest: {{.BINDIR}}/service
control_extra:
postinst: postinstThank you very much^^