Skip to content

Commit

Permalink
Update Makefile and remove polkit
Browse files Browse the repository at this point in the history
  • Loading branch information
newtoallofthis123 committed Aug 25, 2024
1 parent c2655a4 commit cd21e58
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 98 deletions.
12 changes: 3 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ DESTDIR ?= "/"
DAEMON_BINARY := swhkd
SERVER_BINARY := swhks
BUILDFLAGS := --release
POLKIT_DIR := /usr/share/polkit-1/actions
POLKIT_POLICY_FILE := com.github.swhkd.pkexec.policy
TARGET_DIR := /usr/bin
MAN1_DIR := /usr/share/man/man1
MAN5_DIR := /usr/share/man/man5
Expand All @@ -15,19 +13,17 @@ all: build

build:
@cargo build $(BUILDFLAGS)
@./scripts/build-polkit-policy.sh \
--policy-path=$(POLKIT_POLICY_FILE) \
--swhkd-path=$(TARGET_DIR)/$(DAEMON_BINARY)

install:
@find ./docs -type f -iname "*.1.gz" \
-exec install -Dm 644 {} -t $(DESTDIR)/$(MAN1_DIR) \;
@find ./docs -type f -iname "*.5.gz" \
-exec install -Dm 644 {} -t $(DESTDIR)/$(MAN5_DIR) \;
@install -Dm 755 ./target/release/$(DAEMON_BINARY) -t $(DESTDIR)/$(TARGET_DIR)
@sudo chown root:root $(DESTDIR)/$(TARGET_DIR)/$(DAEMON_BINARY)
@sudo chmod u+s $(DESTDIR)/$(TARGET_DIR)/$(DAEMON_BINARY)
@install -Dm 755 ./target/release/$(SERVER_BINARY) -t $(DESTDIR)/$(TARGET_DIR)
@install -Dm 644 -o root ./$(POLKIT_POLICY_FILE) -t $(DESTDIR)/$(POLKIT_DIR)
# Ideally, we would have a default config file instead of an empty one
# Ideally, we would have a default config file instead of an empty one
@if [ ! -f $(DESTDIR)/etc/$(DAEMON_BINARY)/$(DAEMON_BINARY)rc ]; then \
touch ./$(DAEMON_BINARY)rc; \
install -Dm 644 ./$(DAEMON_BINARY)rc -t $(DESTDIR)/etc/$(DAEMON_BINARY); \
Expand All @@ -38,7 +34,6 @@ uninstall:
@$(RM) -f /usr/share/man/**/swhks.*
@$(RM) $(TARGET_DIR)/$(SERVER_BINARY)
@$(RM) $(TARGET_DIR)/$(DAEMON_BINARY)
@$(RM) $(POLKIT_DIR)/$(POLKIT_POLICY_FILE)

check:
@cargo fmt
Expand All @@ -57,7 +52,6 @@ clean:
@cargo clean
@$(RM) -f ./docs/*.gz
@$(RM) -f $(DAEMON_BINARY)rc
@$(RM) -f $(POLKIT_POLICY_FILE)

setup:
@rustup install stable
Expand Down
89 changes: 0 additions & 89 deletions scripts/build-polkit-policy.sh

This file was deleted.

0 comments on commit cd21e58

Please sign in to comment.