-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add top-level Makefile and RPM spec file for packaging
Top-level Makefile can create tar and RPM files to release. Also add *.tar.gz to .gitignore.
- Loading branch information
1 parent
f70c0cb
commit d085fd4
Showing
3 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
*.tar.gz | ||
*.o | ||
.deps | ||
.gdb_history | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
NAME := alsa-scarlett-gui | ||
VERSION := $(shell git describe --abbrev=4 --always --tags | sed 's/-/./g') | ||
NAMEVER := $(NAME)-$(VERSION) | ||
TAR_FILE := $(NAMEVER).tar | ||
TARGZ_FILE := $(TAR_FILE).gz | ||
SPEC_FILE := $(NAME).spec | ||
|
||
default: | ||
@echo "alsa-scarlett-gui" | ||
@echo | ||
@echo "If you want to build and install from source, please try:" | ||
@echo " cd src" | ||
@echo " make -j4" | ||
@echo " sudo make install" | ||
@echo | ||
@echo "This Makefile knows about packaging:" | ||
@echo " make tar" | ||
@echo " make rpm" | ||
|
||
tar: $(TARGZ_FILE) | ||
|
||
$(TARGZ_FILE): | ||
git archive --format=tar --prefix=$(NAMEVER)/ HEAD > $(TAR_FILE) | ||
sed 's_VERSION$$_$(VERSION)_' < $(SPEC_FILE).template > $(SPEC_FILE) | ||
tar --append -f $(TAR_FILE) \ | ||
--transform s_^_$(NAMEVER)/_ \ | ||
--owner=root --group=root \ | ||
$(SPEC_FILE) | ||
rm -f $(SPEC_FILE) | ||
gzip < $(TAR_FILE) > $(TARGZ_FILE) | ||
rm -f $(TAR_FILE) | ||
|
||
rpm: $(TARGZ_FILE) | ||
rpmbuild -tb $(TARGZ_FILE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
Summary: ALSA Scarlett Gen 2/3 Control Panel | ||
Name: alsa-scarlett-gui | ||
Version: VERSION | ||
Release: 1%{?dist} | ||
License: GPLv3+ LGPLv3+ | ||
Url: https://github.com/geoffreybennett/alsa-scarlett-gui | ||
Source: %{name}-%{version}.tar.gz | ||
|
||
%description | ||
|
||
alsa-scarlett-gui is a Gtk4 GUI for the ALSA controls presented by the | ||
Linux kernel Focusrite Scarlett Gen 2/3 Mixer Driver. | ||
|
||
%prep | ||
%setup | ||
|
||
%build | ||
make -C src -j4 VERSION=%{version} PREFIX=/usr | ||
|
||
%install | ||
%make_install -C src PREFIX=/usr | ||
DOCDIR=%{buildroot}/usr/share/doc/%{name}-%{version} | ||
mkdir -p $DOCDIR/img | ||
mkdir $DOCDIR/demo | ||
cp *.md $DOCDIR | ||
cp img/* $DOCDIR/img | ||
cp demo/* $DOCDIR/demo | ||
|
||
%files | ||
%doc /usr/share/doc/%{name}-%{version} | ||
/usr/bin/alsa-scarlett-gui | ||
/usr/share/applications/vu.b4.alsa-scarlett-gui.desktop | ||
/usr/share/icons/hicolor/256x256/apps/alsa-scarlett-gui.png |