Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openSuSE Build service support #187

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .obs/workflows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
testbuild:
steps:
- link_package:
source_project: home:Thaodan:emacs:unstable
source_package: emacs-pdf-tools
target_project: home:Thaodan:emacs:unstable:ci
- configure_repositories:
project: home:Thaodan:emacs:unstable:ci
repositories:
- name: openSUSE_Tumbleweed
paths:
- target_project: home:Thaodan:emacs:unstable
target_repository: openSUSE_Tumbleweed
architectures:
- x86_64
- i586
- aarch64
filters:
event: pull_request

build_release:
steps:
- trigger_services:
project: home:Thaodan:emacs
package: emacs-pdf-tools
filters:
event: tag_push
branches:
only:
- master
rebuild_master:
steps:
- trigger_services:
project: home:Thaodan:emacs:unstable
package: emacs-pdf-tools
filters:
event: push
branches:
only:
- master
22 changes: 20 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,20 @@ emacs_version = $(shell $(emacs) --batch --eval \
$(info Using Emacs $(emacs_version))

version=$(shell sed -ne 's/^;\+ *Version: *\([0-9.]\)/\1/p' lisp/pdf-tools.el)
pkgname=pdf-tools-$(version)
PKG=pdf-tools
pkgname=$(PKG)-$(version)
pkgfile=$(pkgname).tar

.PHONY: all clean distclean bytecompile test check melpa

all: $(pkgfile)

# Create a elpa package including the server
$(pkgfile): .cask/$(emacs_version) server/epdfinfo lisp/*.el
$(pkgfile): .cask/$(emacs_version) server/epdfinfo lisp/*.el loaddefs
$(CASK) package .

loaddefs: $(PKG)-autoloads.el

# Compile the Lisp sources
bytecompile: .cask/$(emacs_version)
$(CASK) exec $(emacs) --batch -L lisp -f batch-byte-compile lisp/*.el
Expand Down Expand Up @@ -105,3 +108,18 @@ server-test-supported: server/test/Makefile

server-test-unsupported: server/test/Makefile
$(MAKE) -C server/test print-failing

$(PKG)-autoloads.el: lisp/*.el
@printf " Creating $@\n"
@cd lisp;$(EMACS) -Q --batch -l autoload -l cl-lib --eval "\
(let ((file (expand-file-name \"$@\"))\
(autoload-timestamps nil) \
(backup-inhibited t)\
(version-control 'never)\
(coding-system-for-write 'utf-8-emacs-unix))\
(write-region (autoload-rubric file \"package\" nil) nil file nil 'silent)\
(cl-letf (((symbol-function 'progress-reporter-do-update) (lambda (&rest _)))\
((symbol-function 'progress-reporter-done) (lambda (_))))\
(let ((generated-autoload-file file))\
(update-directory-autoloads default-directory))))" \
2>&1 | sed "/^Package autoload is deprecated$$/d"
111 changes: 111 additions & 0 deletions rpm/emacs-pdf-tools.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
#
# spec file for package emacs-pdf-tools
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


%global _name pdf-tools

Name: emacs-%{_name}
Version: 1.1.0.10.c69e765
Release: 0
Summary: PDF tools for emacs
Group: Productivity/Text/Editors
License: BSD-3-Clause AND GPL-3.0-only
URL: https://github.com/vedang/pdf-tools
Source0: %{_name}-%{version}.tar.gz
# PATCH-FIX-UPSTREAM Add target to generate loaddefs based on PR 187
Patch1: 0001-Add-make-target-to-generate-loaddefs.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: emacs
BuildRequires: emacs-tablist-el
BuildRequires: gcc-c++
BuildRequires: texinfo
BuildRequires: pkgconfig(libpng)
BuildRequires: pkgconfig(libpng16)
BuildRequires: pkgconfig(poppler)
BuildRequires: pkgconfig(poppler-glib)
BuildRequires: pkgconfig(zlib)
Requires: %{name}-common
Requires: emacs
Requires: emacs-tablist

%description
%{summary}.

%package el
Summary: Lisp files for %{_name}
Group: Productivity/Editors/Emacs
Requires: %{name} = %{version}-%{release}
Requires: emacs-tablist-el
BuildArch: noarch

%description el
%{summary}.

%package common
Summary: Architecture indenpendent files for %{_name}
Group: Productivity/Editors/Emacs
Requires: %{name} = %{version}-%{release}
BuildArch: noarch

%description common
%{summary}.

%prep
%autosetup -n %{_name}-%{version}

%build
emacs --batch -L lisp -f batch-byte-compile lisp/*.el

%make_build loaddefs

pushd server
./autogen.sh
%configure

%make_build

%install
mkdir -p %{buildroot}/%{_emacs_sitestartdir}
mkdir -p %{buildroot}/%{_emacs_sitelispdir}/%{_name}
mkdir -p %{buildroot}/%{_docdir}/%{_name}
install -m644 lisp/*.el{,c} %{buildroot}/%{_emacs_sitelispdir}/%{_name}/
install -m644 README.org %{buildroot}/%{_docdir}/%{_name}/
install -D -m755 server/epdfinfo %{buildroot}/%{_bindir}/epdfinfo

cat << EOF > %{buildroot}/%{_emacs_sitestartdir}/%{_name}-init.el
(add-to-list 'load-path "%{_emacs_sitelispdir}/%{_name}")
(load "%{_emacs_sitelispdir}/%{_name}/%{_name}-autoloads.el")
EOF

%files
%{_bindir}/epdfinfo
%license COPYING
%license COPYING.SYNCTEX

%files el
%{_emacs_sitelispdir}/%{_name}/*.el

%files common
%{_emacs_sitelispdir}/%{_name}/*.elc
%dir %{_emacs_sitelispdir}/%{_name}/
%dir %{_emacs_sitestartdir}
%{_emacs_sitestartdir}/%{_name}-init.el
%doc %{_docdir}/%{_name}/*
%dir %{_docdir}/%{_name}

%changelog