ydotool icon indicating copy to clipboard operation
ydotool copied to clipboard

issues creating debian package

Open maxadamo opened this issue 3 years ago • 1 comments

In case you want to create a deb package, I find it very easy with the following procedure (I don't know if there is a better way using Github Actions).

  1. install fpm once: gem install fpm
  2. run your cmake and make and then, inside the build/ directory you can run the followings:
PROG_VERSION=x.x.x
[email protected]
DESC='Generic Linux command-line automation tool'
gzip manpage/ydotool.1 manpage/ydotoold.8
strip ydotool ydotoold

# There we go:
fpm -f -t deb -n $PROG_NAME -v $PROG_VERSION -m "$EMAIL" --vendor "$EMAIL" \
    --url https://github.com/ReimuNotMoe/ydotool -a x86_64 \
    --deb-use-file-permissions --deb-systemd ./ydotool.service --deb-systemd-enable 
    --deb-systemd-auto-start --deb-systemd-restart-after-upgrade --description "$DESC" \
    -s dir ./ydotool=/usr/bin/ydotool ./ydotoold=/usr/bin/ydotoold \
    manpage/ydotool.1.gz=/usr/share/man/man1/ydotool.1.gz \
    manpage/ydotoold.8.gz=/usr/share/man/man8/ydotoold.8.gz

Feel free to use this, or any other method, however:

  1. the path inside the the file ydotoold.service is /usr/local/bin/ydotool. But if you want to create a package /usr/bin/ydotool is probably more suitable.
  2. there is something wrong with this repository: git describe --tags does not return a full list of tags and it returns v0.0.1 instead.
  3. ~I'm not sure if you want to add --socket-perm=0666 by default in the service file. I did it for myself.~

maxadamo avatar Oct 17 '22 18:10 maxadamo

Adding 666 permissions by default is wrong. It's better to use a configuration file /etc/default/ydotool and add a socket permission parameter there. If the tags were working properly, you can detect the latest tag with the following command:

git describe --tags $(git rev-list --tags --max-count=1)

maxadamo avatar Oct 17 '22 19:10 maxadamo