Update Makefile and systemd files

* Change the ordering of 'make install' so that directories and
permissions are set first
* Use wildcard to copy service files to systemd directory as 'install'
was failing when there was @ in the script
* Update systemd units files based on
https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/ for
starting the onedrive service
This commit is contained in:
abraunegg 2018-04-22 08:29:43 +10:00
parent 63f991a64e
commit da9cc628cb
3 changed files with 6 additions and 8 deletions

View file

@ -22,15 +22,13 @@ clean:
rm -f onedrive onedrive.o onedrive.service
install: all
install -D onedrive $(DESTDIR)$(PREFIX)/bin/onedrive
install -D -m 644 onedrive.service $(DESTDIR)/usr/lib/systemd/user/onedrive.service
install -D -m 644 onedrive@.service $(DESTDIR)/usr/lib/systemd/user/onedrive@.service
install -D -m 644 logrotate/onedrive.logrotate /etc/logrotate.d/onedrive
mkdir -p /var/log/onedrive
chown root.users /var/log/onedrive
chmod 0775 /var/log/onedrive
rm -f ~/.config/onedrive/items.sqlite3
install -D onedrive $(DESTDIR)$(PREFIX)/bin/onedrive
install -D -m 644 logrotate/onedrive.logrotate /etc/logrotate.d/onedrive
chmod 0644 $(DESTDIR)/usr/lib/systemd/user/onedrive*.service
onedrive: version $(SOURCES)
$(DC) $(DFLAGS) $(SOURCES)

View file

@ -1,8 +1,8 @@
[Unit]
Description=OneDrive Free Client
Documentation=https://github.com/skilion/onedrive
Requires=network-online.target
After=network-online.target
Wants=network-online.target
[Service]
ExecStart=@PREFIX@/bin/onedrive --monitor

View file

@ -1,8 +1,8 @@
[Unit]
Description=OneDrive Free Client for %i
Documentation=https://github.com/skilion/onedrive
Requires=network-online.target
After=network-online.target
Wants=network-online.target
[Service]
ExecStart=@PREFIX@/bin/onedrive --monitor --confdir=/home/%i/.config/onedrive