1
0
mirror of https://github.com/thp/pyotherside.git synced 2025-01-28 23:52:55 +08:00

Add packaging material for Fedora

This makes it easy to build a development RPM package for using
PyOtherSide on a Fedora machine. This it not intended to build
source tarballs, releases or .spec files for proper distribution
packages, but rather as convenience during development from Git.
This commit is contained in:
Thomas Perl 2014-01-31 11:57:30 +01:00
parent 6a3264f290
commit ecdb478dd4
2 changed files with 94 additions and 0 deletions

55
fedora/makefile Normal file
View File

@ -0,0 +1,55 @@
# Convenience makefile to build an RPM for Fedora from Git
#
# Requirements:
# - All build-dependencies (see .spec.in)
# - rpmbuild
# - git
#
# A source tarball and .spec file will be created in the rpmbuild home
# (usually ~/rpmbuild). From there, a binary RPM will be built.
NAME := pyotherside-qml-plugin-python3-qt5
VERSION := 1.0.0
GIT_REVISION := $(shell git show-ref HEAD | head -c 8)
RELEASE := 8+git$(GIT_REVISION)
RPMBUILD_HOME ?= $(HOME)/rpmbuild
RPMBUILD ?= rpmbuild
GIT ?= git
GZIP ?= gzip
SED ?= sed
RPMBUILD_SOURCES := $(RPMBUILD_HOME)/SOURCES
RPMBUILD_SPECS := $(RPMBUILD_HOME)/SPECS
TARBALL := $(RPMBUILD_SOURCES)/$(NAME)-$(VERSION).tar.gz
SPECFILE := $(RPMBUILD_SPECS)/$(NAME)-$(VERSION).spec
SPECFILE_IN := pyotherside.spec.in
# Inject RPM metadata into .spec file
SEDARGS += -e 's|%NAME%|$(NAME)|g'
SEDARGS += -e 's|%VERSION%|$(VERSION)|g'
SEDARGS += -e 's|%RELEASE%|$(RELEASE)|g'
# Create a source tarball from Git
GITARGS += archive --format=tar
GITARGS += --prefix=$(NAME)-$(VERSION)/
GITARGS += $(GIT_REVISION)
rpm: $(TARBALL) $(SPECFILE)
$(RPMBUILD) -bb $(SPECFILE)
$(RPMBUILD_SOURCES) $(RPMBUILD_SPECS):
mkdir -p $@
$(TARBALL): $(RPMBUILD_SOURCES)
cd .. && $(GIT) $(GITARGS) | $(GZIP) >$@
$(SPECFILE): $(SPECFILE_IN) $(RPMBUILD_SPECS)
$(SED) $(SEDARGS) $< >$@
clean:
$(RM) $(TARBALL) $(SPECFILE)
.PHONY: rpm $(TARBALL) clean

View File

@ -0,0 +1,39 @@
Summary: Asynchronous Python 3 Bindings for Qt 5
Name: %NAME%
Version: %VERSION%
Release: %RELEASE%
Source: %{name}-%{version}.tar.gz
URL: http://thp.io/2011/pyotherside/
License: ISC
Group: Development/Libraries
BuildRequires: python3-devel
BuildRequires: qt5-qtbase-devel
BuildRequires: pkgconfig(Qt5Gui)
BuildRequires: pkgconfig(Qt5Qml)
BuildRequires: pkgconfig(Qt5Quick)
BuildRequires: pkgconfig(Qt5Test)
Requires: python3-libs
%description
A QML Plugin that provides access to a Python 3 interpreter from QML.
%prep
%setup -q
%build
qmake-qt5
make %{?_smp_mflags}
%install
make INSTALL_ROOT=%{buildroot} install
%post
/sbin/ldconfig
%postun
/sbin/ldconfig
%files
%defattr(-,root,root)
%doc README COPYING
%{_libdir}/qt5/qml/io/thp/pyotherside/*