Commit 38e8cdb0 authored by Michał Kępień's avatar Michał Kępień

Sync *.spec with Fedora

parent 9b1d23b1
......@@ -12,33 +12,28 @@
# Build -java subpackage
%bcond_with java
%global emacs_version %(pkg-config emacs --modversion)
%global emacs_lispdir %(pkg-config emacs --variable sitepkglispdir)
%global emacs_startdir %(pkg-config emacs --variable sitestartdir)
#global rcver rc2
Summary: Protocol Buffers - Google's data interchange format
Name: %{?scl_prefix}protobuf
Version: 3.6.1
Release: 3%{?dist}
Release: 5%{?dist}
License: BSD
URL: https://github.com/protocolbuffers/protobuf
Source: https://github.com/protocolbuffers/protobuf/archive/v%{version}%{?rcver}/%{pkg_name}-%{version}%{?rcver}-all.tar.gz
Source1: ftdetect-proto.vim
Source2: protobuf-init.el
# For tests
Source3: https://github.com/google/googlemock/archive/release-1.7.0.tar.gz#/googlemock-1.7.0.tar.gz
Source4: https://github.com/google/googletest/archive/release-1.7.0.tar.gz#/googletest-1.7.0.tar.gz
Source3: https://github.com/google/googletest/archive/release-1.8.1.tar.gz#/googletest-1.8.1.tar.gz
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: emacs(bin)
BuildRequires: emacs-el >= 24.1
BuildRequires: emacs
BuildRequires: gcc-c++
BuildRequires: libtool
BuildRequires: pkgconfig
BuildRequires: zlib-devel
Requires: emacs-filesystem >= %{_emacs_version}
%if 0%{?rhel} && 0%{?rhel} < 7
BuildRequires: devtoolset-7
%endif
......@@ -62,6 +57,8 @@ breaking deployed programs that are compiled against the "old" format.
%package compiler
Summary: Protocol Buffers compiler
Requires: %{name} = %{version}-%{release}
Obsoletes: protobuf-emacs < 3.6.1-4
Obsoletes: protobuf-emacs-el < 3.6.1-4
%description compiler
This package contains Protocol Buffers compiler for all programming
......@@ -164,25 +161,6 @@ Requires: vim-enhanced
This package contains syntax highlighting for Google Protocol Buffers
descriptions in Vim editor
%package emacs
Summary: Emacs mode for Google Protocol Buffers descriptions
BuildArch: noarch
Requires: emacs(bin) >= 0%{emacs_version}
%description emacs
This package contains syntax highlighting for Google Protocol Buffers
descriptions in the Emacs editor.
%package emacs-el
Summary: Elisp source files for Google protobuf Emacs mode
BuildArch: noarch
Requires: protobuf-emacs = %{version}
%description emacs-el
This package contains the elisp source files for %{name}-emacs
under GNU Emacs. You do not need to install this package to use
%{name}-emacs.
%if %{with java}
%package java
......@@ -229,9 +207,8 @@ Protocol Buffer Parent POM.
%endif
%prep
%setup -q -n %{pkg_name}-%{version}%{?rcver} -a 3 -a 4
mv googlemock-release-1.7.0 gmock
mv googletest-release-1.7.0 gmock/gtest
%setup -q -n %{pkg_name}-%{version}%{?rcver} -a 3
mv googletest-release-1.8.1/* third_party/googletest/
find -name \*.cc -o -name \*.h -execdir chmod -x {} \;
chmod 644 examples/*
%if %{with java}
......@@ -267,7 +244,7 @@ scl enable devtoolset-7 -- <<\EOF
%endif
%configure
make %{?_smp_mflags}
%make_build
%if 0%{?rhel} && 0%{?rhel} < 7
EOF
%endif
......@@ -283,18 +260,30 @@ popd
%mvn_build -s -- -f java/pom.xml
%endif
emacs -batch -f batch-byte-compile editors/protobuf-mode.el
%{_emacs_bytecompile} editors/protobuf-mode.el
%check
# TODO: failures; get them fixed and remove || :
# https://github.com/google/protobuf/issues/631
make %{?_smp_mflags} check || :
# Java tests fail on s390x
%ifarch s390x
fail=0
%else
fail=1
%endif
%if 0%{?rhel} && 0%{?rhel} < 7
scl enable devtoolset-7 -- <<\EOF
%endif
make %{?_smp_mflags} check || exit $fail
%if 0%{?rhel} && 0%{?rhel} < 7
EOF
%endif
%install
%if 0%{?rhel} && 0%{?rhel} < 7
scl enable devtoolset-7 -- <<\EOF
%endif
make %{?_smp_mflags} install DESTDIR=%{buildroot} STRIPBINARIES=no INSTALL="%{__install} -p" CPPROG="cp -p"
%make_install %{?_smp_mflags} STRIPBINARIES=no INSTALL="%{__install} -p" CPPROG="cp -p"
%if 0%{?rhel} && 0%{?rhel} < 7
EOF
%endif
......@@ -316,26 +305,28 @@ install -p -m 644 -D editors/proto.vim %{buildroot}%{_datadir}/vim/vimfiles/synt
%mvn_install
%endif
mkdir -p $RPM_BUILD_ROOT%{emacs_lispdir}
mkdir -p $RPM_BUILD_ROOT%{emacs_startdir}
install -p -m 0644 editors/protobuf-mode.el $RPM_BUILD_ROOT%{emacs_lispdir}
install -p -m 0644 editors/protobuf-mode.elc $RPM_BUILD_ROOT%{emacs_lispdir}
install -p -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{emacs_startdir}
mkdir -p %{buildroot}%{_emacs_sitelispdir}/%{name}
install -p -m 0644 editors/protobuf-mode.el %{buildroot}%{_emacs_sitelispdir}/%{name}
install -p -m 0644 editors/protobuf-mode.elc %{buildroot}%{_emacs_sitelispdir}/%{name}
mkdir -p %{buildroot}%{_emacs_sitestartdir}
install -p -m 0644 %{SOURCE2} %{buildroot}%{_emacs_sitestartdir}
%ldconfig_scriptlets
%ldconfig_scriptlets lite
%ldconfig_scriptlets compiler
%files
%{_libdir}/libprotobuf.so.17*
%doc CHANGES.txt CONTRIBUTORS.txt README.md
%doc LICENSE
%{_libdir}/libprotobuf.so.17*
%files compiler
%{_bindir}/protoc
%{_libdir}/libprotoc.so.17*
%doc README.md
%doc LICENSE
%{_bindir}/protoc
%{_libdir}/libprotoc.so.17*
%{_emacs_sitelispdir}/%{name}/
%{_emacs_sitestartdir}/protobuf-init.el
%files devel
%dir %{_includedir}/google
......@@ -381,13 +372,6 @@ install -p -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{emacs_startdir}
%{_datadir}/vim/vimfiles/ftdetect/proto.vim
%{_datadir}/vim/vimfiles/syntax/proto.vim
%files emacs
%{emacs_startdir}/protobuf-init.el
%{emacs_lispdir}/protobuf-mode.elc
%files emacs-el
%{emacs_lispdir}/protobuf-mode.el
%if %{with java}
%files java -f .mfiles-protobuf-java
%doc examples/AddPerson.java examples/ListPeople.java
......@@ -403,7 +387,14 @@ install -p -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{emacs_startdir}
%doc LICENSE
%endif
%changelog
* Wed May 8 2019 Orion Poplawski <orion@nwra.com> - 3.6.1-4
- Update emacs packaging to comply with guidelines
* Wed Feb 27 2019 Orion Poplawski <orion@nwra.com> - 3.6.1-3
- Update googletest to 1.8.1 to re-enable tests
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.6.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment