From 30798bd1b623c184e4d52d6268c8da5fe1b71ce0 Mon Sep 17 00:00:00 2001 From: ldelossa Date: Mon, 27 May 2024 19:18:16 -0400 Subject: [PATCH] packaging: initial copr support Update makefile and adds a .spec file for Copr. Signed-off-by: ldelossa --- Makefile | 25 +++++----- contrib/systemd/way-shell.service | 2 +- way-shell.spec | 81 +++++++++++++++++++++++++++++++ 3 files changed, 96 insertions(+), 12 deletions(-) create mode 100644 way-shell.spec diff --git a/Makefile b/Makefile index 75306be..48758fa 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,8 @@ +PREFIX ?= /usr +BINDIR ?= $(PREFIX)/bin +SCHEMADIR ?= $(PREFIX)/share/glib-2.0/schemas +USERUNITDIR ?= $(PREFIX)/lib/systemd/user + CC := gcc DEPS := libadwaita-1 \ upower-glib \ @@ -19,9 +24,7 @@ SOURCES := $(shell find src/ -type f -name *.c) OBJS := $(patsubst %.c, %.o, $(SOURCES)) OBJS += lib/cmd_tree/cmd_tree.o -all: wlr-protocols gschema gresources way-shell lib/cmd_tree/cmd_tree.o way-sh/way-sh - -install: all gschema +all: wlr-protocols gresources way-shell way-sh/way-sh way-shell: $(OBJS) $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) @@ -36,11 +39,6 @@ gresources: glib-compile-resources --generate-source --target src/gresources.c gresources.xml glib-compile-resources --generate-header --target src/gresources.h gresources.xml -.PHONY: -gschema: ./data/org.ldelossa.way-shell.gschema.xml - sudo cp data/org.ldelossa.way-shell.gschema.xml /usr/share/glib-2.0/schemas/ - sudo glib-compile-schemas /usr/share/glib-2.0/schemas/ - .PHONY: wlr-protocols: wayland-scanner client-header < ./data/wlr-protocols/unstable/wlr-foreign-toplevel-management-unstable-v1.xml > ./src/services/wayland_service/wlr-foreign-toplevel-management-unstable-v1.h @@ -90,11 +88,16 @@ dbus-codegen: --output-directory ./src/services/media_player_service \ ./data/dbus-interfaces/org.mpris.MediaPlayer2.xml +.PHONY: +install-gschema: + glib-compile-schemas $(DESTDIR)$(SCHEMADIR) + .PHONY: install: - sudo rm -rf /usr/local/bin/{way-shell,way-sh} - sudo cp ./way-shell /usr/local/bin - sudo cp ./way-sh/way-sh /usr/local/bin + install -D ./way-shell $(DESTDIR)$(BINDIR)/way-shell + install -D ./way-sh/way-sh $(DESTDIR)$(BINDIR)/way-sh + install -D data/org.ldelossa.way-shell.gschema.xml $(DESTDIR)$(SCHEMADIR)/org.ldelossa.way-shell.gschema.xml + install -D contrib/systemd/way-shell.service $(DESTDIR)$(USERUNITDIR)/way-shell.service clean: find . -name "*.o" -type f -exec rm -f {} \; diff --git a/contrib/systemd/way-shell.service b/contrib/systemd/way-shell.service index b84eba3..ae39c20 100644 --- a/contrib/systemd/way-shell.service +++ b/contrib/systemd/way-shell.service @@ -11,7 +11,7 @@ Type=Exec # This directive tells systemd to only kill the main process when Way-Shell is # restarted or crashes, avoiding the killing of any launched apps. KillMode=process -ExecStart=/usr/local/bin/way-shell +ExecStart=/usr/bin/way-shell [Install] WantedBy=sway-session.target diff --git a/way-shell.spec b/way-shell.spec new file mode 100644 index 0000000..ffdd277 --- /dev/null +++ b/way-shell.spec @@ -0,0 +1,81 @@ +%define _userunitdir /usr/lib/systemd/user + +Name: way-shell +Version: 0.0.1 +Release: 1%{?dist} +Summary: A Gnome-like desktop shell for Wayland compositors. +License: MIT + +URL: https://github.com/ldelossa/way-shell +Source0: https://github.com/ldelossa/way-shell/archive/refs/heads/copr-repo.tar.gz + +BuildRequires: gcc +BuildRequires: make +BuildRequires: pkgconfig +BuildRequires: meson +BuildRequires: cmake +BuildRequires: gtk-doc +BuildRequires: wayland-devel +BuildRequires: glib2-devel + +BuildRequires: pkgconfig(libadwaita-1) +BuildRequires: pkgconfig(upower-glib) +BuildRequires: pkgconfig(wireplumber-0.5) +BuildRequires: pkgconfig(json-glib-1.0) +BuildRequires: pkgconfig(libnm) +BuildRequires: pkgconfig(libpulse) +BuildRequires: pkgconfig(libpulse-simple) +BuildRequires: pkgconfig(libpulse-mainloop-glib) +BuildRequires: pkgconfig(wayland-client) +BuildRequires: pkgconfig(wayland-protocols) +BuildRequires: pkgconfig(gio-unix-2.0) +BuildRequires: pkgconfig(gtk4-layer-shell-0) + +Requires: NetworkManager +Requires: wireplumber +Requires: upower +Requires: power-profiles-daemon +Requires: systemd + +%description +A Gnome inspired desktop shell for Wayland compositors/window managers written +in C and Gtk4. + +Way-Shell expects a Gnome-like environment to be available. +This means DBus must be running and the following services must be available: + +- Logind +- NetworkManager +- WirePlumber/Pipewire +- PowerProfiles Daemon +- UPower + +If you're using Fedora these services should be available by default. + +Currently Way-Shell only supports Sway but this will change as the project +matures. + +%prep +%setup -n way-shell-copr-repo + +%build +make %{?_smp_mflags} + +%install +make install DESTDIR=%{buildroot} + +%post +glib-compile-schemas %{_datadir}/glib-2.0/schemas + +%postun +glib-compile-schemas %{_datadir}/glib-2.0/schemas + +%files +%{_bindir}/way-shell +%{_bindir}/way-sh +%{_datadir}/glib-2.0/schemas/org.ldelossa.way-shell.gschema.xml +%{_userunitdir}/way-shell.service + +%changelog +* Mon May 27 2024 Louis DeLosSantos +- Initial packaging