Skip to content

Commit

Permalink
.github(Fedora): Rename the package
Browse files Browse the repository at this point in the history
The package name should have the prefix `obs-studio-plugin-`.
  • Loading branch information
norihiro committed Apr 17, 2024
1 parent a335af8 commit ae21fb4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
10 changes: 6 additions & 4 deletions .github/containers/fedora-common/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ docker_image="$1"
rpmbuild="$2"

PLUGIN_NAME=$(awk '/^project\(/{print gensub(/project\(([^ ()]*).*/, "\\1", 1, $0)}' CMakeLists.txt)
PLUGIN_NAME_FEDORA="$(sed -e 's/^obs-/obs-studio-plugin-/' <<< "$PLUGIN_NAME")"
eval $(git describe --tag --always --long | awk '
BEGIN {
VERSION="unknown";
Expand All @@ -32,16 +33,17 @@ test -x /usr/sbin/selinuxenabled && /usr/sbin/selinuxenabled && chcon -Rt contai
# Prepare files
sed \
-e "s/@PLUGIN_NAME@/$PLUGIN_NAME/g" \
-e "s/@PLUGIN_NAME_FEDORA@/$PLUGIN_NAME_FEDORA/g" \
-e "s/@VERSION@/$VERSION/g" \
-e "s/@RELEASE@/$RELEASE/g" \
< ci/plugin.spec \
> $rpmbuild/SPECS/$PLUGIN_NAME.spec
> $rpmbuild/SPECS/$PLUGIN_NAME_FEDORA.spec

git archive --format=tar --prefix=$PLUGIN_NAME-$VERSION/ HEAD | bzip2 > $rpmbuild/SOURCES/$PLUGIN_NAME-$VERSION.tar.bz2
git archive --format=tar --prefix=$PLUGIN_NAME_FEDORA-$VERSION/ HEAD | bzip2 > $rpmbuild/SOURCES/$PLUGIN_NAME_FEDORA-$VERSION.tar.bz2

docker run -v $rpmbuild:/home/rpm/rpmbuild $docker_image bash -c "
sudo dnf builddep -y ~/rpmbuild/SPECS/$PLUGIN_NAME.spec &&
sudo dnf builddep -y ~/rpmbuild/SPECS/$PLUGIN_NAME_FEDORA.spec &&
sudo chown 0.0 ~/rpmbuild/SOURCES/* &&
sudo chown 0.0 ~/rpmbuild/SPECS/* &&
rpmbuild -ba ~/rpmbuild/SPECS/$PLUGIN_NAME.spec
rpmbuild -ba ~/rpmbuild/SPECS/$PLUGIN_NAME_FEDORA.spec
"
7 changes: 4 additions & 3 deletions ci/plugin.spec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Name: @PLUGIN_NAME@
Name: @PLUGIN_NAME_FEDORA@
Version: @VERSION@
Release: @RELEASE@%{?dist}
Summary: Dummy command source plugin for OBS Studio
Expand All @@ -7,6 +7,7 @@ License: GPLv2+
Source0: %{name}-%{version}.tar.bz2
BuildRequires: cmake, gcc, gcc-c++
BuildRequires: obs-studio-devel
Obsoletes: @PLUGIN_NAME@ < %{version}

%description
Command source plugin for OBS Studio provides a dummy source that execute
Expand All @@ -23,5 +24,5 @@ arbitrary commands when a scene is switched.
%{cmake_install}

%files
%{_libdir}/obs-plugins/%{name}.so
%{_datadir}/obs/obs-plugins/%{name}/
%{_libdir}/obs-plugins/@PLUGIN_NAME@.so
%{_datadir}/obs/obs-plugins/@PLUGIN_NAME@/

0 comments on commit ae21fb4

Please sign in to comment.